Skip to content

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