Bug 1016054

Summary: CommitCommand with replayed PrepareCommand executes rollback and then commit
Product: [JBoss] JBoss Data Grid 6 Reporter: Radim Vansa <rvansa>
Component: InfinispanAssignee: Tristan Tarrant <ttarrant>
Status: VERIFIED --- QA Contact: Martin Gencur <mgencur>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: jdg-bugs
Target Milestone: ER4   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1017190    

Description Radim Vansa 2013-10-07 12:14:25 UTC
During state-transfer in tx cache, the node can receive CommitCommand from other node. After the node gets transaction data for affected segments, it creates the transaction with missingLookedUpEntries=true and the CommitCommand can be executed.
In this command's perform(...) the transaction is first marked as completed, then it enters the interceptor chain. There, the PrepareCommand is created in StateTransferInterceptor.visitCommitCommand but after this is processed the TxInterceptor finds out that the transaction is already completed and executes RollbackCommand, clearing locks etc.
Nevertheless, StateTransferInterceptor executes the initial CommitCommand afterwards. I suspect that this may be executed without the locks held.
Anyway, it is not correct to execute both commit and rollback on the same transaction.

Comment 1 JBoss JIRA Server 2013-10-07 13:28:37 UTC
Dan Berindei <dberinde> made a comment on jira ISPN-3599

[~rvansa], does this cause any inconsistencies?

Comment 3 JBoss JIRA Server 2013-10-08 07:17:29 UTC
Radim Vansa <rvansa> made a comment on jira ISPN-3599

Actually, I am not sure - I've noticed this behaviour when tracking down ISPN-3600 (and the inconsistency was caused by the 3600). However, I believe that it can lead to inconsistency as the locks are released (is it, during the rollback, right?) before the entries are committed.

Comment 4 JBoss JIRA Server 2013-10-10 10:07:31 UTC
Pedro Ruivo <pedroruivo2> updated the status of jira ISPN-3599 to Coding In Progress

Comment 5 JBoss JIRA Server 2013-10-10 11:42:11 UTC
Pedro Ruivo <pedroruivo2> made a comment on jira ISPN-3599

Good catch [~rvansa]