Repository navigation
Retire completed data moves from the relocation queue - #14727
tclinkenbeard-oai wants to merge 1 commit into
Conversation
Result of foundationdb-pr-macos-m1 on macOS
|
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr-macos on macOS
|
Result of foundationdb-pr on Linux RHEL 9
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr-clang-arm on Linux RHEL 9
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
tclinkenbeard-oai
left a comment
There was a problem hiding this comment.
Generated by Codex.
What problem is this PR trying to solve? (ELI10)
FoundationDB keeps a list of jobs that are moving pieces of data. Finishing a job should take it off the list. The old check looked at what the list would contain after inserting an empty job. Its ID was zero, so it failed to recognize the finished job. For example, a completed move of [b,d) could still block cleanup of an older move of [a,e) because the queue saw the smaller job as active. Old completion check, default preview value, preview construction
How does this PR solve the problem? (ELI10 and review walkthrough)
The queue looks up the job it actually recorded. Once the smaller job finishes, the larger cleanup can proceed.
- The relocator records the move ID against its range. It calls the new helper after the last destination transfer succeeds, including the second transfer when required. Register the move, final success
dequeueDataMoveOnSuccessfinds the entry covering the first key and checks both boundaries, the ID, and the absence of an outstanding cancellation. It clears the entry without suspending between the check and update. Match and retire- A later cancellation scans for live overlaps. It can schedule cleanup when the finished entry is gone. A replacement or a cancellation in progress still protects its range. Schedule cancellation
What is it trying to do?
Retire an encoded move from the distributor’s in-memory queue exactly when the move still owns the completed range.
Is it correct?
Yes. The new lookup inspects the stored identity and avoids allocating the preview vector. The caller owns the key bytes across the map update. The durable move protocol finishes before this bookkeeping. The PR reports a paired simulation in which the parent cancellation succeeds after the same child completion that previously blocked it, on a tree with the related workload changes.
I reviewed the code without running builds, tests or simulations. All 10 currently listed public checks passed on a45d44a8. Checks at this commit
Are there bugs?
I found no correctness defect. The cancellation future remains attached to its entry until its own cleanup path resets it. Cleanup ownership
Are there omissions?
The regression covers exact success, changed identity, changed boundary, and an active cancellation. The reported combined-tree simulation covers the downstream consequence that the local unit test cannot exercise. Regression
Are there better ways of doing things?
The single lookup and synchronous guard directly express the ownership rule.
Should this CL be LGTMd?
Yes, LGTM. I checked registration, completion, and overlapping cleanup. The main risk is deleting an entry that a newer relocation owns, which the range, ID, and cancellation checks guard against.
The relocation queue checks whether it still owns a completed move by calling
getAffectedRangesAfterInsertion. The preview fills the requested range with a default value whose move ID is zero. The ownership check fails for a live ID, leaving the completed move in the queue. A later cancellation for a covering range can then reportDDEnqueueCancelledDataMoveConflictand skip cleanup.Look up the stored entry at the start of the range. Retire it when the full range and move ID still match and no cancellation is in progress. The regression checks successful retirement and preserves entries with a different ID, a different boundary, or a pending cancellation.
Validation
ShardEncodeForwardConfigseed1154847711, both runs finished the same child move at simulated second229.665. At253.269the original queue rejected the parent cancellation. The patched queue accepted it, committed cleanup at253.627, and passed all three phases. Both runs included the workload behavior that Honor the database shard metadata format in RandomMoveKeys #14726 addresses.