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

Sijie Guo commented on BOOKKEEPER-659:
--------------------------------------

seems that the race is between checking ledgersToFlush.isEmpty and adding to 
ledgersToFlush. since the pageLimit is setting to 1, the same ledger might be 
added twice in ledgersToFlush, which cause the case as Ivan's comment.

{code}
    void flushOneOrMoreLedgers(boolean doAll) throws IOException {
        if (ledgersToFlush.isEmpty()) {
            ledgersToFlush.addAll(pageMapAndList.getActiveLedgers());
        }
        Long potentiallyDirtyLedger = null;
        while (null != (potentiallyDirtyLedger = ledgersToFlush.poll())) {
            flushSpecificLedger(potentiallyDirtyLedger);
            if (!doAll) {
                break;
            }
        }
    }
{code}

> LRU page management in ledger cache.
> ------------------------------------
>
>                 Key: BOOKKEEPER-659
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-659
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-server
>            Reporter: Sijie Guo
>            Assignee: Robin Dhamankar
>             Fix For: 4.3.0
>
>         Attachments: 
> 0001-BOOKKEEPER-659-LRU-page-management-in-ledger-cache.patch, 
> BOOKKEEPER-659.diff, BOOKKEEPER-659.diff, 
> TEST-org.apache.bookkeeper.replication.AuditorPeriodicCheckTest.xml, 
> TEST-org.apache.bookkeeper.replication.AuditorPeriodicCheckTest.xml
>
>
> better ledger page management.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to