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

rpuch 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 dcf3b5b8074 IGNITE-26763 Improve busy lock coverage for the stop 
partition flow (#7797)
dcf3b5b8074 is described below

commit dcf3b5b80745c56d4358b650f719ba16dbf64e2a
Author: Mirza Aliev <[email protected]>
AuthorDate: Wed Mar 18 11:21:23 2026 +0400

    IGNITE-26763 Improve busy lock coverage for the stop partition flow (#7797)
---
 .../partition/replicator/PartitionReplicaLifecycleManager.java | 10 +++++-----
 .../apache/ignite/internal/table/distributed/TableManager.java |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
 
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
index d4e366fb5f0..d931f6806a5 100644
--- 
a/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
+++ 
b/modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java
@@ -1368,7 +1368,7 @@ public class PartitionReplicaLifecycleManager extends
         return replicaMgr.weakStopReplica(
                 zonePartitionId,
                 WeakReplicaStopReason.RESTART,
-                () -> stopPartitionInternal(
+                () -> inBusyLockAsync(busyLock, () -> stopPartitionInternal(
                         zonePartitionId,
                         BEFORE_REPLICA_STOPPED,
                         AFTER_REPLICA_STOPPED,
@@ -1378,7 +1378,7 @@ public class PartitionReplicaLifecycleManager extends
                                 
zoneResourcesManager.removeZonePartitionResources(zonePartitionId);
                             }
                         }
-                )
+                ))
         );
     }
 
@@ -1786,7 +1786,7 @@ public class PartitionReplicaLifecycleManager extends
             long eventRevision,
             Consumer<Boolean> afterReplicaStopAction
     ) {
-        // Not using the busy lock here, because this method is called on 
component stop.
+        // Not using the busy lock here, because this method is also called on 
component stop (when the lock is already blocked).
         return executeUnderZoneWriteLock(zonePartitionId.zoneId(), () -> {
             var eventParameters = new 
LocalPartitionReplicaEventParameters(zonePartitionId, eventRevision, false);
 
@@ -2058,7 +2058,7 @@ public class PartitionReplicaLifecycleManager extends
     }
 
     private CompletableFuture<Void> stopAndDestroyPartition(ZonePartitionId 
zonePartitionId, long revision) {
-        return stopPartitionInternal(
+        return inBusyLockAsync(busyLock, () -> stopPartitionInternal(
                 zonePartitionId,
                 BEFORE_REPLICA_DESTROYED,
                 AFTER_REPLICA_DESTROYED,
@@ -2074,7 +2074,7 @@ public class PartitionReplicaLifecycleManager extends
                         }
                     }
                 }
-        );
+        ));
     }
 
     @TestOnly
diff --git 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
index efa96328132..2500445985b 100644
--- 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
+++ 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java
@@ -633,13 +633,13 @@ public class TableManager implements 
IgniteTablesInternal, IgniteComponent {
         CompletableFuture<Long> readLockAcquisitionFuture = 
zoneLock.readLock();
 
         try {
-            return readLockAcquisitionFuture.thenCompose(stamp -> {
+            return readLockAcquisitionFuture.thenCompose(stamp -> 
inBusyLockAsync(busyLock, () -> {
                 CompletableFuture<?>[] futures = 
zoneTablesRawSet(zonePartitionId.zoneId()).stream()
                         .map(this::stopTablePartitions)
                         .toArray(CompletableFuture[]::new);
 
                 return allOf(futures);
-            }).whenComplete((v, t) -> 
readLockAcquisitionFuture.thenAccept(zoneLock::unlockRead)).thenApply(v -> 
false);
+            })).whenComplete((v, t) -> 
readLockAcquisitionFuture.thenAccept(zoneLock::unlockRead)).thenApply(v -> 
false);
         } catch (Throwable t) {
             readLockAcquisitionFuture.thenAccept(zoneLock::unlockRead);
 

Reply via email to