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

Alexey Kuznetsov edited comment on IGNITE-6083 at 2/20/18 3:41 PM:
-------------------------------------------------------------------

[~agoncharuk] when first entry processor is called in tx#enlistWriteEntry(), 
cache entry is pulled from cache by entry.innerGet(). 
 So first entry processor observes non-null value [see 
source|https://github.com/voipp/ignite/blob/49cd833eed456917b4435fc12ffcce6a689dcccc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java#L1319].
 This value _*would not be saved*_ in IgniteTxEntry.

When entry processor is called a second time, it gets value from 
IgniteTxEntry#value , which is null, because we didn't set any value at first 
call [see 
source|https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java#L1401]

 

PS. It seems odd, that entry processor is called multiple times : before 
transaction commit and during prepare phase(after locks are aquired).

And the value is set on finish phase in innerSet. I think, we can call only 
once : before commit, and save the value in Tx entry.


was (Author: alexey kuznetsov):
[~agoncharuk] when first entry processor is called in tx#enlistWriteEntry(), 
cache entry is pulled from cache by entry.innerGet(). 
 So first entry processor observes non-null value [see 
source|https://github.com/voipp/ignite/blob/49cd833eed456917b4435fc12ffcce6a689dcccc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java#L1319].
 This value _*would not be saved*_ in IgniteTxEntry.

When entry processor is called a second time, it gets value from 
IgniteTxEntry#value , which is null, because we didn't set any value at first 
call.

 

PS. It seems odd, that entry processor is called multiple times : before 
transaction commit and during prepare phase(after locks are aquired).

And the value is set on finish phase in innerSet. I think, we can call only 
once : before commit, and save the value in Tx entry.

> Null value have appear in the entry processor, but the entry is existing
> ------------------------------------------------------------------------
>
>                 Key: IGNITE-6083
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6083
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache
>    Affects Versions: 2.1
>            Reporter: Vladislav Pyatkov
>            Assignee: Alexey Kuznetsov
>            Priority: Major
>         Attachments: EntryProcessorInOptimisticTxTest.java
>
>
> In one thread load some data in a cache, after that I have execute 
> OPTIMISTIC, SERIALIZABLE transaction with two {{IgniteCache.invoke()}} 
> methods.
> The value had been corrected at first {{EntryProcessor}}, but it is NULL at 
> second.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to