Lalant commented on code in PR #7517:
URL: https://github.com/apache/ignite-3/pull/7517#discussion_r2767538248


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/raft/handlers/FinishTxCommandHandler.java:
##########
@@ -98,18 +97,24 @@ protected CommandResult handleInternally(
                 commandTerm
         );
 
-        // Assume that we handle the finish command only on the commit 
partition.
-        txFinishMarker.markFinished(txId, command.commit(), 
command.commitTimestamp(), this.replicationGroupId);
-
         LOG.debug("Finish the transaction txId = {}, state = {}, 
txStateChangeRes = {}", txId, txMetaToSet, txStateChangeRes);
 
-        if (!txStateChangeRes) {
-            assert txMetaBeforeCas != null : "txMetaBeforeCase is null, but 
CAS has failed for " + txId;
+        if (txStateChangeRes) {
+            // Assume that we handle the finish command only on the commit 
partition.
+            txFinishMarker.markFinished(txId, command.commit(), 
command.commitTimestamp(), this.replicationGroupId);
+
+            TransactionResult result = new TransactionResult(stateToSet, 
command.commitTimestamp());
 
-            onTxStateStorageCasFail(txId, txMetaBeforeCas, txMetaToSet);
+            return new CommandResult(result, true);
         }
 
-        return new CommandResult(new TransactionResult(stateToSet, 
command.commitTimestamp()), true);
+        assert txMetaBeforeCas != null : "txMetaBeforeCas is null, but CAS has 
failed for " + txId;

Review Comment:
   I agree, I didn't add, I just moved this line, but anyway exception is 
better.



-- 
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]

Reply via email to