You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "EgorKuts (via GitHub)" <gi...@apache.org> on 2025/11/13 07:58:47 UTC
[PR] IGNITE-27014 fixed npe in write intent resolution [ignite-3]
EgorKuts opened a new pull request, #6960:
URL: https://github.com/apache/ignite-3/pull/6960
This PR fixes NPE in write intent resolution caused by the following sequence of events:
1. The commit partition(node A) commits the transaction
2. Vacuum trigers on node A and cleans the volotile storage of the transaction
3. Primary replica of the commit partition swithces to another node B
4. Node B performs the clean up and sends cleanup replicated confirmation to node A
5. Node A receives the cleanup confirmation, calls markTxnCleanupReplicated and saves invalid TxStateMeta in the volotile storage with tsState=COMMITED and commitTimestamp=NULL.
6. A write intent resolution happens on node A and it reads the broken txMeta from step 5 and causes NPE.
https://issues.apache.org/jira/browse/IGNITE-27014
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27014 Fix NPE in write intent resolution [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc merged PR #6960:
URL: https://github.com/apache/ignite-3/pull/6960
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-27014 fixed npe in write intent resolution [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #6960:
URL: https://github.com/apache/ignite-3/pull/6960#discussion_r2546614729
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxCleanupRequestSender.java:
##########
@@ -122,18 +123,39 @@ private void onCleanupReplicated(CleanupReplicatedInfo info) {
private void markTxnCleanupReplicated(UUID txId, TxState state, ReplicationGroupId commitPartitionId) {
long cleanupCompletionTimestamp = System.currentTimeMillis();
- txStateVolatileStorage.updateMeta(txId, oldMeta ->
+ TxStateMeta txStateMeta = txStateVolatileStorage.state(txId);
+ final CompletableFuture<HybridTimestamp> commitTimestampFuture;
+ if (state == TxState.COMMITTED && (txStateMeta == null || txStateMeta.commitTimestamp() == null)) {
+ commitTimestampFuture = placementDriverHelper.awaitPrimaryReplicaWithExceptionHandling(commitPartitionId)
+ .thenCompose(replicaMeta -> {
+ String primaryNode = replicaMeta.getLeaseholder();
+ HybridTimestamp startTime = replicaMeta.getStartTime();
+ return txMessageSender.resolveTxStateFromCommitPartition(
+ primaryNode,
+ txId,
+ commitPartitionId,
+ startTime.longValue()).thenApply(TransactionMeta::commitTimestamp);
+ }
+ );
+ } else {
+ HybridTimestamp existingCommitTs = txStateMeta == null ? null : txStateMeta.commitTimestamp();
+ commitTimestampFuture = CompletableFuture.completedFuture(existingCommitTs);
+ }
+
+ commitTimestampFuture.thenAccept(commitTimestamp -> txStateVolatileStorage.updateMeta(txId, oldMeta ->
new TxStateMeta(
oldMeta == null ? state : oldMeta.txState(),
oldMeta == null ? null : oldMeta.txCoordinatorId(),
commitPartitionId,
- oldMeta == null ? null : oldMeta.commitTimestamp(),
+ oldMeta == null ? commitTimestamp : oldMeta.commitTimestamp(),
oldMeta == null ? null : oldMeta.tx(),
oldMeta == null ? null : oldMeta.initialVacuumObservationTimestamp(),
cleanupCompletionTimestamp,
oldMeta == null ? null : oldMeta.isFinishedDueToTimeout()
)
+ )
);
+
Review Comment:
Unnecessary empty line.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org