ibessonov commented on code in PR #937:
URL: https://github.com/apache/ignite-3/pull/937#discussion_r927783624
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/PartitionListener.java:
##########
@@ -404,11 +416,13 @@ private boolean handleFinishTxCommand(FinishTxCommand
cmd) {
boolean stateChanged = txManager.changeState(txId, TxState.PENDING,
cmd.finish() ? TxState.COMMITED : TxState.ABORTED);
- if (txManager.state(txId) == TxState.COMMITED) {
+ // This code is technically incorrect and assumes that "stateChanged"
is always true. This was done because transaction state is not
+ // persisted and thus FinishTxCommand couldn't be completed on
recovery after node restart ("changeState" uses "replace").
+ if (/*txManager.state(txId) == TxState.COMMITED*/cmd.finish()) {
cmd.lockedKeys().getOrDefault(lockId, new
ArrayList<>()).forEach(key -> {
Review Comment:
What exactly do you mean? New ArrayList?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]