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

kturner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 3ea4a81764 fixes location race condition in merge code (#5877)
3ea4a81764 is described below

commit 3ea4a81764777f9d9c1658fd9a344177a0301838
Author: Keith Turner <[email protected]>
AuthorDate: Fri Sep 12 10:08:53 2025 -0400

    fixes location race condition in merge code (#5877)
    
    Fixes a race condition where the merge code would not wait for a tablet
    to be unassigned. Fixes #5870.  Used the same strategy as the split
    code for the fix.
---
 .../org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
 
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
index 9a8a4c3dc0..73bb946345 100644
--- 
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
+++ 
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
@@ -82,8 +82,12 @@ public class ReserveTablets extends ManagerRepo {
 
       for (var tabletMeta : tablets) {
         if (tabletMeta.getOperationId() == null) {
+          // Require the location to be the same inorder to detect locations 
set between reading
+          // tablet metadata and setting opid. Should a change to the location 
happen between then
+          // the conditional mutation will fail, the location will be 
detected, and this will wait.
           
tabletsMutator.mutateTablet(tabletMeta.getExtent()).requireAbsentOperation()
-              .putOperation(opid).submit(tm -> 
opid.equals(tm.getOperationId()));
+              .requireSame(tabletMeta, LOCATION, LOGS).putOperation(opid)
+              .submit(tm -> opid.equals(tm.getOperationId()));
           opsSet++;
         } else if (!tabletMeta.getOperationId().equals(opid)) {
           otherOps++;

Reply via email to