-
Notifications
You must be signed in to change notification settings - Fork 6
fix(code-index): hold the head-open claim across the clone successor copy #1863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2769,11 +2769,36 @@ impl LatestCodeTextGenerationV1 { | |
| self.install_artifact_owners(reader, reader_reservation)?; | ||
| self.publish_text_progress_snapshot(ready_progress); | ||
| if needs_clone_successor { | ||
| self.text_projection_build.retain_clone_successor_retry()?; | ||
| return self | ||
| .begin_clone_successor(descriptor, prior, sealed_identity, source, control) | ||
| .map(TextHeadOpenOutcomeV1::BuildCloneSuccessor) | ||
| .map(Some); | ||
| // `begin_clone_successor` copies the whole prior lexical | ||
| // artifact with the slot lock released, so this wake's | ||
| // head-open claim has to span it. Parking | ||
| // `CloneSuccessorPending` before the copy published a | ||
| // takeable state mid-claim: `advance_artifact_text_serving` | ||
| // leaves its park loop on that state, so a concurrent wake | ||
| // took a second `HeadOpening` on top of this open and both | ||
| // drove the same staging database. Whichever open resolved | ||
| // second then found the slot already reset and failed the | ||
| // clone lane closed. A successful begin resolves the claim | ||
| // to `BuildingCloneSuccessor` anyway, so only a failed one | ||
| // needs the retry marker: the owners installed above would | ||
| // otherwise let the next wake short-circuit on a plain | ||
| // `Idle` and never owe the successor again. | ||
| return match self.begin_clone_successor( | ||
| descriptor, | ||
| prior, | ||
| sealed_identity, | ||
| source, | ||
| control, | ||
| ) { | ||
| Ok(build) => Ok(Some(TextHeadOpenOutcomeV1::BuildCloneSuccessor(build))), | ||
| Err(error) => { | ||
| // The claim still owns `HeadOpening`, so this only | ||
| // parks the marker; the begin failure is the one | ||
| // worth reporting. | ||
| let _ = self.text_projection_build.retain_clone_successor_retry(); | ||
|
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.
If AGENTS.md reference: AGENTS.md:L152-L154 Useful? React with 👍 / 👎. |
||
| Err(error) | ||
| } | ||
| }; | ||
| } | ||
| drop(source); | ||
| Ok(Some(TextHeadOpenOutcomeV1::Served)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When opening a published artifact without clone fingerprints, the owners are already ready while this corpus-sized copy runs under
HeadOpening.clone_successor_progress()classifiesHeadOpeningasIdle, so concurrent dashboard/MCP freshness reads report the missing successor asPartialrather thanBackfillingfor the duration of the copy; the existing status test confirms that an idle missing successor maps toPartial. Keep the state untakeable while still identifying this as clone backfill, or teach the progress reader to distinguish this clone-opening claim.AGENTS.md reference: AGENTS.md:L9-L12
Useful? React with 👍 / 👎.