Repository navigation
Add WriteLockedGraph::lock_new_segments (pometry-storage#427) - #2859
Merged
Merged
Conversation
A held WriteLockedGraph can now extend its guards to node and edge segments created since it was taken, instead of dropping and re-taking every segment lock. The edge and edge-metadata loaders and resize_segments_to_vid/eid use it. Prefactor for holding one WriteLockedGraph for the whole bulk load (Pometry/pometry-storage#423). Fixes Pometry/pometry-storage#427 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: 2cd733d | Previous: b81cffb | Ratio |
|---|---|---|---|
lotr_graph/num_edges_temporal |
317 ns/iter (± 1) |
158 ns/iter (± 1) |
2.01 |
lotr_graph_subgraph_10pc/num_nodes |
13 ns/iter (± 1) |
4 ns/iter (± 0) |
3.25 |
lotr_graph_subgraph_10pc/num_nodes_cached |
14 ns/iter (± 0) |
5 ns/iter (± 0) |
2.80 |
This comment was automatically generated by workflow using github-action-benchmark.
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.
Part of Pometry/pometry-storage#423. Closes Pometry/pometry-storage#427.
Summary
A held
WriteLockedGraphcan now extend its locks to segments created after it was taken, instead of being dropped and re-taken. This is a prefactor for holding oneWriteLockedGraphfor a whole bulk load (Pometry/pometry-storage#424). Loading behaves the same as before.WriteLockedNodePages::push/WriteLockedEdgePages::pushassert that pages stay indexed by segment id.resize_segments_to_vid/eid=grow+lock_new_segments; they no longer release every page.Evidence
test_load_edges_creating_many_segments_in_one_chunk(200 new edges in one chunk, page length 2) panics withsegment not found while grouping by eid(edges.rs:760).After: passes.
test_lock_new_segments_covers_segments_created_while_locked: aftergrowon nodes and edges while locked, the held pages match the store's segment counts, each page's id matches its index, and a second call does nothing.test_io: 62 passed, 6 ignored.test_lib -- arrow_loader: 18 passed.cargo check --workspace --testsin pometry-storage is clean.Merge Danger
Door: two-way
The new methods are additive; reverting brings back the drop and re-take.
Blast Radius: bulk loads
Only edge and edge-metadata bulk loads, and
resize_segments_to_*, change. Between the node pass and the edge pass they now keep their segment locks instead of briefly releasing them, so readers can't take those segments at that point.🤖 Generated with Claude Code