Repository navigation
Conversation
Callers lookups miss callers at some commits a `--git` run indexed, and the `call_edges` row count differs between identical `--git` runs. `sync_for_files()` deletes every `call_edges` row of each path in a batch, at every version, before appending the batch's edges. A path has one version per commit that changed it, and parallel inserters write those versions in different batches, within one run or across runs. Each batch therefore deletes the edges of the path's other versions, which callers lookups need at the revisions that hold those versions. Which versions survive depends on batch order, which is why the row count varies. `sync_for_versions()` replaces `sync_for_files()` and deletes only the versions the batch writes, with one `IN` list over the key `concat(caller_file_hash, ':', caller_file)`. The key is exact because a git blob id holds no `:`. A process-global lock now serializes `call_edges` writes, as content upserts already are. Without it, concurrent deletes on one table conflict and retry, and two syncs of one version could both delete before either appends, leaving its rows twice. The backfill runs only on an empty table and appends without deleting. `tests/call_edge_versions.rs` fails on main and passes here. It indexes `c0..c1` and `c1..c2` as two `process_git_range()` calls and checks the callers at each commit. The same-version concurrency unit test fails on every run with the lock removed.
This branch has not been deployed
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.
Callers lookups miss callers at some commits a
--gitrun indexed, and thecall_edgesrow count differs between identical--gitruns.sync_for_files()deletes everycall_edgesrow of each path in a batch, at every version, before appending the batch's edges. A path has one version per commit that changed it, and parallel inserters write those versions in different batches, within one run or across runs. Each batch therefore deletes the edges of the path's other versions, which callers lookups need at the revisions that hold those versions. Which versions survive depends on batch order, which is why the row count varies.sync_for_versions()replacessync_for_files()and deletes only the versions the batch writes, with oneINlist over the keyconcat(caller_file_hash, ':', caller_file). The key is exact because a git blob id holds no:.A process-global lock now serializes
call_edgeswrites, as content upserts already are. Without it, concurrent deletes on one table conflict and retry, and two syncs of one version could both delete before either appends, leaving its rows twice. The backfill runs only on an empty table and appends without deleting.tests/call_edge_versions.rsfails on main and passes here. It indexesc0..c1andc1..c2as twoprocess_git_range()calls and checks the callers at each commit. The same-version concurrency unit test fails on every run with the lock removed.