Skip to content

Conversation

BewareMyPower
Copy link
Contributor

Motivation

See https://lists.apache.org/thread/tpd2kgl4v3x8bkw0skv0nj38rzrk56t7

Modifications

Set the 3rd argument of getPartitionedTopicMetadata to true in PulsarClientImpl#getPartitionsForTopic, which is used to query the number of partitions.

Add testAutoPartitionsUpdate to cover the case. Specially, it tests a consumer that subscribes two partitioned topics to cover the path here:

.map(t -> subscribeAsync(t, createTopicIfDoesNotExist))

P.S. This test is only added to ClientTest25, which runs tests against apachepulsar/pulsar:2.5.0 image. The current backward compatibility test strategy is ambiguous that only 2.2.0, 2.3.0, 2.4.0, 2.5.0 are tested. It's hard to cover all old versions, but only choose these 4 versions does not make sense. This topic should be out of the scope of this PR. Anyway, the test on 2.5.0 can already prevent regression on the fix.

Documentation

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

Matching PR in forked repository

PR in forked repository:

@BewareMyPower BewareMyPower self-assigned this Oct 4, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client doc-not-needed Your PR changes do not impact docs release/3.0.15 release/4.0.8 release/4.1.2 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.

1 participant