Skip to content

refine auto db snapshots #3317

@qrkourier

Description

@qrkourier

Datastore migrations trigger an auto-snapshot, but sometimes unnecessarily, such as when the datastore version is too high because an older Ziti was run with a newer datastore. Controllers in operational scenarios typically restart automatically, so continually creating snapshots and exiting with an error results in a large number of useless snapshots. Can we avoid snapshotting when the datastore version is too high?

In scenarios where the older, rolled-back Ziti requires an older datastore version, we need two pieces of information:

  1. The datastore version contained in each auto-snapshot file,
  2. the max datastore version allowed by each Ziti version, e.g., https://github.com/openziti/ziti/blob/v1.6.9/controller/db/migrations.go#L28

It's probably sufficient to name the auto-snapshot with a convention that includes its datastore version, since the required datastore version for some version of Ziti is relatively easy to find once you know where to look, but replacing:

panic: Unsupported edge datastore version: 40

...with a message that points out the max version would avoid looking it up because the admin can directly reference the required datastore version in the snapshot file to restore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions