Skip to content

Fix dir entry cleanup after a failed aggregation write - #13847

Open
masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:asf-master-cache-del-dir
Open

masaori335 wants to merge 1 commit into
apache:masterfrom
masaori335:asf-master-cache-del-dir

Conversation

@masaori335

Copy link
Copy Markdown
Contributor

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.

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.
@masaori335 masaori335 added this to the 11.0.0 milestone Oct 16, 2026
@masaori335 masaori335 self-assigned this Oct 16, 2026
Copilot AI balanced review requested due to automatic review settings October 16, 2026 01:41
@masaori335 masaori335 added the Bug label Oct 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@brbzull0 brbzull0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

🧠 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants