Skip to content

[NEW] Save RDB dumps and AOF files in older version formats #3032

@zuiderkwast

Description

@zuiderkwast

The problem/use-case that the feature addresses

  • After upgrading a system and some problem is detected by the user, provide a way to go back to the version used before the upgrade by allowing the older version to load data files produced by the newer version, thus providing rollback capability when using either RDB files, AOF files or disk-based replication.

Description of the feature

  • Add a new config to allow specifying the RDB version to store RDB files in. Suggested name of the config: rdb-version, valid values: 0 (default), 9, 10, 11, 80.
  • Alternatively, make the config specify the Valkey version to be data file compatible with rather than the RDB version.
  • We can allow specifying RDB 9 and 10, with only little information loss regarding related to stream consumer group lag information, which was added in RDB 10 and 11.
  • If the user is using new features that can't be stored in the older RDB format, saving will fail and a warning will be logged.
  • The recommendation is to use this config only during an upgrade, including just after an upgrade, until the system is verified to work correctly and rolling back is no longer an option. After this, the user should clear the config so that RDB files are written in the latest RDB version.

Alternatives you've considered

  • Respect REPLCONF VERSION in diskless full sync #2735 implements diskless replication to an older version replica, which can be used for rolling back an upgrade when diskbased replication is used. It works by negotiating the version with the replica. This doesn't work when upgrades are done by dumping data to disk and reloading it after the upgrade (or downgrade).
  • Relaxed RDB check for foreign RDB formats #2543 implements best-effort loading of unknown future RDB files. This may work if only the RDB version is bumped but everyting else in the file is understood by the target server. If a new encoding is introduced in the RDB file, this approach doesn't work. This feature exists in Valkey 8.1 and later, so it doesn't work when upgrading from 8.0 and below.

Additional information

This issue was opened as requested in this comment: #2735 (comment)

Related work:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions