This repository was archived by the owner on Jul 24, 2024. It is now read-only.
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Add a flag to control whether to backup/restore SEQUENCEs #305
Open
Description
Feature Request
Describe your feature request related problem:
After #242, we will unconditionally backup and restore sequences. However, sequence support is still considered somewhat buggy, so we'd like to add a switch to control whether to backup and/or restore sequences.
Problems involving sequence backup & restore:
- The backed up sequence skips all cached values. For example, even if a TiDB server only used up to ID = 10, it may have already allocated up to ID = 1000 in its cache, so the backed up sequence will have ID = 1001. The 900 numbers are wasted. Note that the same behavior will manifest if we use multiple TiDB servers.
- The backed up sequence value does not respect snapshot, so the backed up value may be even higher.
- Cycles are not yet properly supported.
Note that sequences will never "decrease", so there is no risk over-valuating a sequence other than wasting numbers.
Describe the feature you'd like:
- Add a switch to disable sequence backup (???)
- Add a switch to disable sequence restore
If a sequence is not restored, tables depending on that sequence will still be successfully restored, but INSERT operations will fail. This is expected behavior.