GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [fix][broker] Recover Shared and Key_Shared dispatch after exceptions by Denovo1998 · Pull Request #26916 · apache/pulsar Conversation
Contributor
Follow-up to apache/pulsar#26824. MotivationAn exception during entry filtering or routing can interrupt Shared and Key_Shared dispatch without scheduling another read. Entries still owned by the dispatcher may remain unreleased, and pending-byte accounting may remain unsettled. A send task rejected before handoff can also leave consumer accounting and dispatcher-owned buffers outstanding. Recovery needs to distinguish entries already transferred to consumers from entries that still require replay, and remove a consumer whose send task was rejected before dispatch resumes. This addresses the dispatcher recovery deferred by that change. Modifications
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
codelipenghui
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The dispatcher-level, ownership-aware recovery approach is sound, but two failure paths need to be addressed:
Reviewed head:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Preserve chunk-routing ownership before replaying a failed suffix For a Shared message split across reads, chunk 0 can already be handed off when The eager mapping removal predates this PR; the new problem is replaying the orphaned suffix without restoring routing state. Please retain or restore the UUID owner on failure and commit its removal only after successful final-chunk handoff. Add a regression test that splits chunks across reads and throws once on the final chunk; the added chunk-filter cases currently throw only on chunk 0.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, you're right. Fixed in 7b2c70e by restoring UUID ownership for dispatcher-owned chunks before replaying a failed dispatch. Added a regression with one-entry reads and a filter that throws once on the final chunk. It verifies delivery of the chunked message and subsequent messages without replaying the prefix. The test fails before the fix and passes in both dispatch thread modes.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Make deferred failed-send cleanup idempotent with ordinary removal After a rejected send queues this task, Usage can become zero while another consumer remains connected, undermining the connected-client guard used by topic deletion. Please make actual removal idempotent, or atomically check exact-instance membership under the subscription lock while preserving subscription→dispatcher lock order. A deterministic regression should hold the queued cleanup, remove the consumer normally, then release cleanup and assert that usage/statistics change only once.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed and fixed in 7b2c70e. PersistentSubscription.removeConsumer now checks exact-instance membership under the subscription lock, preventing repeated removal from decrementing usage or accumulating statistics twice. The regression forces ordinary removal to finish before deferred cleanup, then verifies usage, message/byte counters, and continued delivery. It fails before the fix and passes in both dispatch thread modes.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMerge master at 95e04f0. Preserve instance-based consumer removal and chunk assignment cleanup. Allow late STICKY selector cleanup while accounting for consumer removal only once.
Denovo1998
marked this pull request as draft
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
codelipenghui
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both previously reported issues are addressed at
Validated 27 focused test cases with retries disabled: all passed, with zero failures, errors, or skips. Coverage includes filter recovery, the ordinary-removal/deferred-cleanup race, rejected sends, both dispatch-thread modes, and late STICKY cleanup. No actionable findings identified within the reviewed scope. This follow-up focused on the fixes and relevant merge interactions; unpatched-baseline reproduction and performance A/B were not run.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
lhotari
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for following up on #26824 and taking on the recovery work. The ownership tracking is careful, and the test coverage for rejected sends is thorough. My main concern is the recovery policy rather than the bookkeeping. Every dispatch failure gates reads for the whole subscription behind the read-failure backoff (15 s initial, 60 s max by default). The failed batch goes back to replay, and replay wins over normal reads. So a deterministically failing entry now stops all delivery on the subscription until someone skips it, and it does so silently, because the failure is logged only at DEBUG. Before this change the bad batch leaked but later reads continued. Isolating the failing position after a few attempts, plus a rate-limited WARN, would make this much safer to operate. Other points inline:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [BUG] A deterministically failing entry now stalls the whole subscription This gate blocks every read on the subscription while a retry is pending, and the retry uses the read-failure backoff ( Two consequences:
Could the failing position be isolated instead? For example, track attempts per position and, after N failures, skip it or dispatch it alone so the rest of the batch can progress. A dispatcher-specific, shorter backoff would also help. If the stall is intended, please document the operator action.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] Dispatch failures are logged only at DEBUG, and Errors are retried silently
Combined with the retry loop above, a permanently failing filter or routing plugin now produces an endless replay/backoff cycle with no WARN or ERROR line. The only symptom is a growing backlog. A plugin Suggestion: log at WARN, rate-limited per dispatcher, with the position and the cause. Also rethrow
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] A normal read already in flight bypasses the retry backoff and resets it
That contradicts the comment at Should this also check
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [BUG] Other synchronous send failures still strand later consumers' batches When
Those entries are not released. They are not in any This behaviour existed before this PR, but the new ownership tracking makes it fixable. Skip the failing consumer's slice, pass the rest through
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] Extra per-dispatch work on the hot path The maintainer asked for performance validation, so here are the per-dispatch costs this change adds:
An A/B run against master would show whether these matter.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] Interceptor callbacks and filter metrics repeat for the accepted prefix on every retry For every accepted entry,
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] This test can pass without ever observing a failed retry The assertions cover the first failure, the replay count, and the gating of
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] The new abort branches have no direct tests None of the tests reaches these paths:
The
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] Raw entries here can get a different replay hash in the entry-bucket dispatcher Minor: this path passes the raw (unwrapped) entries to
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [QUALITY] Repeated cleanup now logs an ERROR for an expected race Nit:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |