-
Sub-task
-
Resolution: Done
-
Major
-
5.0.1.FINAL, 5.1.0.BETA2
-
None
When a PrepareCommand fails (in our case because it didn't get a reply from the remote node in 15 seconds), the locking interceptor catches the exception and releases all the locks acquired by the transaction.
After that TransactionCoordinator starts a proper rollback, but the entries in the invocation context are no longer locked (and in 5.0 that means they only have the VALID flag set, not CHANGED or CREATED). That means local locks are not released twice, but it also means the PrepareCommand is not executed remotely (BaseRpcInterceptor.shouldInvokeRemoteTxCommand() returns false).
In 5.1 we no longer have the entry flags but the entries are still locked.
I see 3 possible solutions:
1. Don't clean up the locks at all in LockingInterceptor (if the invocation context is transactional) and rely on TransactionCoordinator to do it.
2. Clean up the locks but don't call rollback() on the entry.
3. Rely on LocalTransaction's getRemoteLocksAcquired() instead of the locked entries to determine if the rollback command should be executed on the remote nodes.