Skip to content

[fix][broker] Advance snapshot segment boundary for orphaned tails - #27674

Merged
nodece merged 1 commit into
apache:masterfrom
nodece:fix-bucket-snapshot-segment-loading
Nov 20, 2026
Merged

nodece merged 1 commit into
apache:masterfrom
nodece:fix-bucket-snapshot-segment-loading

Conversation

@nodece

@nodece nodece commented Nov 20, 2026

Copy link
Copy Markdown
Member

Motivation

getScheduledMessages() dropped orphaned entries before the snapshot-segment boundary and cutoff checks. A segment whose tail entry lived below the first live ledger never advanced its boundary, so the next snapshot segment was never loaded and delayed messages stalled.

Modifications

  • Move the cutoff check before the orphan check.
  • Process the snapshot-segment boundary transition for orphaned tails when the bucket still spans the first live ledger.
  • Keep suppressing delivery of the orphaned entry.

Verifying this change

  • Make sure that the change passes the CI checks.

Added tests:

  • testLoadsNextSnapshotSegmentAfterCutoff
  • testDoesNotLoadNextSnapshotSegmentBeforeCutoff

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

Check the boxes that apply

  • 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

getScheduledMessages() dropped orphaned entries before the cutoff and segment-boundary checks, so a segment whose tail entry lived below the first live ledger never advanced its boundary and the next snapshot segment was never loaded. Process the boundary transition for orphaned tails when the bucket still spans the first live ledger, while still suppressing delivery of the orphaned entry. Cutoff gating is kept.

Adds testLoadsNextSnapshotSegmentAfterCutoff and testDoesNotLoadNextSnapshotSegmentBeforeCutoff.

Assisted-by: Claude Code
@nodece
nodece merged commit bab9eb3 into apache:master Nov 20, 2026
44 checks passed
@nodece
nodece deleted the fix-bucket-snapshot-segment-loading branch November 20, 2026 07:03
lhotari pushed a commit that referenced this pull request Nov 20, 2026
ascentstream-bot pushed a commit to ascentstream/pulsar that referenced this pull request Nov 24, 2026
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants