keith-turner closed pull request #566: Improved comments for #559 changes
URL: https://github.com/apache/accumulo/pull/566
 
 
   

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/tablet/Tablet.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 4dc19f293d..9554b93a62 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
@@ -2471,6 +2471,22 @@ public void importMapFiles(long tid, 
Map<FileRef,MapFileInfo> fileMap, boolean s
   private volatile Set<DfsLogger> referencedLogs = Collections.emptySet();
 
   private synchronized void rebuildReferencedLogs() {
+    /*
+     * Each tablet has the following sets of WALogs. While a WALog exists in 
one set, garbage
+     * collection must be avoided.
+     *
+     * 1. WALogs for the active in memory map
+     *
+     * 2. WAlogs for the minor compacting in memory map
+     *
+     * 3. WAlogs for a newly minor compacted file that is being added to the 
metadata table.
+     *
+     * Set 1 is currentLogs. Set 2 is otherLogs. Set 3 only exist in 
referenced logs as a side
+     * effect of not calling this method in beginClearingUnusedLogs() when 
otherLogs is cleared.
+     *
+     * Ensuring referencedLogs accurately tracks these sets ensures in use 
walogs are not GCed.
+     */
+
     Builder<DfsLogger> builder = ImmutableSet.builder();
     builder.addAll(currentLogs);
     builder.addAll(otherLogs);
@@ -2505,9 +2521,10 @@ public void removeInUseLogs(Set<DfsLogger> candidates) {
       }
 
       otherLogs = Collections.emptySet();
-      // Do NOT call rebuildReferenedLogs() here as that could cause walogs to 
be GCed before the
-      // minc rfile is written to metadata table (see #539). The clearing of 
otherLogs is reflected
-      // in refererncedLogs when finishClearingUnusedLogs() calls 
rebuildReferenedLogs().
+      // Intentionally NOT calling rebuildReferenedLogs() here as that could 
cause GC of in use
+      // walogs(see #539). The clearing of otherLogs is reflected in 
refererncedLogs when
+      // finishClearingUnusedLogs() calls rebuildReferenedLogs(). See the 
comments in
+      // rebuildReferenedLogs() for more info.
 
       if (unusedLogs.size() > 0)
         removingLogs = true;


 

----------------------------------------------------------------
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

Reply via email to