Skip to content

Conversation

@poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Dec 24, 2025

Motivation

Background

Broker will delete topics automaticailly if the local cluster is removed from namespace-level policies.

The PR #23313 made topic deletion relies on reading namespace level policies, which leads to the issue that topic deletion fails if the local cluster has been removed from namespace-level policies.

before #23313, the steps that deletes topics

  • disconnect clients
  • unsubscribe all subscriptions
  • delete topic

after #23313, the steps that deletes topics

2025-12-24T02:04:30,422+0000 [pulsar-io-9-3] ERROR org.apache.pulsar.broker.service.persistent.PersistentTopic - [persistent://bedrock/bedrock-pulsar-app-1/topic-1-partition-2] Error deleting topic java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.BrokerServiceException$ServiceUnitNotReadyException: Topic creation encountered an exception by initialize topic policies service. topic_name=persistent://public/default/topic-1 error_message={"errorMsg":"Namespace missing local cluster name in clusters list: local_cluster=c1 ns=public/default clusters=[c2]","reqId":931862268202628430, "remote":"xxx/xxx:6650", "local":"/xxx:57840"}
 at org.apache.pulsar.common.util.FutureUtil.wrapToCompletionException(FutureUtil.java:361)
 at org.apache.pulsar.broker.service.BrokerService.lambda$getManagedLedgerConfig$97(BrokerService.java:2125) 
 at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(Unknown Source) ~[?:?] at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) ~[?:?]
 at org.apache.pulsar.client.impl.PulsarClientImpl.lambda$createSingleTopicReaderAsync$18(PulsarClientImpl.java:783)  at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) ~[?:?]
 at org.apache.pulsar.client.impl.PulsarClientImpl.lambda$getPartitionedTopicMetadata$32(PulsarClientImpl.java:1239) 
 at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) ~[?:?]
 at org.apache.pulsar.client.impl.BinaryProtoLookupService.lambda$getPartitionedTopicMetadata$10(BinaryProtoLookupService.java:322)
 at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source) ~[?:?] at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[?:?]
 at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source) ~[?:?]
 at org.apache.pulsar.client.impl.ClientCnx.handlePartitionResponse(ClientCnx.java:697) 
 at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:144)
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[io.netty-netty-codec-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[io.netty-netty-codec-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final] at io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152) ~[io.netty-netty-handler-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868) ~[io.netty-netty-transport-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799) ~[io.netty-netty-transport-classes-epoll-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501) ~[io.netty-netty-transport-classes-epoll-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399) ~[io.netty-netty-transport-classes-epoll-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998) ~[io.netty-netty-common-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty-netty-common-4.1.127.Final.jar:4.1.127.Final]
 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.127.Final.jar:4.1.127.Final]
 at java.base/java.lang.Thread.run(Unknown Source) [?:?] Caused by: org.apache.pulsar.broker.service.BrokerServiceException$ServiceUnitNotReadyException: Topic creation encountered an exception by initialize topic policies service. topic_name=persistent://bedrock/bedrock-pulsar-app-1/topic-1-partition-2-ford.bdrck.bokibdrckdemo.CommonRestController%24PulsarConsumer__transaction_pending_ack error_message={"errorMsg":"Namespace missing local cluster name in clusters list: local_cluster=bdrck-pulsar-live-us-east4 ns=bedrock/bedrock-pulsar-app-1 clusters=[bdrck-pulsar-live-us-central1]","reqId":931862268202628430, "remote":"bdrck-pulsar-live-us-east4-broker-1.bdrck-pulsar-live-us-east4-broker-headless.o-livi9.svc.cluster.local/10.127.48.196:6650", "local":"/10.127.48.196:57840"} ... 45 more

Modifications

Modify the step "unsubscribe all subscriptions", instead of build new managed ledger configuration, use the compeletely built config(managedLedger.config), which avoids to access policies.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Dec 24, 2025
@poorbarcode poorbarcode added ready-to-test release/4.0.9 release/4.1.3 type/bug The PR fixed a bug or issue reported a bug labels Dec 24, 2025
@poorbarcode poorbarcode added this to the 4.2.0 milestone Dec 24, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test release/4.0.9 release/4.1.3 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants