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

Ivan Veselovsky commented on IGNITE-2938:
-----------------------------------------

Problem is in method  
org.apache.ignite.internal.processors.igfs.IgfsDataManager#dataBlock that 
invokes method 
org.apache.ignite.internal.processors.igfs.IgfsDataManager#putSafe .
The scenario is the following:
1) File read requested from primary Fs. But #dataBlock method sees null value 
for the block key .
2) Method #dataBlock gets the value from the secondary file system, and returns 
it. But before that it invokes method #putSafe , that schedules asynchronous 
put() of the value into primary file system. This task scheduled into 
putExecSvc pool.
3) Another modification operation  (e.g. append) executes and rewrites the data 
block.
4) The task submitted in step "2)" does put() operation and overwrites more 
recent value with the old one. At this point we have data inconsistency.



> IgfsBackupsDualAsyncSelfTest.testAppendParentMissing and 
> IgfsBackupsDualAsyncSelfTest.testAppendParentMissingPartially fail sometimes 
> on master
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-2938
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2938
>             Project: Ignite
>          Issue Type: Test
>          Components: IGFS
>    Affects Versions: 1.5.0.final
>            Reporter: Ivan Veselovsky
>            Assignee: Ivan Veselovsky
>             Fix For: 1.6
>
>
> Tests 
>   IgfsBackupsDualAsyncSelfTest.testAppendParentMissing        
>   IgfsBackupsDualAsyncSelfTest.testAppendParentMissingPartially       
> fail from time to time on master -- need to investigate. 
> It looks like that started to happen after fix  
> https://issues.apache.org/jira/browse/IGNITE-1631 .
> The failure happens with probability ~1/50 :
> {code}
> [18:14:50,772][INFO ][main][root] >>> Starting test: 
> IgfsBackupsDualAsyncSelfTest#testAppendParentMissingPartially <<<
> [18:14:50,792][ERROR][main][root] Test failed.
> java.io.IOException: Inconsistent file's data block (incorrectly written?) 
> [path=/dir/subdir/file, blockIdx=0, blockSize=128, expectedBlockSize=256, 
> fileBlockSize=524288, fileLen=256]
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsInputStreamImpl.block(IgfsInputStreamImpl.java:485)
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsInputStreamImpl.blockFragmentizerSafe(IgfsInputStreamImpl.java:399)
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsInputStreamImpl.readFromStore(IgfsInputStreamImpl.java:373)
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsInputStreamImpl.readFully(IgfsInputStreamImpl.java:222)
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsInputStreamImpl.readFully(IgfsInputStreamImpl.java:216)
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsAbstractSelfTest.checkFileContent(IgfsAbstractSelfTest.java:2999)
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsAbstractSelfTest.checkFile(IgfsAbstractSelfTest.java:2969)
>       at 
> org.apache.ignite.internal.processors.igfs.IgfsDualAbstractSelfTest.testAppendParentMissingPartially(IgfsDualAbstractSelfTest.java:1364)
>       at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:606)
>       at junit.framework.TestCase.runTest(TestCase.java:176)
>       at 
> org.apache.ignite.testframework.junits.GridAbstractTest.runTestInternal(GridAbstractTest.java:1759)
>       at 
> org.apache.ignite.testframework.junits.GridAbstractTest.access$000(GridAbstractTest.java:118)
>       at 
> org.apache.ignite.testframework.junits.GridAbstractTest$4.run(GridAbstractTest.java:1697)
>       at java.lang.Thread.run(Thread.java:745)
> {code}



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

Reply via email to