Repository navigation
Conversation
nodece
force-pushed
the
refactor-bucket-tracker-structure
branch
2 times, most recently
from
November 25, 2026 07:42
d9da9f3 to
3989a9a
Compare
…ucket bookkeeping Rebased onto the progressive-delivery base. The tracker carried five ad-hoc fields for asynchronous work and segment progress encoded as bare currentSegmentEntryId conventions; consolidate the state and name it: - PendingSnapshotDeletes: the snapshot deletions not done yet — in flight (guarded per bucket, so deletes never stack) or failed and waiting for a retry, so a snapshot is never abandoned silently. Replaces pendingDrainedDeletes, pendingDeletes and uncleanedBuckets. - segmentLoadsSettled() / awaitSegmentLoadsSettled(): the armed segment loads read by intent instead of a raw future set with pruning at the call sites. - ImmutableBucket.hasUnloadedSegments() / allSegmentsLoaded(): the segment-load state reads by intent instead of raw id comparisons. - recoverBucketSnapshot0 decomposed into registerRecoveredBuckets, collectObsoleteRecoveredBuckets and restoreRecoveredBuckets. clear() now reads as "wait for trim/merge → wait for loads and deletes → reset". No behavior change: the delayed delivery suites (incl. the e2e bucket test) pass without a single test modification. Assisted-by: Claude Code
nodece
force-pushed
the
refactor-bucket-tracker-structure
branch
from
November 25, 2026 10:42
3989a9a to
d1a93bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #42 (lazy segment loading). Pure structure, no behavior change: the delayed delivery suites (incl. the e2e
BucketDelayedDeliveryTest) pass without a single test modification, and the JMH sanity numbers are unchanged.What it does
The lazy-loading change left the tracker with five ad-hoc fields for asynchronous work (
pendingLoads,pendingDrainedDeletes,pendingDeletes,uncleanedBuckets,trimFuture) and segment progress encoded as barecurrentSegmentEntryIdconventions. This PR extracts two cohesive, named collaborators and names the state:SegmentLoadGate— the delivery gate for armed segment loads:arm/allSettled/awaitAllSettled. A dispatch round arms the loads of every due segment and delivers nothing until the batch settles, keeping a round's positions ordered.SnapshotDeletionTracker— bookkeeping of asynchronous snapshot deletions: in-flight guard per bucket (no stacked deletes), failure retry set (a snapshot is never abandoned silently), andawaitAllSettledforclear().ImmutableBucket.hasUnloadedSegments()/allSegmentsLoaded()— the segment-load state reads by intent instead of raw id comparisons.recoverBucketSnapshot0decomposed intoregisterRecoveredBuckets/collectObsoleteRecoveredBuckets/restoreRecoveredBuckets; recovery is not extracted into a class because it shares too much tracker state — a class split would just trade nesting for callbacks.clear()now reads as "wait for trim/merge → wait for loads and deletes → reset" instead of assembling pending collections inline.Testing
./gradlew :pulsar-broker:test --tests "org.apache.pulsar.broker.delayed.*" --tests "org.apache.pulsar.broker.service.persistent.BucketDelayedDeliveryTest"— green, zero test modificationsAssisted-by: Claude Code