You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/04/19 18:13:28 UTC
[GitHub] [bookkeeper] dlg99 opened a new issue, #3222: Read ledger returns "Bookie handle is not available" when one bookie is up but the ledger is empty.
dlg99 opened a new issue, #3222:
URL: https://github.com/apache/bookkeeper/issues/3222
**BUG REPORT**
BK 4.14.3
bookie1 is decommissioned.
bookie3 is not available.
`bin/bookkeeper shell listunderreplicated -printmissingreplica`
```
2022-04-19T17:17:14,704 [main] INFO org.apache.bookkeeper.tools.cli.commands.autorecovery.ListUnderReplicatedCommand - <LEDGER_ID>
2022-04-19T17:17:14,704 [main] INFO org.apache.bookkeeper.tools.cli.commands.autorecovery.ListUnderReplicatedCommand - Ctime : 1650388634626
2022-04-19T17:17:14,705 [main] INFO org.apache.bookkeeper.tools.cli.commands.autorecovery.ListUnderReplicatedCommand - MissingReplica : bookie1:3181
```
```
org.apache.bookkeeper.tools.cli.commands.client.LedgerMetaDataCommand - LedgerMetadata{formatVersion=2, ensembleSize=3, writeQuorumSize=3, ackQuorumSize=2, state=CLOSED, length=0, lastEntryId=-1, digestType=CRC32, password=base64:, ensembles={0=[bookie3:3181, bookie2:3181, bookie1:3181]}, customMetadata={}}
```
Note `state=CLOSED, length=0, lastEntryId=-1` (see https://github.com/apache/bookkeeper/issues/3220 )
Run `bin/bookkeeper shell readledger <LEDGER_ID>`
See connections errors for bookie1 and bookie3 (expected)
For bookie2 see:
```
2022-04-19T17:34:26,442 [BookKeeperClientWorker-OrderedExecutor-15-0] ERROR org.apache.bookkeeper.client.PendingReadOp - Read of ledger entry failed: L<LEDGER_ID> E0-E0, Sent to [bookie1:3181, bookie2:3181, bookie3:3181], Heard from [] : bitset = {}, Error = 'Bookie handle is not available'. First unread entry is (-1, rc = null)
2022-04-19T17:34:26,444 [main] ERROR org.apache.bookkeeper.client.BookKeeperAdmin - Error reading entry 0 from ledger <LEDGER_ID>
org.apache.bookkeeper.client.BKException$BKBookieHandleNotAvailableException: Bookie handle is not available
at org.apache.bookkeeper.client.SyncCallbackUtils.finish(SyncCallbackUtils.java:83) ~[org.apache.bookkeeper-bookkeeper-server-4.14.3.jar:4.14.3]
at org.apache.bookkeeper.client.SyncCallbackUtils$SyncReadCallback.readComplete(SyncCallbackUtils.java:231) ~[org.apache.bookkeeper-bookkeeper-server-4.14.3.jar:4.14.3]
at org.apache.bookkeeper.client.LedgerHandle$6.onFailure(LedgerHandle.java:820) ~[org.apache.bookkeeper-bookkeeper-server-4.14.3.jar:4.14.3]
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:38) ~[org.apache.bookkeeper-bookkeeper-common-4.14.3.jar:4.14.3]
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:26) ~[org.apache.bookkeeper-bookkeeper-common-4.14.3.jar:4.14.3]
at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859) ~[?:?]
at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837) ~[?:?]
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.60.Final.jar:4.1.60.Final]
at java.lang.Thread.run(Thread.java:829) ~[?:?]
2022-04-19T17:34:26,445 [main] INFO org.apache.bookkeeper.proto.PerChannelBookieClient - Closing the per channel bookie client for 10.20.69.15:3181
2022-04-19T17:34:26,447 [main] INFO org.apache.bookkeeper.proto.PerChannelBookieClient - Closing the per channel bookie client for 10.20.69.19:3181
2022-04-19T17:34:26,447 [main] INFO org.apache.bookkeeper.proto.PerChannelBookieClient - Closing the per channel bookie client for 10.20.69.22:3181
2022-04-19T17:34:26,451 [bookkeeper-io-3-1] INFO org.apache.bookkeeper.proto.PerChannelBookieClient - Disconnected from bookie channel [id: 0x13a0f0ee, L:/...:56166 ! R:.../bookie2:3181]
2022-04-19T17:34:26,605 [main] INFO org.apache.zookeeper.ZooKeeper - Session: 0x30000014ca90034 closed
Exception in thread "main" 2022-04-19T17:34:26,606 [main-EventThread] INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x30000014ca90034
com.google.common.util.concurrent.UncheckedExecutionException: org.apache.bookkeeper.client.BKException$BKBookieHandleNotAvailableException: Bookie handle is not available
at org.apache.bookkeeper.tools.cli.commands.bookie.ReadLedgerCommand.apply(ReadLedgerCommand.java:137)
at org.apache.bookkeeper.bookie.BookieShell$ReadLedgerEntriesCmd.runCmd(BookieShell.java:628)
at org.apache.bookkeeper.bookie.BookieShell$MyCommand.runCmd(BookieShell.java:238)
at org.apache.bookkeeper.bookie.BookieShell.run(BookieShell.java:2275)
at org.apache.bookkeeper.bookie.BookieShell.main(BookieShell.java:2366)
Caused by: java.lang.RuntimeException: org.apache.bookkeeper.client.BKException$BKBookieHandleNotAvailableException: Bookie handle is not available
at org.apache.bookkeeper.client.BookKeeperAdmin$LedgerEntriesIterator.hasNext(BookKeeperAdmin.java:445)
at org.apache.bookkeeper.tools.cli.commands.bookie.ReadLedgerCommand.readledger(ReadLedgerCommand.java:171)
at org.apache.bookkeeper.tools.cli.commands.bookie.ReadLedgerCommand.apply(ReadLedgerCommand.java:135)
... 4 more
Caused by: org.apache.bookkeeper.client.BKException$BKBookieHandleNotAvailableException: Bookie handle is not available
at org.apache.bookkeeper.client.SyncCallbackUtils.finish(SyncCallbackUtils.java:83)
at org.apache.bookkeeper.client.SyncCallbackUtils$SyncReadCallback.readComplete(SyncCallbackUtils.java:231)
at org.apache.bookkeeper.client.LedgerHandle$6.onFailure(LedgerHandle.java:820)
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:38)
at org.apache.bookkeeper.common.concurrent.FutureEventListener.accept(FutureEventListener.java:26)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
```
Expected: Some other error (no entry?) instead of "Bookie handle is not available"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [bookkeeper] hangc0276 commented on issue #3222: Read ledger returns "Bookie handle is not available" when one bookie is up but the ledger is empty.
Posted by GitBox <gi...@apache.org>.
hangc0276 commented on issue #3222:
URL: https://github.com/apache/bookkeeper/issues/3222#issuecomment-1105231953
When we read the ledger, the first read reaches bk3, which is unavailable, it will set the `firstError` to `BookieHandleNotAvailableException`. And the schedule to the read to bk2. The bk2 returns `NoSuchEntryException` due to the ledger doesn't have any entries. In the callback, the `firstError` won't be updated as `NoSuchEntryException` and keeps `BookieHandleNotAvailableException`.
https://github.com/apache/bookkeeper/blob/02d41c0e061daa62e53078be048c5c503d1bfefa/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingReadOp.java#L195-L207
After bk2 read request returned, it will use `firstError` to fail this read request.
https://github.com/apache/bookkeeper/blob/02d41c0e061daa62e53078be048c5c503d1bfefa/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/PendingReadOp.java#L393-L399
I'm considering to fix it, but still have no idea. Do you have any suggestions? @dlg99 @eolivelli
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [bookkeeper] dlg99 closed issue #3222: Read ledger returns "Bookie handle is not available" when one bookie is up but the ledger is empty.
Posted by GitBox <gi...@apache.org>.
dlg99 closed issue #3222: Read ledger returns "Bookie handle is not available" when one bookie is up but the ledger is empty.
URL: https://github.com/apache/bookkeeper/issues/3222
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org