RobertIndie opened a new pull request, #17985:
URL: https://github.com/apache/pulsar/pull/17985
<!--
### Contribution Checklist
- PR title format should be *[type][component] summary*. For details, see
*[Guideline - Pulsar PR Naming
Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*.
- Fill out the template below to describe the changes contributed by the
pull request. That will give reviewers the context they need to do the review.
- Each pull request should address only one issue, not mix up code from
multiple issues.
- Each commit in the pull request has a meaningful commit message
- Once all items of the checklist are addressed, remove the above text and
this checklist, leaving only the filled out template below.
-->
Fixes #17984
### Motivation
The pulsar does not respect the `standalone.conf` when starting the bookie
in the standalone mode. Therefore the `nettyMaxFrameSizeBytes` will be the
default value: 524880, but not the correct one: 5253120. This causes the issue.
When using the zookeeper as the metadata store, the issue does not occur.
### Modifications
* Load the `standalone.conf` when starting bookie in the standalone.
But when using the default configuration of `ledgerStorageClass` in the
`standalone.conf`, there will be new problems.
```
ledgerStorageClass=org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage
```
It will throw exceptions when publishing the message:
```
2022-10-10T16:17:37,964+0800 [BookieWriteThreadPool-OrderedExecutor-0-0]
WARN org.apache.bookkeeper.common.util.OrderedExecutor - Runnable
WriteEntry(-1, -1):class org.apache.bookkeeper.proto.WriteEntryProcessor took
too long 10002443 micros to execute.
2022-10-10T16:17:37,965+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
WARN org.apache.bookkeeper.client.PendingAddOp - Failed to write entry (5, 0):
Too many requests to the same Bookie
2022-10-10T16:17:37,969+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
WARN org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl -
Failed to find 1 bookies : excludeBookies [<Bookie:127.0.0.1:3181>], allBookies
[<Bookie:127.0.0.1:3181>].
2022-10-10T16:17:37,969+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
WARN org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl -
Failed to choose a bookie: excluded [<Bookie:127.0.0.1:3181>], fallback to
choose bookie randomly from the cluster.
2022-10-10T16:17:37,969+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
WARN org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl -
Failed to find 1 bookies : excludeBookies [<Bookie:127.0.0.1:3181>], allBookies
[<Bookie:127.0.0.1:3181>].
2022-10-10T16:17:37,970+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
WARN org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl -
Failed to find 1 bookies : excludeBookies [<Bookie:127.0.0.1:3181>], allBookies
[<Bookie:127.0.0.1:3181>].
2022-10-10T16:17:37,970+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
WARN org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl -
Failed to choose a bookie: excluded [<Bookie:127.0.0.1:3181>], fallback to
choose bookie randomly from the cluster.
2022-10-10T16:17:37,970+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
WARN org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl -
Failed to find 1 bookies : excludeBookies [<Bookie:127.0.0.1:3181>], allBookies
[<Bookie:127.0.0.1:3181>].
2022-10-10T16:17:37,970+0800 [BookKeeperClientWorker-OrderedExecutor-2-0]
ERROR org.apache.bookkeeper.client.MetadataUpdateLoop -
UpdateLoop(ledgerId=5,loopId=7c9ce370) Exception updating
org.apache.bookkeeper.client.BKException$BKNotEnoughBookiesException: Not
enough non-faulty bookies available
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.selectRandomInternal(RackawareEnsemblePlacementPolicyImpl.java:780)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.selectRandom(RackawareEnsemblePlacementPolicyImpl.java:697)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.selectFromNetworkLocation(RackawareEnsemblePlacementPolicyImpl.java:586)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy.selectFromNetworkLocation(RackawareEnsemblePlacementPolicy.java:206)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.selectFromNetworkLocation(RackawareEnsemblePlacementPolicyImpl.java:546)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy.selectFromNetworkLocation(RackawareEnsemblePlacementPolicy.java:227)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl.replaceBookie(RackawareEnsemblePlacementPolicyImpl.java:474)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy.replaceBookie(RackawareEnsemblePlacementPolicy.java:120)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.BookieWatcherImpl.replaceBookie(BookieWatcherImpl.java:334)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.EnsembleUtils.replaceBookiesInEnsemble(EnsembleUtils.java:71)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.LedgerHandle.lambda$ensembleChangeLoop$2(LedgerHandle.java:1949)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.MetadataUpdateLoop.writeLoop(MetadataUpdateLoop.java:134)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.MetadataUpdateLoop.run(MetadataUpdateLoop.java:123)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.LedgerHandle.ensembleChangeLoop(LedgerHandle.java:1968)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.LedgerHandle.handleBookieFailure(LedgerHandle.java:1917)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.client.PendingAddOp.writeComplete(PendingAddOp.java:378)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.proto.PerChannelBookieClient$AddCompletion.writeComplete(PerChannelBookieClient.java:2177)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.proto.PerChannelBookieClient$AddCompletion.handleResponse(PerChannelBookieClient.java:2234)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.proto.PerChannelBookieClient$AddCompletion.handleV2Response(PerChannelBookieClient.java:2213)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.proto.PerChannelBookieClient$ReadV2ResponseCallback.safeRun(PerChannelBookieClient.java:1391)
~[bookkeeper-server-4.15.1.jar:4.15.1]
at
org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36)
~[bookkeeper-common-4.15.1.jar:4.15.1]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
~[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
~[?:?]
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
~[netty-common-4.1.77.Final.jar:4.1.77.Final]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
```
So I set it to
`confReturn.setLedgerStorageClass(SortedLedgerStorage.class.getName());` when
starting the bookie in the standalone, and it works. Not sure what the exact
reason is.
### Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
### Does this pull request potentially affect one of the following parts:
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update
later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions
will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since
the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed
in
a forked repository.
The tests will be run in the forked repository until all PR review comments
have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]