Repository navigation
Fix dir entry cleanup after a failed aggregation write - #13847
Open
masaori335 wants to merge 1 commit into
Open
masaori335 wants to merge 1 commit into
masaori335 wants to merge 1 commit into
Conversation
The aggWriteDone() error branch set the stripe-relative block offset of each entry to delete from a raw byte position, so remove() never matched and the failed docs' entries outlived the write. It also looked up only the doc's key, which misses head entries registered under first_key.
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open findings
This test relies on randomly generatedCacheKeys, which makes it non-deterministic and can… · New This test relies on randomly generatedCacheKeys, which makes it non-deterministic and can… · New Optional: ifdoc->first_keycan be the same asdoc->keyfor non-head docs, this will perform… · New The comment says the writer inserts the entry, but the test is explicitly inserting the entries… · New
🧠 Review effort: Lite
Comment on lines
+46
to
+47
| rand_CacheKey(&vc.key); | ||
| vc.set_test_data("yay", 4); |
| init_writer(vc, stripe); | ||
| vc.f.use_first_key = 1; | ||
| vc.earliest_key = vc.key; | ||
| rand_CacheKey(&vc.first_key); |
| dir_set_offset(&del_dir, this->offset_to_vol_offset(directory.header->write_pos + done)); | ||
| // A head's entry is under first_key rather than the doc's key, and the doc doesn't say which it is, so try both. | ||
| this->directory.remove(&doc->key, this, &del_dir); | ||
| this->directory.remove(&doc->first_key, this, &del_dir); |
| REQUIRE(!stripe->is_io_in_progress()); | ||
| REQUIRE(stripe->get_agg_buf_pos() == agg_len); | ||
|
|
||
| // A writer inserts its entry as soon as its doc is in the buffer, before the disk write completes. |
Copilot stopped reviewing on behalf of
brbzull0 due to an error
October 16, 2026 09:58
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.


Address an issue found at #13840 review.
The aggWriteDone() error branch set the stripe-relative block offset of each entry to delete from a raw byte position, so remove() never matched and the failed docs' entries outlived the write. It also looked up only the doc's key, which misses head entries registered under first_key.