This message was deleted.
# general
s
This message was deleted.
l
All 3 bookies were landed on the same availability_zone eventhough we configured bookkeeperClientEnforceStrictZoneawarePlacement and bookkeeperClientMinNumZonesPerWriteQuorum
These setting are used to choose the bookies a newly created ledger (Pulsar topic "segment"). If you really mean the bookie pod placement, that is up to the deployment to handle. Which deployment method are you using? Helm chart or Operator? Which flavour?
s
we are using Helm charts for deployment
l
which flavour of Helm charts? version?
s
We are using apache pulsar open source helm charts and customized to our needs especially related to GZK part,
l
The Apache Pulsar OSS helm chart doesn't currently have documentation about how to properly configure it to ensure that pods will be scheduled in different availability zones. Most likely it is possible by configuring .Values.affinity.anti_affinity , .Values.bookkeeper.affinity.anti_affinity, .Values.bookkeeper.affinity.type and .Values.bookkeeper.affinity.anti_affinity_topology_key : https://github.com/apache/pulsar-helm-chart/blob/8cb3c18377e547e5de4ca19e63138ca1387aef59/charts/pulsar/templates/bookkeeper-statefulset.yaml#L[…]00 The helm chart uses podAntiAffinity, however a better way would be to use topologySpreadConstraints to handle the distribution across AZs. The topologyKey for AZs is topology.kubernetes.io/zone .
Once a bookie has been initialized, you cannot move it from an AZ to another. The pod gets scheduled where the PVC is
It's pretty painful to fix an existing deployment to handle AZs properly.
s
Thanks, we updated the question Can you take a look once and explain about the experiment 5 behaviour
@Lari Hotari
Moreover are there any delimiters which we need to set as part of the ZoneAwareEnsemblePolicy while setting up racks? We used the delimiter as
/region/az
(reference from the source code test cases) From the Source code, https://github.com/apache/bookkeeper/blob/df4492012cc03682534cbc8dd68dd81163b0c947[…]va/org/apache/bookkeeper/replication/TestReplicationWorker.java We are getting the below exception
Copy code
Failed to perform http post request: javax.ws.rs.ClientErrorException: HTTP 412 {"reason":"Bookie 'rack' parameter is invalid, When `RackawareEnsemblePlacementPolicy` is enabled, the rack name is not allowed to contain slash (`/`) except for the beginning and end of the rack name string. When `RegionawareEnsemblePlacementPolicy` is enabled, the rack name can only contain one slash (`/`) except for the Bookie 'rack' parameter is invalid, When `RackawareEnsemblePlacementPolicy` is enabled, the rack name is not allowed to contain slash (`/`) except for the beginning and end of the rack name string. When `RegionawareEnsemblePlacementPolicy` is enabled, the rack name can only contain one slash (`/`) except for the beginning and e Reason: Bookie 'rack' parameter is invalid, When `RackawareEnsemblePlacementPolicy` is enabled, the rack name is not allowed to contain slash (`/`) except for the beginning and end of the rack name string. When `RegionawareEnsemblePlacementPolicy` is enabled, the rack name can only contain one slash (`/`) except for the beginning and end of the rack name string.
From the exception, they were mentioning RackawareEnsemblePlacementPolicy and RegionawareEnsemblePlacementPolicy,But they were nowhere mentioned about the ZoneawareEnsemblePlacementPolicy Latter, we tried with
az
as rack and it wont throw any exception, But it is not honouring these parameters
Copy code
bookkeeperClientMinNumZonesPerWriteQuorum: "2"
  bookkeeperClientEnforceStrictZoneawarePlacement: "true"
And landed all the bookies' ledgers on the same availability zone Below is the rack information for ZoneawarePacementPolicy:
Copy code
{
  "westus2": {
    "bookie-0": {
      "rack": "westus2-2"
    },
    "bookie-1": {
      "rack": "westus2-1"
    },
    "bookie-2": {
      "rack": "westus2-1"
    },
    "bookie-3": {
      "rack": "westus2-3"
    },
    "bookie-4": {
      "rack": "westus2-2"
    },
    "bookie-5": {
      "rack": "westus2-3"
    },
    "bookie-6": {
      "rack": "westus2-2"
    }
  }
}
l
It's better to have a guide available that explains all required steps. It seems that https://pulsar.apache.org/docs/3.1.x/administration-isolation-bookie/ doesn't contain docs for configuring it. You have at least the problem that something like
bookkeeperClientEnforceStrictZoneawarePlacement
doesn't exist.
where are these coming from:
Copy code
bookkeeperClientMinNumZonesPerWriteQuorum: "2"
  bookkeeperClientEnforceStrictZoneawarePlacement: "true"
I don't see these referenced in apache/pulsar or apache/pulsar-helm-chart
which extends
TopologyAwareEnsemblePlacementPolicy
l
you would have to add
bookkeeper_
prefix for them to be passed to the client in Pulsar Broker.
PULSAR_PREFIX_bookkeeper_bookkeeperClientEnforceStrictZoneawarePlacement
in helm chart for broker configmap
s
Let me try that Thanks for the quick response
btw. IIRC, I believe that you should be able to use RegionAwareEnsemblePlacementPolicy to configure AZs too.
s
No we havent tried the RegionAwareEnsemblePlacementPolicy, we are trying with
ZoneAwareEnsemblePlacementPolicy
,
l
@Hang Chen what's your recommendation for the configuring this?
@swamy mavuri I'd recommend using "Region-aware placement policy" although it's really about AZs. In that case, you could simply follow the documentation in https://pulsar.apache.org/docs/next/administration-isolation-bookie/#region-aware-placement-policy to make the configuration.
s
Sure, Region-aware placement policy with the rack creation as the below format
/region/az
or
az
alone will be sufficient to form the racks?
l
I guess region could be mapped to AZ and it probably makes sense to map the rack to the cloud provider upgrade domain or similar concept (for example AWS placement group)?
👍 1
s
cc: @Dhinesh Thiruppathi
👀 1
Just want to summarise the learnings we had on the rack aware policies so that others can refer in future: 1.Pulsar doesn't support ZoneAwarePlacementPolicy, but bookkeeper does(https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ZoneawareEnsemblePlacementPolicy.java), (We need to query the pods and corresponding AZ from K8s to form the racks) and also it is advisable to form the scalesets while forming bookie nodepool, so that cloud provider will provide the placement for fault and upgrade domains 2.Pulsar supports Region Aware, but found few anomalies when we are evaluating.(https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/o[…]pache/bookkeeper/client/RegionAwareEnsemblePlacementPolicy.java) configured bookies on different region and it is working as usual. But with region aware, (when disaster happens)we are seeing an exception only after the ledger rollover happens, not immediately when there are not enough bookies with in the rack. lets say in region 1: bk1,bk2,bk3 region2: bk4 region3: bk5 (Here each region belongs to each rack) If i bring down the bookies in region 2 and 3. Immediately it is not throwing any exception and the ensemble formed on the region 1 bookies i.e., bk1,bk2,bk3(Though we set rack enforcement on the broker). https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/o[…]pache/bookkeeper/client/RegionAwareEnsemblePlacementPolicy.java (ReplaceFromRack method assigns bookie from the same rack i believe)