Skip to content

fix bug about comparing key in ob_compaction_test #546

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

Merged
merged 1 commit into from
Apr 27, 2025

Conversation

Muqi1029
Copy link
Contributor

Problem:

In MiniOB, a key consists of an internal key followed by a seq component. When checking for overlapping keys in a sorted run, we should sort and compare based on the internal key only. This is typically done by using the internal key as the sorting index and then comparing the last key of the previous SSTable with the first key of the current one.

However, if the full key (including seq) is used as the sorting index, the seq component will incorrectly influence the result of the overlap check, potentially leading to false negatives or positives.

What is changed and how it works?

This PR replaces direct string comparison with the obInternalKeyComparator to sort and compare keys correctly, ensuring that only the internal key is considered during overlap checks.

Other information

@CLAassistant
Copy link

CLAassistant commented Apr 25, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@nautaa nautaa left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for your contribution!

@nautaa
Copy link
Member

nautaa commented Apr 25, 2025

@Muqi1029 please check the cla at the above.

@Muqi1029
Copy link
Contributor Author

@Muqi1029 please check the cla at the above.

Yes, I've signed it. Thanks for your remind.

@nautaa nautaa merged commit f9e3e2e into oceanbase:main Apr 27, 2025
14 checks passed
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 this pull request may close these issues.

3 participants