You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/19 22:10:58 UTC

[jira] [Commented] (BOOKKEEPER-956) HierarchicalLedgerManager doesn't work for ledgerid of length 9 and 10 because of order issue in HierarchicalLedgerRangeIterator

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

ASF GitHub Bot commented on BOOKKEEPER-956:
-------------------------------------------

GitHub user reddycharan opened a pull request:

    https://github.com/apache/bookkeeper/pull/64

    BOOKKEEPER-956: Fix for HierarchicalLedgerRangeIterator

    Fix for HierarchicalLedgerRangeIterator, to make it work
    for LedgerIds of length 9 and 10

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/reddycharan/bookkeeper hierarchicalledgermanagerfix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/bookkeeper/pull/64.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #64
    
----
commit 8fc4d4d5e5195aa2c29ce8afea0a2110b5fc8201
Author: Charan Reddy Guttapalem <cg...@salesforce.com>
Date:   2016-10-19T22:04:09Z

    BOOKKEEPER-956: Fix for HierarchicalLedgerRangeIterator
    
    Fix for HierarchicalLedgerRangeIterator, to make it work
    for LedgerIds of length 9 and 10

----


> HierarchicalLedgerManager doesn't work for ledgerid of length 9 and 10 because of order issue in HierarchicalLedgerRangeIterator
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-956
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-956
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Charan Reddy Guttapalem
>            Assignee: Charan Reddy Guttapalem
>
> Issue Description:-
> HierarchicalLedgerManager is supposed to work for ledgerids upto length of 10 (its layout is 2-4-4). But because of order issue in HierarchicalLedgerRangeIterator it doesn't work correctly if we create Ledgers of ledgerid length 9 and 10.
> Rootcause:- in HierarchicalLedgerRangeIterator, in 'preload' method after getting l1Nodes by calling "zk.getChildren(ledgerRootPath, null)",  they need to be sorted, just like l2nodes in 'nextL1Node' method
> How it manifests:-
> If we try to create Ledgers using LedgerCreateAdv api with ledgerids of lengths 9 and 10, write entries and read entries, it will fail with following exception messages
> 2015-11-30 13:57:31,209 - WARN  - [GarbageCollectorThread:ScanAndCompareGarbageCollector@103] - Exception when iterating over the metadata {}
> java.lang.IllegalArgumentException: inconsistent range
>     at java.util.concurrent.ConcurrentSkipListMap$SubMap.<init>(ConcurrentSkipListMap.java:2506)
>     at java.util.concurrent.ConcurrentSkipListMap.subMap(ConcurrentSkipListMap.java:1984)
>     at java.util.concurrent.ConcurrentSkipListMap.subMap(ConcurrentSkipListMap.java:93)
>     at org.apache.bookkeeper.bookie.ScanAndCompareGarbageCollector.gc(ScanAndCompareGarbageCollector.java:86)
>     at org.apache.bookkeeper.bookie.GarbageCollectorThread.doGcLedgers(GarbageCollectorThread.java:419)
>     at org.apache.bookkeeper.bookie.GarbageCollectorThread.run(GarbageCollectorThread.java:377)
> org.apache.bookkeeper.client.BKException$BKNotEnoughBookiesException
>     at org.apache.bookkeeper.client.BKException.create(BKException.java:58)
>     at org.apache.bookkeeper.client.LedgerHandleAdv.addEntry(LedgerHandleAdv.java:101)
>     at org.apache.bookkeeper.client.LedgerHandleAdv.addEntry(LedgerHandleAdv.java:70)
>     at org.apache.bookkeeper.client.BookieWriteLedgerTest.testLedgerCreateAdvWithLedgerId(BookieWriteLedgerTest.java:212)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>     at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
>     at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>     at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)