This is an automated email from the ASF dual-hosted git repository.

ivank pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new b38cd67  [MERGE YAHOO REPO] Flush after writing out index
b38cd67 is described below

commit b38cd67a042aae0cac32aef69e814d7ade31bf03
Author: Jia Zhai <[email protected]>
AuthorDate: Fri Jan 26 18:20:00 2018 +0100

    [MERGE YAHOO REPO] Flush after writing out index
    
    Descriptions of the changes in this PR:
    This is cherry-pick from yahoo repo of branch yahoo-4.3.
    
    original commit is:
    https://github.com/yahoo/bookkeeper/commit/fecdb751
    YBK-14: Flush after writing out index
    
    Author: Jia Zhai <[email protected]>
    Author: Robert (Bobby) Evans <[email protected]>
    
    Reviewers: Ivan Kelly <[email protected]>, Enrico Olivelli 
<[email protected]>, Sijie Guo <[email protected]>, Matteo Merli 
<[email protected]>
    
    This closes #1060 from jiazhai/cherry_picks/i_177
---
 .../src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java        | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
index eaf3663..112a602 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
@@ -568,6 +568,9 @@ public class EntryLogger {
         } finally {
             serializedMap.release();
         }
+        // Flush the ledger's map out before we write the header.
+        // Otherwise the header might point to something that is not fully 
written
+        entryLogChannel.flush(false);
 
         // Update the headers with the map offset and count of ledgers
         ByteBuffer mapInfo = ByteBuffer.allocate(8 + 4);

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to