From aefe56c6f1b71d194f3af7506fcd9e15df2c97a1 Mon Sep 17 00:00:00 2001 From: oneby-wang Date: Fri, 19 Sep 2025 14:05:18 +0800 Subject: [PATCH 1/6] [fix][admin] set local policies overwrites "number of bundles" passed during namespace creation --- .../broker/admin/impl/NamespacesBase.java | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java index 0e821c83e610d..274d4a84d14da 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java @@ -19,7 +19,6 @@ package org.apache.pulsar.broker.admin.impl; import static org.apache.commons.lang3.StringUtils.isBlank; -import static org.apache.pulsar.common.policies.data.PoliciesUtil.defaultBundle; import static org.apache.pulsar.common.policies.data.PoliciesUtil.getBundles; import com.google.common.collect.Sets; import java.lang.reflect.Field; @@ -962,9 +961,7 @@ protected void internalSetBookieAffinityGroup(BookieAffinityGroupData bookieAffi bookieAffinityGroup, policies.namespaceAntiAffinityGroup, policies.migrated)) - .orElseGet(() -> new LocalPolicies(getBundles(config().getDefaultNumberOfNamespaceBundles()), - bookieAffinityGroup, - null)); + .orElseGet(() -> new LocalPolicies(getDefaultBundleData(), bookieAffinityGroup, null)); log.info("[{}] Successfully updated local-policies configuration: namespace={}, map={}", clientAppId(), namespaceName, localPolicies); return localPolicies; @@ -973,6 +970,8 @@ protected void internalSetBookieAffinityGroup(BookieAffinityGroupData bookieAffi log.warn("[{}] Failed to update local-policy configuration for namespace {}: does not exist", clientAppId(), namespaceName); throw new RestException(Status.NOT_FOUND, "Namespace does not exist"); + } catch (RestException re) { + throw re; } catch (Exception e) { log.error("[{}] Failed to update local-policy configuration for namespace {}", clientAppId(), namespaceName, e); @@ -1789,11 +1788,12 @@ protected void internalSetNamespaceAntiAffinityGroup(String antiAffinityGroup) { policies.bookieAffinityGroup, antiAffinityGroup, policies.migrated)) - .orElseGet(() -> new LocalPolicies(defaultBundle(), - null, antiAffinityGroup)) + .orElseGet(() -> new LocalPolicies(getDefaultBundleData(), null, antiAffinityGroup)) ); log.info("[{}] Successfully updated local-policies configuration: namespace={}, map={}", clientAppId(), namespaceName, antiAffinityGroup); + } catch (RestException re) { + throw re; } catch (Exception e) { log.error("[{}] Failed to update local-policy configuration for namespace {}", clientAppId(), namespaceName, e); @@ -2805,9 +2805,10 @@ protected void internalEnableMigration(boolean migrated) { policies.bookieAffinityGroup, policies.namespaceAntiAffinityGroup, migrated)) - .orElseGet(() -> new LocalPolicies(getBundles(config().getDefaultNumberOfNamespaceBundles()), - null, null, migrated))); + .orElseGet(() -> new LocalPolicies(getDefaultBundleData(), null, null, migrated))); log.info("Successfully updated migration on namespace {}", namespaceName); + } catch (RestException re) { + throw re; } catch (Exception e) { log.error("Failed to update migration on namespace {}", namespaceName, e); throw new RestException(e); @@ -2907,5 +2908,16 @@ protected CompletableFuture> internalGetNamespaceAllowedClustersAsyn .thenApply(policies -> policies.allowed_clusters); } - + private BundlesData getDefaultBundleData() { + Optional nsPolicies; + try { + nsPolicies = namespaceResources().getPolicies(namespaceName); + } catch (MetadataStoreException e) { + log.error("[{}] Failed to get namespace-policy configuration for namespace {}", clientAppId(), + namespaceName, e); + throw new RestException(e); + } + return nsPolicies.isPresent() ? nsPolicies.get().bundles : + getBundles(config().getDefaultNumberOfNamespaceBundles()); + } } From be0b851a176af730f761403bf5b886d30d8d2e5c Mon Sep 17 00:00:00 2001 From: oneby-wang Date: Sat, 20 Sep 2025 16:27:33 +0800 Subject: [PATCH 2/6] [fix][admin] set local policies overwrites "number of bundles" passed during namespace creation --- .../broker/admin/impl/NamespacesBase.java | 16 +- .../pulsar/broker/admin/NamespacesV2Test.java | 149 ++++++++++++++++++ 2 files changed, 160 insertions(+), 5 deletions(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java index 274d4a84d14da..b67361d9bf7df 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java @@ -2908,16 +2908,22 @@ protected CompletableFuture> internalGetNamespaceAllowedClustersAsyn .thenApply(policies -> policies.allowed_clusters); } + // TODO remove this sync method after async refactor private BundlesData getDefaultBundleData() { - Optional nsPolicies; try { - nsPolicies = namespaceResources().getPolicies(namespaceName); - } catch (MetadataStoreException e) { + return getDefaultBundleDataAsync().get(config().getMetadataStoreOperationTimeoutSeconds(), + TimeUnit.SECONDS); + } catch (Exception e) { log.error("[{}] Failed to get namespace-policy configuration for namespace {}", clientAppId(), namespaceName, e); throw new RestException(e); } - return nsPolicies.isPresent() ? nsPolicies.get().bundles : - getBundles(config().getDefaultNumberOfNamespaceBundles()); } + + private CompletableFuture getDefaultBundleDataAsync() { + return namespaceResources().getPoliciesAsync(namespaceName).thenApply( + optionalPolicies -> optionalPolicies.isPresent() ? optionalPolicies.get().bundles : + getBundles(config().getDefaultNumberOfNamespaceBundles())); + } + } diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java index c1e8dfa30994a..db177234c3e7b 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java @@ -18,6 +18,7 @@ */ package org.apache.pulsar.broker.admin; +import static org.apache.pulsar.common.policies.data.PoliciesUtil.getBundles; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; @@ -38,9 +39,12 @@ import org.apache.pulsar.broker.web.PulsarWebResource; import org.apache.pulsar.broker.web.RestException; import org.apache.pulsar.common.naming.NamespaceName; +import org.apache.pulsar.common.policies.data.BookieAffinityGroupData; +import org.apache.pulsar.common.policies.data.BundlesData; import org.apache.pulsar.common.policies.data.ClusterData; import org.apache.pulsar.common.policies.data.DelayedDeliveryPolicies; import org.apache.pulsar.common.policies.data.DispatchRate; +import org.apache.pulsar.common.policies.data.Policies; import org.apache.pulsar.common.policies.data.PolicyName; import org.apache.pulsar.common.policies.data.PolicyOperation; import org.apache.pulsar.common.policies.data.PublishRate; @@ -236,4 +240,149 @@ public void testOperationDelayedDelivery() throws Exception { assertEquals(e.getResponse().getStatus(), Response.Status.PRECONDITION_FAILED.getStatusCode()); } } + + @Test + public void testSetBookieAffinityGroupWithEmptyPolicies() throws Exception { + // 1. create namespace with empty policies + String setBookieAffinityGroupNs = "test-set-bookie-affinity-group-ns"; + asyncRequests(response -> namespaces.createNamespace(response, testTenant, setBookieAffinityGroupNs, null)); + + // 2.set bookie affinity group + String primaryAffinityGroup = "primary-affinity-group"; + String secondaryAffinityGroup = "secondary-affinity-group"; + BookieAffinityGroupData bookieAffinityGroupDataReq = + BookieAffinityGroupData.builder().bookkeeperAffinityGroupPrimary(primaryAffinityGroup) + .bookkeeperAffinityGroupSecondary(secondaryAffinityGroup).build(); + namespaces.setBookieAffinityGroup(testTenant, setBookieAffinityGroupNs, bookieAffinityGroupDataReq); + + // 3.query namespace num bundles, should be conf.getDefaultNumberOfNamespaceBundles() + BundlesData bundlesData = (BundlesData) asyncRequests( + response -> namespaces.getBundlesData(response, testTenant, setBookieAffinityGroupNs)); + assertEquals(bundlesData.getNumBundles(), conf.getDefaultNumberOfNamespaceBundles()); + + // 4.assert namespace bookie affinity group + BookieAffinityGroupData bookieAffinityGroupDataResp = + namespaces.getBookieAffinityGroup(testTenant, setBookieAffinityGroupNs); + assertEquals(bookieAffinityGroupDataResp, bookieAffinityGroupDataReq); + } + + @Test + public void testSetBookieAffinityGroupWithExistBundlePolicies() throws Exception { + // 1. create namespace with specified num bundles + String setBookieAffinityGroupNs = "test-set-bookie-affinity-group-ns"; + Policies policies = new Policies(); + policies.bundles = getBundles(10); + asyncRequests(response -> namespaces.createNamespace(response, testTenant, setBookieAffinityGroupNs, policies)); + + // 2.set bookie affinity group + String primaryAffinityGroup = "primary-affinity-group"; + String secondaryAffinityGroup = "secondary-affinity-group"; + BookieAffinityGroupData bookieAffinityGroupDataReq = + BookieAffinityGroupData.builder().bookkeeperAffinityGroupPrimary(primaryAffinityGroup) + .bookkeeperAffinityGroupSecondary(secondaryAffinityGroup).build(); + namespaces.setBookieAffinityGroup(testTenant, setBookieAffinityGroupNs, bookieAffinityGroupDataReq); + + // 3.query namespace num bundles, should be policies.bundles, which we set before + BundlesData bundlesData = (BundlesData) asyncRequests( + response -> namespaces.getBundlesData(response, testTenant, setBookieAffinityGroupNs)); + assertEquals(bundlesData, policies.bundles); + + // 4.assert namespace bookie affinity group + BookieAffinityGroupData bookieAffinityGroupDataResp = + namespaces.getBookieAffinityGroup(testTenant, setBookieAffinityGroupNs); + assertEquals(bookieAffinityGroupDataResp, bookieAffinityGroupDataReq); + } + + @Test + public void testSetNamespaceAntiAffinityGroupWithEmptyPolicies() throws Exception { + // 1. create namespace with empty policies + String setNamespaceAntiAffinityGroupNs = "test-set--namespace-anti-affinity-group-ns"; + asyncRequests( + response -> namespaces.createNamespace(response, testTenant, setNamespaceAntiAffinityGroupNs, null)); + + // 2.set namespace anti affinity group + String namespaceAntiAffinityGroupReq = "namespace-anti-affinity-group"; + namespaces.setNamespaceAntiAffinityGroup(testTenant, setNamespaceAntiAffinityGroupNs, + namespaceAntiAffinityGroupReq); + + // 3.query namespace num bundles, should be conf.getDefaultNumberOfNamespaceBundles() + BundlesData bundlesData = (BundlesData) asyncRequests( + response -> namespaces.getBundlesData(response, testTenant, setNamespaceAntiAffinityGroupNs)); + assertEquals(bundlesData.getNumBundles(), conf.getDefaultNumberOfNamespaceBundles()); + + // 4.assert namespace anti affinity group + String namespaceAntiAffinityGroupResp = + namespaces.getNamespaceAntiAffinityGroup(testTenant, setNamespaceAntiAffinityGroupNs); + assertEquals(namespaceAntiAffinityGroupResp, namespaceAntiAffinityGroupReq); + } + + @Test + public void testSetNamespaceAntiAffinityGroupWithExistBundlePolicies() throws Exception { + // 1. create namespace with specified num bundles + String setNamespaceAntiAffinityGroupNs = "test-set--namespace-anti-affinity-group-ns"; + Policies policies = new Policies(); + policies.bundles = getBundles(10); + asyncRequests(response -> namespaces.createNamespace(response, testTenant, setNamespaceAntiAffinityGroupNs, + policies)); + + // 2.set namespace anti affinity group + String namespaceAntiAffinityGroupReq = "namespace-anti-affinity-group"; + namespaces.setNamespaceAntiAffinityGroup(testTenant, setNamespaceAntiAffinityGroupNs, + namespaceAntiAffinityGroupReq); + + // 3.query namespace num bundles, should be policies.bundles, which we set before + BundlesData bundlesData = (BundlesData) asyncRequests( + response -> namespaces.getBundlesData(response, testTenant, setNamespaceAntiAffinityGroupNs)); + assertEquals(bundlesData, policies.bundles); + + // 4.assert namespace anti affinity group + String namespaceAntiAffinityGroupResp = + namespaces.getNamespaceAntiAffinityGroup(testTenant, setNamespaceAntiAffinityGroupNs); + assertEquals(namespaceAntiAffinityGroupResp, namespaceAntiAffinityGroupReq); + } + + @Test + public void testEnableMigrationWithEmptyPolicies() throws Exception { + // 1. create namespace with empty policies + String enableMigrationGroupNs = "test-set--namespace-enable-migration-ns"; + asyncRequests(response -> namespaces.createNamespace(response, testTenant, enableMigrationGroupNs, null)); + + // 2.set enable migration + boolean enableMigrationReq = true; + namespaces.enableMigration(testTenant, enableMigrationGroupNs, enableMigrationReq); + + // 3.query namespace num bundles, should be conf.getDefaultNumberOfNamespaceBundles() + BundlesData bundlesData = (BundlesData) asyncRequests( + response -> namespaces.getBundlesData(response, testTenant, enableMigrationGroupNs)); + assertEquals(bundlesData.getNumBundles(), conf.getDefaultNumberOfNamespaceBundles()); + + // 4.assert namespace enable migration + Policies policiesResp = (Policies) asyncRequests( + response -> namespaces.getPolicies(response, testTenant, enableMigrationGroupNs)); + assertEquals(policiesResp.migrated, enableMigrationReq); + } + + @Test + public void testEnableMigrationWithExistBundlePolicies() throws Exception { + // 1. create namespace with specified num bundles + String enableMigrationGroupNs = "test-set--namespace-enable-migration-ns"; + Policies policiesReq = new Policies(); + policiesReq.bundles = getBundles(10); + asyncRequests( + response -> namespaces.createNamespace(response, testTenant, enableMigrationGroupNs, policiesReq)); + + // 2.set enable migration + boolean enableMigrationReq = true; + namespaces.enableMigration(testTenant, enableMigrationGroupNs, enableMigrationReq); + + // 3.query namespace num bundles, should be policies.bundles, which we set before + BundlesData bundlesData = (BundlesData) asyncRequests( + response -> namespaces.getBundlesData(response, testTenant, enableMigrationGroupNs)); + assertEquals(bundlesData, policiesReq.bundles); + + // 4.assert namespace enable migration + Policies policiesResp = (Policies) asyncRequests( + response -> namespaces.getPolicies(response, testTenant, enableMigrationGroupNs)); + assertEquals(policiesResp.migrated, enableMigrationReq); + } } From 54f708733a936717bf3e8b9a82bd059d09472dc1 Mon Sep 17 00:00:00 2001 From: oneby-wang Date: Wed, 24 Sep 2025 15:23:26 +0800 Subject: [PATCH 3/6] [fix][admin] ExtensibleLoadManagerTest assert namespace antiAffinityGroup and failureDomain --- .../integration/loadbalance/ExtensibleLoadManagerTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java index 899296448199a..97d577de772f1 100644 --- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java @@ -318,6 +318,11 @@ public void testAntiaffinityPolicy() throws PulsarAdminException { admin.namespaces().setNamespaceAntiAffinityGroup(namespace, namespaceAntiAffinityGroup); admin.clusters().createFailureDomain(clusterName, namespaceAntiAffinityGroup, FailureDomain.builder() .brokers(Set.of(activeBrokers.get(i))).build()); + String namespaceAntiAffinityGroupResp = admin.namespaces().getNamespaceAntiAffinityGroup(namespace); + assertEquals(namespaceAntiAffinityGroupResp, namespaceAntiAffinityGroup); + FailureDomain failureDomainResp = + admin.clusters().getFailureDomain(clusterName, namespaceAntiAffinityGroup); + assertEquals(failureDomainResp.getBrokers(), Set.of(activeBrokers.get(i))); } Set result = new HashSet<>(); From 65bf2615611a7b2a4a48ad447a80149dbe39d4ca Mon Sep 17 00:00:00 2001 From: oneby-wang Date: Wed, 24 Sep 2025 16:21:17 +0800 Subject: [PATCH 4/6] [fix][admin] ExtensibleLoadManagerTest assert antiAffinityNamespaces --- .../integration/loadbalance/ExtensibleLoadManagerTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java index 97d577de772f1..be4b55c5b3d86 100644 --- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java @@ -312,8 +312,10 @@ public void testAntiaffinityPolicy() throws PulsarAdminException { assertEquals(activeBrokers.size(), NUM_BROKERS); + Set antiAffinityEnabledNameSpacesReq = new HashSet<>(); for (int i = 0; i < activeBrokers.size(); i++) { String namespace = antiAffinityEnabledNameSpace + "-" + i; + antiAffinityEnabledNameSpacesReq.add(namespace); admin.namespaces().createNamespace(namespace, 10); admin.namespaces().setNamespaceAntiAffinityGroup(namespace, namespaceAntiAffinityGroup); admin.clusters().createFailureDomain(clusterName, namespaceAntiAffinityGroup, FailureDomain.builder() @@ -325,6 +327,10 @@ public void testAntiaffinityPolicy() throws PulsarAdminException { assertEquals(failureDomainResp.getBrokers(), Set.of(activeBrokers.get(i))); } + List antiAffinityNamespacesResp = + admin.namespaces().getAntiAffinityNamespaces(DEFAULT_TENANT, clusterName, namespaceAntiAffinityGroup); + assertEquals(new HashSet<>(antiAffinityNamespacesResp), antiAffinityEnabledNameSpacesReq); + Set result = new HashSet<>(); for (int i = 0; i < activeBrokers.size(); i++) { final String topic = "persistent://" + antiAffinityEnabledNameSpace + "-" + i + "/topic"; From fe8018419b36a2897bc0fcdd7b302a1872cd9594 Mon Sep 17 00:00:00 2001 From: oneby-wang Date: Wed, 24 Sep 2025 17:09:53 +0800 Subject: [PATCH 5/6] [fix][admin] fix typo in NamespacesV2Test and ExtensibleLoadManagerTest --- .../org/apache/pulsar/broker/admin/NamespacesV2Test.java | 8 ++++---- .../loadbalance/ExtensibleLoadManagerTest.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java index db177234c3e7b..8ac8155614a46 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesV2Test.java @@ -296,7 +296,7 @@ public void testSetBookieAffinityGroupWithExistBundlePolicies() throws Exception @Test public void testSetNamespaceAntiAffinityGroupWithEmptyPolicies() throws Exception { // 1. create namespace with empty policies - String setNamespaceAntiAffinityGroupNs = "test-set--namespace-anti-affinity-group-ns"; + String setNamespaceAntiAffinityGroupNs = "test-set-namespace-anti-affinity-group-ns"; asyncRequests( response -> namespaces.createNamespace(response, testTenant, setNamespaceAntiAffinityGroupNs, null)); @@ -319,7 +319,7 @@ public void testSetNamespaceAntiAffinityGroupWithEmptyPolicies() throws Exceptio @Test public void testSetNamespaceAntiAffinityGroupWithExistBundlePolicies() throws Exception { // 1. create namespace with specified num bundles - String setNamespaceAntiAffinityGroupNs = "test-set--namespace-anti-affinity-group-ns"; + String setNamespaceAntiAffinityGroupNs = "test-set-namespace-anti-affinity-group-ns"; Policies policies = new Policies(); policies.bundles = getBundles(10); asyncRequests(response -> namespaces.createNamespace(response, testTenant, setNamespaceAntiAffinityGroupNs, @@ -344,7 +344,7 @@ public void testSetNamespaceAntiAffinityGroupWithExistBundlePolicies() throws Ex @Test public void testEnableMigrationWithEmptyPolicies() throws Exception { // 1. create namespace with empty policies - String enableMigrationGroupNs = "test-set--namespace-enable-migration-ns"; + String enableMigrationGroupNs = "test-set-namespace-enable-migration-ns"; asyncRequests(response -> namespaces.createNamespace(response, testTenant, enableMigrationGroupNs, null)); // 2.set enable migration @@ -365,7 +365,7 @@ public void testEnableMigrationWithEmptyPolicies() throws Exception { @Test public void testEnableMigrationWithExistBundlePolicies() throws Exception { // 1. create namespace with specified num bundles - String enableMigrationGroupNs = "test-set--namespace-enable-migration-ns"; + String enableMigrationGroupNs = "test-set-namespace-enable-migration-ns"; Policies policiesReq = new Policies(); policiesReq.bundles = getBundles(10); asyncRequests( diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java index be4b55c5b3d86..f9bcab33d0dbd 100644 --- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java @@ -303,7 +303,7 @@ public void testStopBroker() throws Exception { } @Test(timeOut = 80 * 1000) - public void testAntiaffinityPolicy() throws PulsarAdminException { + public void testAntiAffinityPolicy() throws PulsarAdminException { final String namespaceAntiAffinityGroup = "my-anti-affinity-filter"; final String antiAffinityEnabledNameSpace = DEFAULT_TENANT + "/my-ns-filter" + nsSuffix; final int numPartition = 20; From 1f566f87dab95df6dc7aeeb734c32702e08bc43b Mon Sep 17 00:00:00 2001 From: oneby-wang Date: Wed, 24 Sep 2025 22:46:54 +0800 Subject: [PATCH 6/6] [fix][admin] ExtensibleLoadManagerTest.testAntiAffinityPolicy change numBundles to 1 --- .../integration/loadbalance/ExtensibleLoadManagerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java index f9bcab33d0dbd..f9c4bcdc31da7 100644 --- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/loadbalance/ExtensibleLoadManagerTest.java @@ -316,7 +316,7 @@ public void testAntiAffinityPolicy() throws PulsarAdminException { for (int i = 0; i < activeBrokers.size(); i++) { String namespace = antiAffinityEnabledNameSpace + "-" + i; antiAffinityEnabledNameSpacesReq.add(namespace); - admin.namespaces().createNamespace(namespace, 10); + admin.namespaces().createNamespace(namespace, 1); admin.namespaces().setNamespaceAntiAffinityGroup(namespace, namespaceAntiAffinityGroup); admin.clusters().createFailureDomain(clusterName, namespaceAntiAffinityGroup, FailureDomain.builder() .brokers(Set.of(activeBrokers.get(i))).build());