-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[fix][compaction] Rowset::end_version null pointer #9379
Conversation
@@ -136,7 +136,12 @@ Status Compaction::do_compaction_impl(int64_t permits) { | |||
int64_t current_max_version; | |||
{ | |||
std::shared_lock rdlock(_tablet->get_header_lock()); | |||
current_max_version = _tablet->rowset_with_max_version()->end_version(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when will rowset_with_max_version == nullptr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to happen in two cases:
- The tablet has no rowset.
- The version of max version rowset no longer exists in the tablet.
In fact, I did not carefully analyze why it occurs. Because other tablet->rowset_with_max_version()
all compare whether the return value is null, so I also compare here : )
And here current_max_version
is only used to print the log, it will not affect the execution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The tablet should not have rowset because when the table is created BE will add 0-1 rowset to the tablet.
- I think we should be careful with this case... Maybe should deep dive some code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The tablet should not have rowset because when the table is created BE will add 0-1 rowset to the tablet.
- I think we should be careful with this case... Maybe should deep dive some code.
I agree, these two cases are not normal, maybe the tablet was deleted during compaction, or invalid?
At present this is the previous solution, there may be a better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by anyone and no changes requested. |
Proposed changes
Issue Number: close #9371
Problem Summary:
After compaction, get tablet max version rowset returns null.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...