You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/10 09:00:57 UTC

[GitHub] [pulsar] RobertIndie opened a new pull request, #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] RobertIndie commented on pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
RobertIndie commented on PR #17985:
URL: https://github.com/apache/pulsar/pull/17985#issuecomment-1284844592

   Close this one due to #18126 has the same implementation to reduce CI cost.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Technoboy- commented on a diff in pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on code in PR #17985:
URL: https://github.com/apache/pulsar/pull/17985#discussion_r991790435


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/BKCluster.java:
##########
@@ -319,7 +327,8 @@ private void startAutoRecovery(BookieServer bserver,
     }
 
     private ServerConfiguration newBaseServerConfiguration() {
-        ServerConfiguration confReturn = new ServerConfiguration();
+        ServerConfiguration confReturn =
+                new ServerConfiguration(this.clusterConf.bkServerConf.orElse(new ServerConfiguration()));

Review Comment:
   orElse -> orElseGet



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] RobertIndie commented on a diff in pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
RobertIndie commented on code in PR #17985:
URL: https://github.com/apache/pulsar/pull/17985#discussion_r991976892


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/BKCluster.java:
##########
@@ -319,7 +327,8 @@ private void startAutoRecovery(BookieServer bserver,
     }
 
     private ServerConfiguration newBaseServerConfiguration() {
-        ServerConfiguration confReturn = new ServerConfiguration();
+        ServerConfiguration confReturn =
+                new ServerConfiguration(this.clusterConf.bkServerConf.orElse(new ServerConfiguration()));

Review Comment:
   Thanks.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] RobertIndie closed pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
RobertIndie closed pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`
URL: https://github.com/apache/pulsar/pull/17985


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] labuladong commented on pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
labuladong commented on PR #17985:
URL: https://github.com/apache/pulsar/pull/17985#issuecomment-1274470738

   I have reproduced this bug and this pr really fixes it.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] codelipenghui commented on pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on PR #17985:
URL: https://github.com/apache/pulsar/pull/17985#issuecomment-1277010596

   @RobertIndie 
   
   > 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.
   
   But it looks like change the default value of the configuration. I think there should be some error logs from the bookie side?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] RobertIndie commented on pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
RobertIndie commented on PR #17985:
URL: https://github.com/apache/pulsar/pull/17985#issuecomment-1280244297

   > But it looks like change the default value of the configuration. I think there should be some error logs from the bookie side?
   
   @codelipenghui I created an issue for this problem: https://github.com/apache/pulsar/issues/18062


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] RobertIndie commented on pull request #17985: [fix][broker] Fix starting bookie in the standalone not respecting the `standalone.conf`

Posted by GitBox <gi...@apache.org>.
RobertIndie commented on PR #17985:
URL: https://github.com/apache/pulsar/pull/17985#issuecomment-1282092479

   @codelipenghui 
   I have found the root cause of the DbLedgerStorage issue. Please see [here](https://github.com/apache/pulsar/issues/18062#issuecomment-1282081487). We need to remove the hardcode configuration of dbStorage_writeCacheMaxSizeMb and dbStorage_readAheadCacheMaxSizeMb in the BkCluster.
   
   Please help review this PR again. Thanks.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org