[jira] [Commented] (IGNITE-4465) Read-through is not properly working with multiple gets executed in parallel

2016-12-22 Thread Semen Boikov (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-4465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15770305#comment-15770305
 ] 

Semen Boikov commented on IGNITE-4465:
--

Implemented following fix: before trying to load entry from store we need 
somehow prevent entry eviction, for this I added 'IS_EVICT_DISABLED' flag in 
GridCacheMapEntry. This flag is set in innerGetVersioned and then should be 
reset after load is finished, also this flag is reset each time entry is 
updated. Initial test stared to pass, need verify on tests on TeamCity.

> Read-through is not properly working with multiple gets executed in parallel
> 
>
> Key: IGNITE-4465
> URL: https://issues.apache.org/jira/browse/IGNITE-4465
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.8
>Reporter: Valentin Kulichenko
>Assignee: Semen Boikov
>Priority: Critical
> Fix For: 1.9
>
> Attachments: ReadThroughTest.java
>
>
> The issue is sporadic and very hard to isolate, however I managed to create a 
> test that reproduces it. Basically, the scenario is the following:
> * We have one server and one client.
> * The client creates a cache with read through enabled.
> * The client then executes bunch of jobs (number of jobs is bigger than 
> number of threads in server's public pool) asynchronously in parallel.
> * {{CacheStore.load()}} method is called more than once and invocations go 
> one after another (sometimes even in the same thread!) with an interval of a 
> bit more than one second, which is the duration of load (there is a 
> {{Thread.sleep(1000)}} in the implementation.
> * In addition, statistics show that number of misses go up to 50 which is 
> number of jobs. I would not expect more than 16 there. First 16 jobs executed 
> in parallel can all register miss at the same time before load happens. But 
> all consecutive execution must read the value from cache.
> Test is attached.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IGNITE-4465) Read-through is not properly working with multiple gets executed in parallel

2016-12-21 Thread Semen Boikov (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-4465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15766830#comment-15766830
 ] 

Semen Boikov commented on IGNITE-4465:
--

I think now this is possible since empty entry can be concurrently removed 
between 'innerGet' and store loading, so 'get' will return loaded value but it 
will not be stored in entry:
- t1 calls entry.innerGetVersioned in GridCacheAdapter.getAllAsync0, it returns 
null, then T1 saves entry key/version in 'misses' map (note - one more race 
here, entry.version() already could change after innerGetVersioned call) 
- some other t2 calls ctx.evicts().touch(entry) for the same entry (e.g. from 
GridPartitionedSingleGetFuture.localGet), entry is empty, it is obsoleted and 
removed
- t1 loaded value from store and calls entry.versionedValue, original entry was 
obsoleted, so version check does not pass and value is not stored in entry


> Read-through is not properly working with multiple gets executed in parallel
> 
>
> Key: IGNITE-4465
> URL: https://issues.apache.org/jira/browse/IGNITE-4465
> Project: Ignite
>  Issue Type: Bug
>  Components: cache
>Affects Versions: 1.8
>Reporter: Valentin Kulichenko
>Assignee: Semen Boikov
>Priority: Critical
> Fix For: 1.9
>
> Attachments: ReadThroughTest.java
>
>
> The issue is sporadic and very hard to isolate, however I managed to create a 
> test that reproduces it. Basically, the scenario is the following:
> * We have one server and one client.
> * The client creates a cache with read through enabled.
> * The client then executes bunch of jobs (number of jobs is bigger than 
> number of threads in server's public pool) asynchronously in parallel.
> * {{CacheStore.load()}} method is called more than once and invocations go 
> one after another (sometimes even in the same thread!) with an interval of a 
> bit more than one second, which is the duration of load (there is a 
> {{Thread.sleep(1000)}} in the implementation.
> * In addition, statistics show that number of misses go up to 50 which is 
> number of jobs. I would not expect more than 16 there. First 16 jobs executed 
> in parallel can all register miss at the same time before load happens. But 
> all consecutive execution must read the value from cache.
> Test is attached.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)