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

I think start is userkey here! #317

Open
zgcbj opened this issue Sep 28, 2022 · 1 comment
Open

I think start is userkey here! #317

zgcbj opened this issue Sep 28, 2022 · 1 comment

Comments

@zgcbj
Copy link

zgcbj commented Sep 28, 2022

(start == nullptr) ? GetSmallestUserKey() : ExtractUserKey(*start);

ExtractUserKey(*start) will assert false!

same to ExtractUserKey(*end)

Am I right?

@tabokie
Copy link
Member

tabokie commented Sep 28, 2022

Nice catch! Our unit tests didn't catch it because it will only be non-null when sub-compaction is involved.

The start is set here:

if (c->ShouldFormSubcompactions()) {
{
StopWatch sw(db_options_.clock, stats_, SUBCOMPACTION_SETUP_TIME);
GenSubcompactionBoundaries();
}
assert(sizes_.size() == boundaries_.size() + 1);
for (size_t i = 0; i <= boundaries_.size(); i++) {
Slice* start = i == 0 ? nullptr : &boundaries_[i - 1];

And the boundaries_ is set here:

boundaries_.emplace_back(ExtractUserKey(ranges[i].range.limit));

You're welcome to send us a fix~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants