Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
[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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #72690 +/- ##
================================================
+ Coverage 72.1875% 73.5907% +1.4031%
================================================
Files 2173 2221 +48
Lines 602622 614186 +11564
================================================
+ Hits 435018 451984 +16966
+ Misses 167602 162197 -5405
- Partials 2 5 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
FLASHBACK CLUSTER restores the table metadata to an earlier point but does not restore the affinity groups in PD. If tables gained, lost or changed affinity groups in between, for example through CREATE TABLE, DROP TABLE, TRUNCATE or ALTER TABLE ... AFFINITY, the groups in PD no longer match the restored metadata after the flashback. Before the flashback, TiDB now derives the affinity group IDs expected by all tables at the flashback point and now, and rejects the flashback if the two sets differ. It compares the net state of the two points rather than the DDL history in between, so DDL that does not change the groups, such as ADD COLUMN on an affinity table, does not block it, and a group created and deleted again in between does not either. Reading the metadata at the flashback point failing also rejects the flashback. Fixes pingcap#72058 Signed-off-by: JmPotato <github@ipotato.me>
39993d3 to
193a45e
Compare
What problem does this PR solve?
Issue Number: close #72058
Problem Summary:
FLASHBACK CLUSTER restores the table metadata to an earlier point but does not restore the affinity groups in PD. If tables gained, lost or changed affinity groups in between, for example through
CREATE TABLE,DROP TABLE,TRUNCATEorALTER TABLE ... AFFINITY, the groups in PD no longer match the restored metadata after the flashback.What changed and how does it work?
Detected affinity changes of table <table> during [<ts>, now), can't do flashback.ADD COLUMNon an affinity table, does not block it, and neither does a group created and deleted again in between.Boundaries:
Check List
Tests
Manual test on a local cluster with TiKV v8.5.8 and PD master, running a
tidb-serverbuilt from this PR:CREATE TABLE c2a ... AFFINITYafter ts1, thenFLASHBACK CLUSTER TO TIMESTAMPts1 is rejected withDetected affinity changes of table rec.c2a during [...], can't do flashback.ALTER TABLE tp2 TRUNCATE PARTITION p0on a partition-level affinity table after ts2, then flashback to ts2 is rejected forrec.tp2.ALTER TABLE t1 ADD COLUMN b INTon an affinity table after ts3, then flashback to ts3 succeeds; columnbis gone, the table keepsAFFINITY, and the groups in PD match the tables.Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit