You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2014/04/17 20:12:28 UTC

svn commit: r1588329 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java

Author: stack
Date: Thu Apr 17 18:12:28 2014
New Revision: 1588329

URL: http://svn.apache.org/r1588329
Log:
HBASE-11009 We sync every hbase:meta table write twice

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java?rev=1588329&r1=1588328&r2=1588329&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java Thu Apr 17 18:12:28 2014
@@ -1125,7 +1125,7 @@ class FSHLog implements HLog, Syncable {
    * @param clusterIds that have consumed the change (for replication)
    * @param now
    * @param htd
-   * @param doSync shall we sync?
+   * @param doSync shall we sync after we call the append?
    * @param inMemstore
    * @param sequenceId of the region.
    * @param nonceGroup
@@ -1158,11 +1158,13 @@ class FSHLog implements HLog, Syncable {
     } finally {
       this.disruptor.getRingBuffer().publish(sequence);
     }
-    // Sync if we have been asked to -- only tests do this -- or if it is a meta table edit (these
-    // are precious). When we sync, we will sync to the current point, the txid of the last edit
-    // added.  Since we are single writer, the next txid should be the just next one in sequence;
-    // do not explicitly specify it (sequence id/txid is an implementation internal detail.
-    if (doSync || info.isMetaRegion()) publishSyncThenBlockOnCompletion();
+    // doSync is set in tests.  Usually we arrive in here via appendNoSync w/ the sync called after
+    // all edits on a handler have been added.
+    //
+    // When we sync, we will sync to the current point, the txid of the last edit added.
+    // Since we are single writer, the next txid should be the just next one in sequence;
+    // do not explicitly specify it. Sequence id/txid is an implementation internal detail.
+    if (doSync) publishSyncThenBlockOnCompletion();
     return sequence;
   }