You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by gi...@git.apache.org on 2017/07/24 22:04:33 UTC

[GitHub] sijie opened a new issue #281: make ledger metadata immutable

sijie opened a new issue #281: make ledger metadata immutable
URL: https://github.com/apache/bookkeeper/issues/281
 
 
   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   
   Address the TODO item in *LedgerHandle*
   
                   if (isClosed()) {
                       // TODO: make ledger metadata immutable
                       // Although the metadata is already closed, we don't need to proceed zookeeper metadata update, but
                       // we still need to error out the pending add ops.
                       //
                       // There is a race condition a pending add op is enqueued, after a close op reset ledger metadata state
                       // to unclosed to resolve metadata conflicts. If we don't error out these pending add ops, they would be
                       // leak and never callback.
                       //
                       // The race condition happen in following sequence:
                       // a) ledger L is fenced
                       // b) write entry E encountered LedgerFencedException, trigger ledger close procedure
                       // c) ledger close encountered metadata version exception and set ledger metadata back to open
                       // d) writer tries to write entry E+1, since ledger metadata is still open (reset by c))
                       // e) the close procedure in c) resolved the metadata conflicts and set ledger metadata to closed
                       // f) writing entry E+1 encountered LedgerFencedException which will enter ledger close procedure
                       // g) it would find that ledger metadata is closed, then it callbacks immediately without erroring out any pendings
                       synchronized (LedgerHandle.this) {
                           pendingAdds = drainPendingAddsToErrorOut();
                       }
                       errorOutPendingAdds(rc, pendingAdds);
                       cb.closeComplete(BKException.Code.OK, LedgerHandle.this, ctx);
                       return;
                   }
   
   2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?
   
   *nice-to-have*
   
   3. Provide any additional detail on your proposed use case for this feature.
   
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services