-
Notifications
You must be signed in to change notification settings - Fork 102
Support backup & restore views and sequences #242
Conversation
9ff4020
to
57232f3
Compare
Codecov Report
@@ Coverage Diff @@
## master #242 +/- ##
==========================================
- Coverage 74.27% 71.94% -2.34%
==========================================
Files 49 48 -1
Lines 5890 5054 -836
==========================================
- Hits 4375 3636 -739
+ Misses 1022 959 -63
+ Partials 493 459 -34
Continue to review full report at Codecov.
|
Sequences actually have 2 associated metadata: the sequence value ( |
To address this problem, the there some way manually now we only just |
I got two questions for this.
|
After discussion with the designers of the sequence function, we conclude that
The TiDB behavior is designed to keep the same pace among all nodes within the same cluster. In any case, both MariaDB and TiDB's |
trigger sequence cycle round
/run-all-tests |
setValFormat := fmt.Sprintf("do setval(%s.%s, %%d);", | ||
utils.EncloseName(table.Db.Name.O), | ||
utils.EncloseName(table.Info.Name.O)) | ||
if table.Info.Sequence.Cycle { |
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
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
manual test success. create sequence seq start 2 minvalue 1 maxvalue 999999 increment 2 cycle;
do setval(seq, 10);
select nextval(seq); before backup we got sequence with even number:
after restore we got sequence with odd number:
|
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
/merge |
/run-all-tests |
cherry pick to release-4.0 failed |
What problem does this PR solve?
Fix #145, and also support backup/restore sequences.
What is changed and how it works?
Thanks to #216, views and sequences can be naturally restored.
The only problems left are
AutoIncID
field, and performssetval()
on restore.Check List
Tests
Code changes
Side effects
Related changes
Need to be included in the release note