Skip to content
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
@kennytm

Description

@kennytm

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:

  1. Add a switch to disable sequence backup (???)
  2. 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.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority/P0Top priority issue. Must have an associated milestonedifficulty/1-easyEasy issuequestionFurther information is requestedtype/feature-requestNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions