You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sa...@apache.org on 2023/11/24 15:36:31 UTC

(ignite-3) branch main updated: IGNITE-20942 Group equality check added for PartitionReplicaListener scoped PR events (#2876)

This is an automated email from the ASF dual-hosted git repository.

sanpwc pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f4aa84333 IGNITE-20942 Group equality check added for PartitionReplicaListener scoped PR events (#2876)
7f4aa84333 is described below

commit 7f4aa8433321a2d513eaa9409f3a2245f955ff72
Author: Alexander Lapin <la...@gmail.com>
AuthorDate: Fri Nov 24 17:36:24 2023 +0200

    IGNITE-20942 Group equality check added for PartitionReplicaListener scoped PR events (#2876)
---
 .../table/distributed/replicator/PartitionReplicaListener.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
index 2318f6081b..543967ff77 100644
--- a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
+++ b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java
@@ -343,7 +343,7 @@ public class PartitionReplicaListener implements ReplicaListener {
     }
 
     private CompletableFuture<Boolean> onPrimaryElected(PrimaryReplicaEventParameters evt, @Nullable Throwable exception) {
-        if (!localNode.name().equals(evt.leaseholder())) {
+        if (!localNode.name().equals(evt.leaseholder()) || !replicationGroupId.equals(evt.groupId())) {
             return completedFuture(false);
         }
 
@@ -420,7 +420,7 @@ public class PartitionReplicaListener implements ReplicaListener {
     }
 
     private CompletableFuture<Boolean> onPrimaryExpired(PrimaryReplicaEventParameters evt, @Nullable Throwable exception) {
-        if (!localNode.name().equals(evt.leaseholder())) {
+        if (!localNode.name().equals(evt.leaseholder()) || !replicationGroupId.equals(evt.groupId())) {
             return completedFuture(false);
         }