import_sstpb: add RestoreRegion RPC for snapshot restore - #1533
Conversation
Signed-off-by: ris <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe import SST protocol adds ChangesRegion Restore
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Merge Risk: ⚪ Minimal · up to This change adds the RestoreRegion RPC and its SST restore request metadata. The generated bindings align with the new contract, and no concrete current-head merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit reads each line, Comment |
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Contribute Code" section in the development guide. |
What changed and how does it work?
Add
ImportSST.RestoreRegionso BR can ask a target Region leader to restore snapshot SSTs through the cloud storage engine. The response reusesIngestResponse; success means the generated files have been applied. Failed or interrupted requests may already have taken effect, so the API does not promise idempotent retries.RestoreRegionRequestcarries the Region context, shared source storage and optional cipher configuration. EachRestoreRegionSourceidentifies a source write/default SST, its size, logical key-prefix/timestamp rewrite rule and optional IV. TiKV derives the crop range from the target Region. Timestamp filtering is unsupported.This is an additive protocol change. Existing RPCs and the backup metadata format are unchanged. Include regenerated Go bindings and the compatibility lock; Rust bindings are generated at build time.
Validation
make proto-fmt-checkprotolock statusagainst both the updated lock and the upstream master lockimport_sstpbusing the repository's generation options;git diff --exit-coderemained cleango test ./pkg/import_sstpb(package compilation; no test files)go build ./pkg/...cargo check --locked -j 8cargo check --locked --no-default-features --features prost-codec -j 8git diff --check origin/master...HEADThe protocol source is byte-for-byte identical to the version used by both BR and TiKV in a prior end-to-end full-snapshot restore test (write/default CFs, secondary index, checksum and three-replica Apply). That test used local dependency overrides on older dependency baselines; integration after updating consumers to this PR revision remains separate work.
C++ generation/build and a new end-to-end consumer run on this rebased revision were not run locally.
Summary by CodeRabbit