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/25 05:45:20 UTC

[PR] IGNITE-27159 refactored race condition [ignite-3]

EgorKuts opened a new pull request, #7065:
URL: https://github.com/apache/ignite-3/pull/7065

   inside 
   
   org.apache.ignite.internal.partition.replicator.PartitionReplicaLifecycleManager#handleChangePendingAssignmentEvent(org.apache.ignite.internal.replicator.ZonePartitionId, org.apache.ignite.internal.partitiondistribution.Assignments, org.apache.ignite.internal.partitiondistribution.Assignments, long, boolean)
   
   we check for replicaMgr.isReplicaStarted(replicaGrpId) and then use 
   replicaMgr.replica(replicaGrpId).thenAccept(..), but it's possible for replica disappear between the calls and cause NPE
   
   
   https://issues.apache.org/jira/browse/IGNITE-27159


-- 
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-27159 refactored race condition [ignite-3]

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc closed pull request #7065: IGNITE-27159 refactored race condition
URL: https://github.com/apache/ignite-3/pull/7065


-- 
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-27159 refactored race condition [ignite-3]

Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc commented on code in PR #7065:
URL: https://github.com/apache/ignite-3/pull/7065#discussion_r2560392095


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java:
##########
@@ -1413,11 +1413,12 @@ private CompletableFuture<Void> handleChangePendingAssignmentEvent(
                     // Reset adds C into force pending and user writes data onto C.
                     // Then A and B go back online. In this case
                     // stable = [A, B, C], pending = [C, force] and only C should be started.
-                    if (isRecovery && !replicaMgr.isReplicaStarted(replicaGrpId)) {
+                    CompletableFuture<Replica> replicaFut = replicaMgr.replica(replicaGrpId);
+                    if (replicaFut == null || isRecovery && !isCompletedSuccessfully(replicaFut)) {

Review Comment:
   It's not equivalent. Within old version we've checked whether replicaFut != null only if isRecovery is true, within new version we will return immediately if replicaFut == null even if it's not recovery.



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