Repository navigation
TR-1192: central lore adopts a repo a Job indexed, without indexing again - #6
Merged
Merged
Conversation
Author
factory/review: CHANGES, head 1e97d7cThe adoption itself is right. Deciding "held" before What I verified (in a worktree at 1e97d7c, local pgvector/pgvector:pg17)
Findings
Not covered
|
…1192 review round 1) A sync that finds the index already at the remote's head used to keep an existing checkout as it was. After a Job indexed a newer commit, the checkout was stale. - The mirror keeps `refs/lore/checkout` at the commit the checkout is at. It is dropped before a rebuild and written only after read-tree and clean succeed, so a missing or different ref means the checkout is rebuilt (F1, F3). - The up-to-date branch also sets `refs/heads/lore-indexed` so the next fetch negotiates instead of downloading all history again (F2). - docs: adoption wording covers the marker and the rebuild (F4). Tests: a_sync_rebuilds_a_checkout_that_a_job_left_behind and a_sync_rebuilds_a_checkout_whose_rebuild_never_finished. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Member
factory/review: pass (round 2) at aa7841cReviewer: ashish-crew-reviewer Round 1 findings
VerifiedClean env through
Mutations:
Probe: A second-model challenger (read-only) agreed F1-F3 are fixed and found no new defect in the delta. Findings (none blocking)
Not verified
|
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.
Ticket: TR-1192 https://linear.app/glassflow/issue/TR-1192/lore-central-service-adopts-a-repo-a-job-indexed-without-indexing (depends on TR-1191, lore#5).
What changed
SyncReportgainsadopted. A sync reportsadopted: truewhen the source was already indexed (bylore index) but this process held no mirror or no checkout for it. It builds both and indexes nothing when the remote head is the indexed commit (up_to_date: true,files_indexed: 0, chunks and vectors untouched). When the remote is ahead it indexes only the changed files (full: false), builds the checkout and also reportsadopted: true. A sync that ends as a full index is a reindex and reportsadopted: false.grep/read_filealready read<data_dir>/repos/<source id>/checkout, which adoption builds. A new test proves it.docs/usage.md(response field, Job-then-central flow),docs/architecture.md.Tests
cli_index::a_sync_adopts_what_a_job_indexed_and_indexes_nothing: Job indexes, central sync on an empty data dir: adopted, 0 files, mirror and checkout present, chunk rows and vectors identical, no newindex_runsrow; the second sync reportsadopted: false.cli_index::a_sync_of_a_remote_ahead_of_the_job_indexes_only_the_diff: modified, added and deleted file; only the diff is indexed, untouched rows unchanged.adopt::a_deep_answer_reads_the_checkout_the_sync_adopted: scripted deep ask greps and reads the adopted checkout (a file added after the Job) and cites it.synctests: first sync and full reindex reportadopted: false; lost data dir, lost checkout and lost mirror with a damaged checkout reportadopted: true.cargo fmt --checkclean;cargo clippy --all-targets -- -D warningsclean;cargo test --all-targets --no-fail-fast: 35 binaries, 694 passed, 0 failed, 4 ignored (fresh pgvector).adoptedforced false;adoptedignoringfull; up-to-date branch skipping the checkout rebuild; rebuild only when the checkout is missing; incremental path indexing the whole tree;index_commitskipping the checkout.Notes
adoptedalso fires for a partial data-volume loss (only mirror or only checkout missing); the checkout is rebuilt either way.lore-indexedref; nothing reads it there.