fix(checkpoint): preserve newer same-ref queue updates - #2550
Open
Vishal202-rgb wants to merge 1 commit into
Open
Vishal202-rgb wants to merge 1 commit into
Vishal202-rgb wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Concurrent drains can still delete a newer same-reference queue entry; documentation issues also remain.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (3)
What changed in this PR
Updates checkpoint push-queue handling to preserve newer same-reference entries during in-flight pushes.
Changes:
- Separates raw queue parsing from de-duplicated reads.
- Removes drained queue occurrences.
- Adds same-reference enqueue regression coverage.
| File | Summary |
|---|---|
cmd/entire/cli/checkpoint/pushqueue.go |
Queue handling changes; concurrent drains can still remove newer entries. Documentation nits remain. |
cmd/entire/cli/checkpoint/pushqueue_test.go |
Adds regression coverage for newer same-reference entries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+179
to
+180
| if count := remaining[key]; count > 0 { | ||
| remaining[key] = count - 1 |
| // de-duplicated set and is worth compacting: rawLines > len(refs) exactly when | ||
| // there were redundant lines. | ||
| func (q *PushQueue) readLocked(root *os.Root) (refs []plumbing.ReferenceName, rawLines int, err error) { | ||
| func (q *PushQueue) readAllLocked(root *os.Root) (refs []plumbing.ReferenceName, rawLines int, err error) { |
|
|
||
| // readLocked parses the queue file into de-duplicated refs, preserving first-seen | ||
| // order. The caller must hold the lock. Malformed lines are skipped rather than | ||
| // failing the whole drain ? a single bad record must not strand every queued ref. |
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.


Summary
Fixes #2008.
readLockedde-duplication behavior forDrainandPeek.Testing
git diff --checkTestPushQueue_RemovePreservesNewerSameRefEntryNote: The Go test suite was not run locally because Go is not installed in the environment.