zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject svn commit: r1617888 - in /zookeeper/bookkeeper/trunk: CHANGES.txt bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
Date Thu, 14 Aug 2014 06:15:59 GMT
Author: sijie
Date: Thu Aug 14 06:15:59 2014
New Revision: 1617888

URL: http://svn.apache.org/r1617888
Log:
BOOKKEEPER-774: Flaky test org.apache.bookkeeper.test.ReadOnlyBookieTest.testBookieShouldTurnWritableFromReadOnly
(sijie)

Modified:
    zookeeper/bookkeeper/trunk/CHANGES.txt
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java

Modified: zookeeper/bookkeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/CHANGES.txt?rev=1617888&r1=1617887&r2=1617888&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/CHANGES.txt (original)
+++ zookeeper/bookkeeper/trunk/CHANGES.txt Thu Aug 14 06:15:59 2014
@@ -210,6 +210,8 @@ Trunk (unreleased changes)
 
         BOOKKEEPER-746: 5 new shell commands. List ledgers, list metadata, list underreplicated,
show auditor and simpletest (ivank)
 
+        BOOKKEEPER-774: Flaky test org.apache.bookkeeper.test.ReadOnlyBookieTest.testBookieShouldTurnWritableFromReadOnly
(sijie)
+
       bookkeeper-benchmark:
 
         BOOKKEEPER-768: fix typo 'seconds' to milliseconds in benchmark output (jialin via
sijie)

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java?rev=1617888&r1=1617887&r2=1617888&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
Thu Aug 14 06:15:59 2014
@@ -362,6 +362,9 @@ public class EntryLogger {
      * Creates a new log file
      */
     void createNewLog() throws IOException {
+        // first tried to create a new log channel. add current log channel to ToFlush list
only when
+        // there is a new log channel. it would prevent that a log channel is referenced
by both
+        // *logChannel* and *ToFlush* list.
         if (null != logChannel) {
             if (null == logChannelsToFlush) {
                 logChannelsToFlush = new LinkedList<BufferedLogChannel>();
@@ -369,14 +372,17 @@ public class EntryLogger {
             // flush the internal buffer back to filesystem but not sync disk
             // so the readers could access the data from filesystem.
             logChannel.flush(false);
+            BufferedLogChannel newLogChannel = entryLoggerAllocator.createNewLog();
             logChannelsToFlush.add(logChannel);
             LOG.info("Flushing entry logger {} back to filesystem, pending for syncing entry
loggers : {}.",
                     logChannel.getLogId(), logChannelsToFlush);
             for (EntryLogListener listener : listeners) {
                 listener.onRotateEntryLog();
             }
+            logChannel = newLogChannel;
+        } else {
+            logChannel = entryLoggerAllocator.createNewLog();
         }
-        logChannel = entryLoggerAllocator.createNewLog();
     }
 
     /**



Mime
View raw message