accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch 1.9 updated: fixes #441 only dereference WALs after minc finishes (#443)
Date Thu, 26 Apr 2018 21:04:29 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/1.9 by this push:
     new 84791ec  fixes #441 only dereference WALs after minc finishes (#443)
84791ec is described below

commit 84791ec78086474b4b69281c72aab5c3983831b0
Author: Keith Turner <keith@deenlo.com>
AuthorDate: Thu Apr 26 17:04:27 2018 -0400

    fixes #441 only dereference WALs after minc finishes (#443)
    
    * fixes #441 only dereference WALs after minc finishes
---
 .../main/java/org/apache/accumulo/tserver/TabletServer.java  |  5 ++++-
 .../main/java/org/apache/accumulo/tserver/tablet/Tablet.java | 12 +++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 472b414..a0c2a81 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -3352,7 +3352,10 @@ public class TabletServer extends AccumuloServerContext implements
Runnable {
       candidates = new HashSet<>(closedLogs);
     }
     for (Tablet tablet : getOnlineTablets()) {
-      candidates.removeAll(tablet.getCurrentLogFiles());
+      tablet.removeInUseLogs(candidates);
+      if (candidates.isEmpty()) {
+        break;
+      }
     }
     try {
       TServerInstance session = this.getTabletSession();
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 5018c97..774479b 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
@@ -2457,11 +2457,13 @@ public class Tablet implements TabletCommitter {
     }
   }
 
-  private ConcurrentSkipListSet<DfsLogger> currentLogs = new ConcurrentSkipListSet<>();
+  private Set<DfsLogger> currentLogs = new HashSet<>();
 
-  // currentLogs may be updated while a tablet is otherwise locked
-  public Set<DfsLogger> getCurrentLogFiles() {
-    return new HashSet<>(currentLogs);
+  public synchronized void removeInUseLogs(Set<DfsLogger> candidates) {
+    // remove logs related to minor compacting data
+    candidates.removeAll(otherLogs);
+    // remove logs related to tablets in memory data
+    candidates.removeAll(currentLogs);
   }
 
   Set<String> beginClearingUnusedLogs() {
@@ -2520,7 +2522,7 @@ public class Tablet implements TabletCommitter {
   // this lock is basically used to synchronize writing of log info to metadata
   private final ReentrantLock logLock = new ReentrantLock();
 
-  public int getLogCount() {
+  public synchronized int getLogCount() {
     return currentLogs.size();
   }
 

-- 
To stop receiving notification emails like this one, please contact
ctubbsii@apache.org.

Mime
View raw message