Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Fix the issue that rawkv restore's end key is incorrectly inclusive when restoring partial of backed up data (#201) #726

Merged
merged 2 commits into from
Jan 28, 2021

Conversation

MyonKeminta
Copy link
Contributor

cherry-picks #201 to release-4.0


What problem does this PR solve?

This PR fixes the issue that rawkv restore's end key is incorrectly inclusive when restoring partial of backed up data. See tikv/tikv#7163

What is changed and how it works?

This PR adds is_raw_kv field to DownloadRequest and adds end_key_exclusive field to SstMeta. For SST files that contains the restoring end key in its range, it will cut the file's end key to the restoring endKey, and set end_key_exclusive.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported variable/fields change
  • Added is_raw_kv to kvproto DownlaodRequest
  • Added end_key_exclusive to kvproto SstMeta

Side effects

-

Related changes

  • Need to cherry-pick to the release branch
  • release-3.1 and release-4.0

Release note

  • Fix the issue that in rawkv mode, the end key of restoring range may be included, which is expected to be exclusive.

…hen restoring partial of backed up data (pingcap#201)

* Fix raw restoe range endKey

* Add tests

* Address comments

Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: 3pointer <luancheng@pingcap.com>
@CLAassistant
Copy link

CLAassistant commented Jan 27, 2021

CLA assistant check
All committers have signed the CLA.

@MyonKeminta MyonKeminta added this to the v4.0.11 milestone Jan 27, 2021
Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 LGTM1 label Jan 28, 2021
@MyonKeminta
Copy link
Contributor Author

/run-integration-test

@MyonKeminta
Copy link
Contributor Author

@3pointer PTAL. Can this be merged in 4.0.11?

@kennytm
Copy link
Collaborator

kennytm commented Jan 28, 2021

/lgtm

@ti-srebot ti-srebot removed the status/LGT1 LGTM1 label Jan 28, 2021
@ti-srebot ti-srebot added the status/LGT2 LGTM2 label Jan 28, 2021
@kennytm kennytm merged commit 1ea8346 into pingcap:release-4.0 Jan 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants