there is a bug for IgniteCache.removeAll()

classic Classic list List threaded Threaded
3 messages Options
smilehong smilehong
Reply | Threaded
Open this post in threaded view
|

there is a bug for IgniteCache.removeAll()

the removeAll of IgniteCache class is defined as follow:

and we test it using the following code in PATITIONED mode(1 client, 2 servers, all processes in the same host, ATOMIC mode):

for (int i = 0; i < 10000; ++i)
{
    cache.removeAll();
    cache.put(1, contact);
    assertEquals(contact, cache.get(1));
}

the result is always failed , which means that we put key=1 and can't get it,  for example, when we loop at i = 42, then 
cache.get(1) == null;

we track this bug for a long time,  finally we find that the removeAll operation is not complete synchronization,  ignite use one thread to generate all keys to DataStreamer, and another thread execute remove opertation from DataStreamer;  so when removeAll operation is finished, but the data may not have been removed;

so, if client send a put request before that servers execute remove operation, when servers received put request, find that the put request version(GridCacheVersion) is smaller than the current version, and then servers ignore this put request;  also there are debug log as follow:

 
so how can we resolved this bug ? 

ps : we use ignite1.4.0 version
Semyon Boikov Semyon Boikov
Reply | Threaded
Open this post in threaded view
|

Re: there is a bug for IgniteCache.removeAll()

Hi,

This is known issue for ATOMIC cache with CLOCK write order mode, please try set write order mode = PRIMARY (CacheConfiguration.setAtomicWriteOrderMode(CacheAtomicWriteOrderMode.PRIMARY)).

On Wed, Jun 8, 2016 at 10:51 AM, 往事如烟 <[hidden email]> wrote:
the removeAll of IgniteCache class is defined as follow:

and we test it using the following code in PATITIONED mode(1 client, 2 servers, all processes in the same host, ATOMIC mode):

for (int i = 0; i < 10000; ++i)
{
    cache.removeAll();
    cache.put(1, contact);
    assertEquals(contact, cache.get(1));
}

the result is always failed , which means that we put key=1 and can't get it,  for example, when we loop at i = 42, then 
cache.get(1) == null;

we track this bug for a long time,  finally we find that the removeAll operation is not complete synchronization,  ignite use one thread to generate all keys to DataStreamer, and another thread execute remove opertation from DataStreamer;  so when removeAll operation is finished, but the data may not have been removed;

so, if client send a put request before that servers execute remove operation, when servers received put request, find that the put request version(GridCacheVersion) is smaller than the current version, and then servers ignore this put request;  also there are debug log as follow:

 
so how can we resolved this bug ? 

ps : we use ignite1.4.0 version

smilehong smilehong
Reply | Threaded
Open this post in threaded view
|

回复: there is a bug for IgniteCache.removeAll()


Thank you very much!

Yes, we set the write order mode to PRIMARY,  then the test is passed,  thanks again, 


------------------ 原始邮件 ------------------
发件人: "Semyon Boikov";<[hidden email]>;
发送时间: 2016年6月9日(星期四) 下午2:01
收件人: "user"<[hidden email]>;
主题: Re: there is a bug for IgniteCache.removeAll()

Hi,

This is known issue for ATOMIC cache with CLOCK write order mode, please try set write order mode = PRIMARY (CacheConfiguration.setAtomicWriteOrderMode(CacheAtomicWriteOrderMode.PRIMARY)).

On Wed, Jun 8, 2016 at 10:51 AM, 往事如烟 <[hidden email]> wrote:
the removeAll of IgniteCache class is defined as follow:

and we test it using the following code in PATITIONED mode(1 client, 2 servers, all processes in the same host, ATOMIC mode):

for (int i = 0; i < 10000; ++i)
{
    cache.removeAll();
    cache.put(1, contact);
    assertEquals(contact, cache.get(1));
}

the result is always failed , which means that we put key=1 and can't get it,  for example, when we loop at i = 42, then 
cache.get(1) == null;

we track this bug for a long time,  finally we find that the removeAll operation is not complete synchronization,  ignite use one thread to generate all keys to DataStreamer, and another thread execute remove opertation from DataStreamer;  so when removeAll operation is finished, but the data may not have been removed;

so, if client send a put request before that servers execute remove operation, when servers received put request, find that the put request version(GridCacheVersion) is smaller than the current version, and then servers ignore this put request;  also there are debug log as follow:

 
so how can we resolved this bug ? 

ps : we use ignite1.4.0 version