ctubbsii closed pull request #443: fixes #441 only dereference WALs after minc
finishes
URL: https://github.com/apache/accumulo/pull/443
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 472b414402..a0c2a815ce 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 @@ private void markUnusedWALs() {
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 5018c97b30..774479b9e0 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 void importMapFiles(long tid,
Map<FileRef,MapFileInfo> fileMap, boolean s
}
}
- 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 @@ synchronized void finishClearingUnusedLogs() {
// 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();
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services