Skip to content

Comments

[fix][admin] Fix partitioned topic auto deletion http request timeout#8

Open
oneby-wang wants to merge 5 commits intomasterfrom
partitioned_topic_auto_deletion_http_timeout_fix
Open

[fix][admin] Fix partitioned topic auto deletion http request timeout#8
oneby-wang wants to merge 5 commits intomasterfrom
partitioned_topic_auto_deletion_http_timeout_fix

Conversation

@oneby-wang
Copy link
Owner

@oneby-wang oneby-wang commented Oct 28, 2025

Fixes apache#24879

Motivation

Partitioned-topic auto deletion call chain:

  1. gc process(invoked on broker0)
  2. delete partitioned-topic admin api(invoked on broker0)
  3. delete topic-partition-0 admin api(invoked on broker0)

If brokerClient's maxConnection is 1, then broker0 wait itself to release the connection, the result is timeout. So we check topic-partition-0 existence first to avoid connection pool deadlock.

Modifications

When calling delete partitioned-topic admin api, first check topic partitions existence to avoid calling delete topic admin api by broker itself again, which would help partitioned-topic auto deletion in gc process.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as (please describe tests).

InactiveTopicDeleteTest#testWhenSubPartitionNotDelete() test method.

https://github.com/apache/pulsar/blob/1ca17972459095278e2b5f7ed7fd55c8921d8826/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/InactiveTopicDeleteTest.java#L113-L136

But the default connectionsPerBroker is 16, which can not reproduce the problem.

https://github.com/apache/pulsar/blob/1ca17972459095278e2b5f7ed7fd55c8921d8826/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/PulsarAdminBuilderImpl.java#L48-L51

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository:

@oneby-wang oneby-wang marked this pull request as draft December 3, 2025 08:48
@oneby-wang oneby-wang marked this pull request as ready for review December 3, 2025 08:49
@oneby-wang oneby-wang closed this Dec 3, 2025
@oneby-wang oneby-wang reopened this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Auto topic delete of partitioned topics has a MetadataCacheImpl race condition

1 participant