Skip to content

Fix range delete file caused MultiScan issue#14028

Closed
xingbowang wants to merge 2 commits intofacebook:mainfrom
xingbowang:2025_10_06_udi
Closed

Fix range delete file caused MultiScan issue#14028
xingbowang wants to merge 2 commits intofacebook:mainfrom
xingbowang:2025_10_06_udi

Conversation

@xingbowang
Copy link
Contributor

Summary:

When there is an ingested SST file that only contains delete range operations, MultiScan may return error "Scan does not intersect with file". This is due to file selection during Prepare uses the file smallest and largest key without considering whether there is any key in the file. This is only a temporary fix.

Test Plan:

Unit test

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:

When there is an ingested SST file that only contains delete range
operations, MultiScan may return error "Scan does not intersect with
file". This is due to file selection during Prepare uses the file
smallest and largest key without considering whether there is any key in
the file. This is only a temporary fix.

Test Plan:

Unit test

Reviewers:

Subscribers:

Tasks:

Tags:
@meta-cla meta-cla bot added the CLA Signed label Oct 6, 2025
@xingbowang xingbowang requested a review from anand1976 October 6, 2025 17:30
@meta-codesync
Copy link

meta-codesync bot commented Oct 6, 2025

@xingbowang has imported this pull request. If you are a Meta employee, you can view this in D83986964.

continue;
}
auto const metadata = flevel_->files[i].file_metadata;
if (metadata->num_entries == metadata->num_range_deletions) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check may have to be done in SetFileIterator() as well. I'm not sure how the test is passing though. Since scan_opts_ is non-null, SetFileIterator would have called Prepare anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. It is called. But SetRequireFileOverlap is not called, so RequireFileOverlap is false. This is why the error is not returned.

TEST_P(UserDefinedIndexTest, RangeDelete) {
BlockBasedTableOptions table_options;
options_.num_levels = 50;
options_.compaction_style = kCompactionStyleUniversal;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you set options_.disable_auto_compactions? Without it, the delete range file may just get compacted away

Copy link
Contributor

@anand1976 anand1976 left a comment

Choose a reason for hiding this comment

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

LGTM

@facebook-github-bot
Copy link
Contributor

@xingbowang merged this pull request in 27625f4.

xingbowang pushed a commit to xingbowang/rocksdb that referenced this pull request Oct 6, 2025
Summary:
When there is an ingested SST file that only contains delete range operations, MultiScan may return error "Scan does not intersect with file". This is due to file selection during Prepare uses the file smallest and largest key without considering whether there is any key in the file. This is only a temporary fix.

Pull Request resolved: facebook#14028

Test Plan: Unit test

Reviewed By: anand1976

Differential Revision: D83986964

Pulled By: xingbowang

fbshipit-source-id: e0961ca854e2062c2457be4324817ba073ae785d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants