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

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


The following commit(s) were added to refs/heads/elasticity by this push:
     new f2416680de fixes conditional mutation bug when loading tablet (#4447)
f2416680de is described below

commit f2416680de2f1923800a2c81c75ffefcf952d673
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Thu Apr 11 19:18:00 2024 -0400

    fixes conditional mutation bug when loading tablet (#4447)
    
    In #4436 a tablet update was moved to use conditional mutations. The
    changed checked tablets current location in the conditional update.
    However when this code was called in the Tablet constructor the tablet
    server was the future location.  Adjusted to code to check for the
    future location when calling from the constructor.
---
 .../java/org/apache/accumulo/tserver/tablet/ScanfileManager.java    | 5 ++---
 .../src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java    | 6 ++++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanfileManager.java
 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanfileManager.java
index 5ab4780a39..a0b00127af 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanfileManager.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanfileManager.java
@@ -144,7 +144,7 @@ class ScanfileManager {
     }
   }
 
-  void removeFilesAfterScan(Collection<StoredTabletFile> scanFiles) {
+  void removeFilesAfterScan(Collection<StoredTabletFile> scanFiles, Location 
location) {
     if (scanFiles.isEmpty()) {
       return;
     }
@@ -163,8 +163,7 @@ class ScanfileManager {
 
     if (!filesToDelete.isEmpty()) {
       log.debug("Removing scan refs from metadata {} {}", tablet.getExtent(), 
filesToDelete);
-      var currLoc = 
Location.current(tablet.getTabletServer().getTabletSession());
-      removeScanFiles(tablet.getExtent(), filesToDelete, tablet.getContext(), 
currLoc,
+      removeScanFiles(tablet.getExtent(), filesToDelete, tablet.getContext(), 
location,
           tablet.getTabletServer().getLock());
     }
   }
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 0565a00bbf..2e87b25305 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -326,7 +326,8 @@ public class Tablet extends TabletBase {
 
     computeNumEntries();
 
-    getScanfileManager().removeFilesAfterScan(metadata.getScans());
+    getScanfileManager().removeFilesAfterScan(metadata.getScans(),
+        Location.future(tabletServer.getTabletSession()));
   }
 
   public TabletMetadata getMetadata() {
@@ -1614,7 +1615,8 @@ public class Tablet extends TabletBase {
     }
 
     if (refreshPurpose == RefreshPurpose.REFRESH_RPC) {
-      scanfileManager.removeFilesAfterScan(getMetadata().getScans());
+      scanfileManager.removeFilesAfterScan(getMetadata().getScans(),
+          Location.current(tabletServer.getTabletSession()));
     }
   }
 

Reply via email to