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

Sijie Guo commented on BOOKKEEPER-191:
--------------------------------------

I think the reason why I introduced another pending queue is you couldn't 
prevent requests being added between the op which inserted ChangeLedgerOp and 
the ChangeLedgerOp. 

{op k} ------------------> issue ChangeLedgerOp
{op l}
...
{op n}
{changeLedgerOp issed by op k}

when op k or the callback of op k said it wants to changeLedger, it inserted a 
ChangeLedgerOp into the tail of queue. but the ChangeLedgerOp just has 
knowledge about the operations before op k, but no idea about the ops added 
between op k and the changeLedgerOp.

this implementation here is quite different with ManagedLedger's 
implementation. For ManageLedger's implementation, it used a combination of 
(ledgerid, entryid) as message id, so there is no strong dependency between the 
operations. but for BookKeeperPersistenceManager, it used an incrementing 
number as message id, so there is stronger dependency between operations than 
ManagedLedger. so I think it is quite difficult to use only one AtomicInt to 
achieve change ledger semantic.
                
> Hub server should change ledger to write, so consumed messages have chance to 
> be garbage collected.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-191
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-191
>             Project: Bookkeeper
>          Issue Type: Improvement
>    Affects Versions: 4.1.0
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>             Fix For: 4.2.0
>
>         Attachments: BK-191.diff, BOOKKEEPER-191.diff, BOOKKEEPER-191.diff
>
>
> currently, hub server write entries to only one ledger, if a topic doesn't 
> change ownership, all entries will be added to this ledger. so those consumed 
> messages don't have chance to be garbage collected.

--
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

        

Reply via email to