You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2022/10/24 18:24:25 UTC

[pulsar] branch branch-2.9 updated: [fix][storage] Autorecovery default reppDnsResolverClass to ZkBookieRackAffinityMapping (#15640)

This is an automated email from the ASF dual-hosted git repository.

mmarshall pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.9 by this push:
     new 62455180560 [fix][storage] Autorecovery default reppDnsResolverClass to ZkBookieRackAffinityMapping (#15640)
62455180560 is described below

commit 6245518056084de4a98a61a30b17791d6ce9bc37
Author: Michael Marshall <mm...@apache.org>
AuthorDate: Mon Oct 24 11:17:12 2022 -0700

    [fix][storage] Autorecovery default reppDnsResolverClass to ZkBookieRackAffinityMapping (#15640)
    
    * [Autorecovery] Default reppDnsResolverClass to ZkBookieRackAffinityMapping
    
    * Improve documentation
    
    Fixes: https://github.com/apache/pulsar/issues/18012
    
    ### Motivation
    
    The current Bookkeeper configuration defaults to using `org.apache.bookkeeper.net.ScriptBasedMapping` for the `DNSToSwitchMapping` implementation. However, this default configuration does not align with the Broker's default configuration, which is `org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping`. As such, the default configuration for a Pulsar cluster does not lead to ideal rack awareness when ledgers need to be recovered. The result is that a user can configure a cluster for [...]
    
    I propose we configure bookkeeper to use the broker's `ZkBookieRackAffinityMapping` class. That way, autorecovery will honor the operator's configured rack awareness policies out of the box.
    
    ### Modifications
    
    * Add default value for `reppDnsResolverClass` to the `conf/bookkeeper.conf` configuration. This change effectively switches the default from `org.apache.bookkeeper.net.ScriptBasedMapping` to `org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping`.
    
    ### Verifying this change
    
    I manually verified that the `ZkBookieRackAffinityMapping` works by running some tests in a minikube cluster deployed with the DataStax helm chart. I set up 3 racks, 4 bookies, and a topic with a E=2, Qw=2, and Qa=2. I then verified that the autorecovery pod correctly discovered the racks and then identified when an ensemble was not following the rack placement policy after two bookies were removed. I documented my testing a bit more here: https://github.com/datastax/pulsar-helm-chart [...]
    
    ### Does this pull request potentially affect one of the following parts:
    
    It changes a default value. The tradeoff is that a user relying on the `ScriptBasedMapping` default might accidentally get switched to using the `ZkBookieRackAffinityMapping` implementation. Given that `ScriptBasedMapping` doesn't work out of the box, and that the broker's default to `ZkBookieRackAffinityMapping`, I think this is an acceptable tradeoff.
    
    - [x] `doc`
    
    (cherry picked from commit 9812297b4c1353e097c64e6c9981d17c22eff5bf)
---
 conf/bookkeeper.conf | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/conf/bookkeeper.conf b/conf/bookkeeper.conf
index f26abe086e4..7c9b627bbc7 100644
--- a/conf/bookkeeper.conf
+++ b/conf/bookkeeper.conf
@@ -277,6 +277,17 @@ useV2WireProtocol=true
 #
 # ensemblePlacementPolicy=org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy
 
+# The DNS resolver class used for resolving the network location of each bookie. All bookkeeper clients
+# should be configured with the same value to ensure that each bookkeeper client builds
+# the same network topology in order to then place ensembles consistently. The setting is used
+# when using either RackawareEnsemblePlacementPolicy and RegionAwareEnsemblePlacementPolicy.
+# The setting in this file is used to configure the bookkeeper client used in the bookkeeper, which
+# is used by the autorecovery process.
+# Some available options:
+#   - org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping (Pulsar default)
+#   - org.apache.bookkeeper.net.ScriptBasedMapping (Bookkeeper default)
+reppDnsResolverClass=org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping
+
 #############################################################################
 ## Netty server settings
 #############################################################################