bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iv...@apache.org
Subject [bookkeeper] branch master updated: [MERGE YAHOO REPO] Flush after writing out index
Date Fri, 26 Jan 2018 17:20:14 GMT
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 <zhaijia@apache.org>
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 <zhaijia@apache.org>
    Author: Robert (Bobby) Evans <evans@yahoo-inc.com>
    
    Reviewers: Ivan Kelly <ivank@apache.org>, Enrico Olivelli <eolivelli@gmail.com>,
Sijie Guo <sijie@apache.org>, Matteo Merli <mmerli@apache.org>
    
    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
ivank@apache.org.

Mime
View raw message