You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "jiraposter@reviews.apache.org (Commented) (JIRA)" <ji...@apache.org> on 2012/02/04 07:17:56 UTC

[jira] [Commented] (BOOKKEEPER-137) Do not create Ledger index files until absolutely necessary.

    [ https://issues.apache.org/jira/browse/BOOKKEEPER-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200342#comment-13200342 ] 

jiraposter@reviews.apache.org commented on BOOKKEEPER-137:
----------------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3661/#review4819
-----------------------------------------------------------



bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
<https://reviews.apache.org/r/3661/#comment10582>

    suppose the code running in journalLayoutVersion=1 directory. the first time is OK, since there would be no meta entries. but the code would add meta entries then. the next time bookie restarts, journalLayoutVersion is still 1, it would throw IOException.
    
    so do we need to upgrade the layout version when we run new code  in old data directories? 



bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java
<https://reviews.apache.org/r/3661/#comment10583>

    if a ledger existed before, getHandle would checkAccess  of masterKey, which would call FileInfo#readHeader. Then isMasterKeyPersisted would call FileInfo#readHeader again, which is not necessary. 
    
    I think it would be easy to avoid readHeader twice.


- Sijie


On 2012-01-27 14:54:04, Ivan Kelly wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/3661/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-01-27 14:54:04)
bq.  
bq.  
bq.  Review request for bookkeeper.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  This is an optimization to speed up the case where we have many ledgers and are writing to them at random (a benchmark case we currently have). Currently, we create the ledger index file and write the first 1k of it to disk immediately. With a lot of ledgers being randomly written to, this means a lot of random writes on the ledger disk. This fix postpones the creation of the index file and writing of the first 1k until the first flush of the ledger.
bq.  
bq.  This patch includes BOOKKEEPER-136, as they both deal in the same area, and I found it difficult to separate them.
bq.  
bq.  BOOKKEEPER-135 is not required for this patch, and will need modifications after this goes in.
bq.  
bq.  
bq.  This addresses bug BOOKKEEPER-137.
bq.      https://issues.apache.org/jira/browse/BOOKKEEPER-137
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Bookie.java cb3bb26 
bq.    bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/FileInfo.java fa713c8 
bq.    bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerCache.java d2f959b 
bq.    bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDescriptor.java 728d729 
bq.    bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServer.java beab5e8 
bq.    bookkeeper-server/src/main/java/org/apache/bookkeeper/util/LocalBookKeeper.java 5706dd8 
bq.    bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/BookieLayoutVersionTest.java c7b07e6 
bq.    bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieRecoveryTest.java 8526db5 
bq.    bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BaseTestCase.java 7403604 
bq.  
bq.  Diff: https://reviews.apache.org/r/3661/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Ivan
bq.  
bq.


                
> Do not create Ledger index files until absolutely necessary.
> ------------------------------------------------------------
>
>                 Key: BOOKKEEPER-137
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-137
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.1.0
>
>         Attachments: BOOKKEEPER-137.diff, BOOKKEEPER-137.diff, BOOKKEEPER-137.diff
>
>
> This is an optimization to speed up the case where we have many ledgers and are writing to them at random (a benchmark case we currently have). Currently, we create the ledger index file and write the first 1k of it to disk immediately. With a lot of ledgers being randomly written to, this means a lot of random writes on the ledger disk. This fix postpones the creation of the index file and writing of the first 1k until the first flush of the ledger.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira