Skip to content

Conversation

@nborisov
Copy link
Owner

Fixes apache#23845

Motivation

There is a not covered scenario for draining hashes and key shared subscriptions at PersistentStickyKeyDispatcherMultipleConsumers. The detailed scenario described at apache#23845 (comment)
As a result draining hashes could contain entries with consumer which was stopped. This leads consuming to get stuck.

Modifications

Decrease draining hash entry refCount in case its hash range returned to the initial owner which holds the entry in pending acks.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added integration test org.apache.pulsar.client.api.KeySharedSubscriptionTest#testMessageDeliveredFromDrainingHashes to verify the scenario
  • Existing unit tests were modified to check changes applied in PR: org.apache.pulsar.broker.service.ConsistentHashingStickyKeyConsumerSelectorTest#testShouldNotSwapExistingConsumers, org.apache.pulsar.broker.service.ConsumerHashAssignmentsSnapshotTest#testResolveConsumerRemovedHashRanges_NoChanges, org.apache.pulsar.broker.service.ConsumerHashAssignmentsSnapshotTest#testResolveConsumerUpdatedHashRanges_RangeAdded, org.apache.pulsar.broker.service.ConsumerHashAssignmentsSnapshotTest#testResolveConsumerRemovedHashRanges_RangeUpdated, org.apache.pulsar.broker.service.ConsumerHashAssignmentsSnapshotTest#testResolveConsumerUpdatedHashRanges_OverlappingRanges

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: #4

thetumbled and others added 30 commits September 12, 2025 13:22
…ead letter topic producer (apache#24020)

Co-authored-by: Lari Hotari <lhotari@apache.org>
(cherry picked from commit 302c1d5)
…yTracker with StampedLock optimistic reads (apache#24542)"

This reverts commit 455a052.
…ties (apache#24532)

Co-authored-by: Claude <noreply@anthropic.com>
…he#24666)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
(cherry picked from commit 19f9c26)
…1.0 version specific path (apache#24669)

(cherry picked from commit 3b7bef1)
…avoid infinite loop when schema validation fails on an incoming message (apache#24663)

Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
(cherry picked from commit 829df71)
…ntial topic policy updates (apache#24427)

(cherry picked from commit e5e7981)
…ification to be ignored (apache#23977)

Co-authored-by: fanjianye <fanjianye@bigo.sg>
(cherry picked from commit a532798)
…ng messages for a topic, even though there are many subscriptions (apache#24622)

(cherry picked from commit 84205eb)
…aramsLookupAutoClusterFailover (apache#23336)

(cherry picked from commit 8fd5bf5)
…e of failed delete data from transaction buffer topic (apache#24648)
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
coderzc and others added 3 commits September 12, 2025 13:24
…tead of a record to compatible with lower version JDK
…deliver messages from the replay queue after a consumer disconnects and leaves a backlog unless new messages are produced
@nborisov nborisov closed this Sep 12, 2025
@nborisov nborisov deleted the fix-key-shared-bug-23845-master-branch branch September 12, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet