Search before asking
Version
branch: master
commitId: eedf702
Minimal reproduce step
Create a namespace under a tenant
Set bookie-affinity group for the namespace
What did you expect to see?
Pulsar should read the number of bundles('defaultNumberOfNamespaceBundles') data from the broker config file and use that instead of using a single bundle while creating the affinity group.
What did you see instead?
Broker is calling the default bundle method in PoliciesUtil and setting the bundle size as 1
NamespacesBase.java
getLocalPolicies().setLocalPoliciesWithCreate(namespaceName, oldPolicies -> {
LocalPolicies localPolicies = oldPolicies.map(
policies -> new LocalPolicies(policies.bundles,
bookieAffinityGroup,
policies.namespaceAntiAffinityGroup))
.orElseGet(() -> new LocalPolicies(defaultBundle(),
bookieAffinityGroup,
null));
log.info("[{}] Successfully updated local-policies configuration: namespace={}, map={}", clientAppId(),
namespaceName, localPolicies);
PoliciesUtil.java
public static BundlesData defaultBundle() {
List boundaries = new ArrayList<>();
boundaries.add(FIRST_BOUNDARY);
boundaries.add(LAST_BOUNDARY);
return BundlesData.builder()
.numBundles(1)
.boundaries(boundaries)
.build();
}
Anything else?
No response
Are you willing to submit a PR?
Search before asking
Version
branch: master
commitId: eedf702
Minimal reproduce step
Create a namespace under a tenant
Set bookie-affinity group for the namespace
What did you expect to see?
Pulsar should read the number of bundles('defaultNumberOfNamespaceBundles') data from the broker config file and use that instead of using a single bundle while creating the affinity group.
What did you see instead?
Broker is calling the default bundle method in PoliciesUtil and setting the bundle size as 1
NamespacesBase.java
getLocalPolicies().setLocalPoliciesWithCreate(namespaceName, oldPolicies -> {
LocalPolicies localPolicies = oldPolicies.map(
policies -> new LocalPolicies(policies.bundles,
bookieAffinityGroup,
policies.namespaceAntiAffinityGroup))
.orElseGet(() -> new LocalPolicies(defaultBundle(),
bookieAffinityGroup,
null));
log.info("[{}] Successfully updated local-policies configuration: namespace={}, map={}", clientAppId(),
namespaceName, localPolicies);
PoliciesUtil.java
public static BundlesData defaultBundle() {
List boundaries = new ArrayList<>();
boundaries.add(FIRST_BOUNDARY);
boundaries.add(LAST_BOUNDARY);
return BundlesData.builder()
.numBundles(1)
.boundaries(boundaries)
.build();
}
Anything else?
No response
Are you willing to submit a PR?