Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return Aborted when no valid input files are found for a CompactFile call #12633

Closed
wants to merge 2 commits into from

Conversation

jowlyzhang
Copy link
Contributor

Without this check, smallestkey and largestkey can be fed into RangeOverlapWithCompaction function while being empty boundaries. That function is not prepared to handle empty boundaries. If there are concurrent compactions ongoing, we can get some assertions.

Test plan:
added unit test

@facebook-github-bot
Copy link
Contributor

@jowlyzhang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

return Status::Aborted(
"There are no valid input files found for the specified files.");
}
assert(!smallestkey.empty());
Copy link
Member

Choose a reason for hiding this comment

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

I think empty user key is allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't quite get this, in the RangeOverlapWithCompaction function, empty user key can cause assertions in this logic:

ucmp->CompareWithoutTimestamp(smallest_user_key,

So I think it's better to not pass empty boundaries to that function yet. These user key boundaries come from the existing files' boundaries. At this point, they should either represent some file's actual range, or no valid files found and they are empty. So here we want to not check further if range overlap when it's empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I didn't get that you meant Put("","") is allowed. Thanks for catching this!

@@ -1040,6 +1042,13 @@ Status CompactionPicker::SanitizeCompactionInputFilesForAllLevels(
}
}
}

if (!valid_input_files_found) {
Copy link
Member

@cbi42 cbi42 May 9, 2024

Choose a reason for hiding this comment

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

Does checking is_first works here? Or rename is_first to valid_input_files_found for better naming.

@facebook-github-bot
Copy link
Contributor

@jowlyzhang has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@jowlyzhang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@jowlyzhang
Copy link
Contributor Author

Closing since #12628 will take care of this issue.

@jowlyzhang jowlyzhang closed this May 10, 2024
@jowlyzhang jowlyzhang deleted the fix_assertion branch May 10, 2024 20:42
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.

None yet

3 participants