hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1549383 - in /hbase/branches/0.98/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:35 GMT
Author: stack
Date: Mon Dec  9 05:01:34 2013
New Revision: 1549383

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

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

Modified: hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java?rev=1549383&r1=1549382&r2=1549383&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
(original)
+++ hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
Mon Dec  9 05:01:34 2013
@@ -532,6 +532,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.98/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java?rev=1549383&r1=1549382&r2=1549383&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java
(original)
+++ hbase/branches/0.98/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationHLogReaderManager.java
Mon Dec  9 05:01:34 2013
@@ -141,12 +141,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();
@@ -184,12 +178,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