hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1549382 - in /hbase/branches/0.96/hbase-server/src: main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java
Date Mon, 09 Dec 2013 05:01:18 GMT
Author: stack
Date: Mon Dec  9 05:01:18 2013
New Revision: 1549382

URL: http://svn.apache.org/r1549382
Log:
HBASE-10010 eliminate the put latency spike on the new log file beginning

Modified:
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java?rev=1549382&r1=1549381&r2=1549382&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
Mon Dec  9 05:01:18 2013
@@ -521,6 +521,13 @@ class FSHLog implements HLog, Syncable {
         FSDataOutputStream nextHdfsOut = null;
         if (nextWriter instanceof ProtobufLogWriter) {
           nextHdfsOut = ((ProtobufLogWriter)nextWriter).getStream();
+          // perform the costly sync before we get the lock to roll writers.
+          try {
+            nextWriter.sync();
+          } catch (IOException e) {
+            // optimization failed, no need to abort here.
+            LOG.warn("pre-sync failed", e);
+          }
         }
 
         Path oldFile = null;

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java?rev=1549382&r1=1549381&r2=1549382&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java
(original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java
Mon Dec  9 05:01:18 2013
@@ -139,12 +139,6 @@ public class TestReplicationHLogReaderMa
     // Grab the path that was generated when the log rolled as part of its creation
     Path path = pathWatcher.currentPath;
 
-    // open it, it's empty so it fails
-    try {
-      logManager.openReader(path);
-      fail("Shouldn't be able to open an empty file");
-    } catch (EOFException ex) {}
-
     assertEquals(0, logManager.getPosition());
 
     appendToLog();
@@ -182,12 +176,6 @@ public class TestReplicationHLogReaderMa
 
     path = pathWatcher.currentPath;
 
-    // Finally we have a new empty log, which should still give us EOFs
-    try {
-      logManager.openReader(path);
-      fail();
-    } catch (EOFException ex) {}
-
     for (int i = 0; i < nbRows; i++) { appendToLogPlus(walEditKVs); }
     log.rollWriter();
     logManager.openReader(path);



Mime
View raw message