fix row key not in standard format (#7901) #7908
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #7901
What problem does this PR solve?
Issue Number: close #3099 close #7762
Problem Summary: For int handle, the standard row key format should be t{tidb_id}_r{row_id}, but the cluster may generate keys not strictly adhere to this format. For example, it may append a
0x00
to the encoded value.When tiflash decode the key, it will ignore the suffix
0x00
and may get an invalid row key value.What is changed and how it works?
For row key which size is larger than the standard format, we add 1 on the decoded int key value.
This is ok, because
Note if the decoded int value is
Int64::max_value
, it is a value generated by tiflash itself which is RowKeyValue::INT_HANDLE_MAX_KEY. This is a special key to means +inf, so we can just ignore it.Check List
Tests
Side effects
Documentation
Release note