Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create upgrade mechanism to fix-up underling data #1359

Open
altmannmarcelo opened this issue Aug 26, 2024 · 0 comments
Open

Create upgrade mechanism to fix-up underling data #1359

altmannmarcelo opened this issue Aug 26, 2024 · 0 comments
Labels
Medium priority Created by Linear-GitHub Sync
Milestone

Comments

@altmannmarcelo
Copy link
Contributor

Description

Sometimes we will find and fix issues that will fix how we store data. One example is the recent issue with DATE field, where we were missing to set the date_only bit on TimestampTZ type.

Customer that have already snapshotted (let's say TB+ of data) should not require to re-snapshot and we should be able have a sort of upgrade script that knows what has to be fixed depending on the current data, version.

I think we have something like the serde version that we store, but that might not be the exact field/version we want as we are not necessary changing how we store data internally.

We might want to add a new metadata field, such as Data-dictionary version and bump this version every-time we do a change that requires upgrade of stored data. With this information we should be able to figure out which change we need to apply.

Example:

enum DdVersion {
    Version0 = 0, // Initial version
    Version1, // Fixed the issue with missing date_only in TimestampTz
    Version2, // Fixed something else
}

let dd_version = DdVersion::Version2;

Once we start Readyset we can check the stored DdVersion in the metadata rocksdb and compare with dd_version of the running binary. Here we can choose to run the necessary upgrades (which will be defined on a case by cases basis) or ask the user to explicitly run readyset with --upgrade flag.

Change in user-visible behavior

Requires documentation change

@readysettech readysettech deleted a comment Aug 26, 2024
@readysettech readysettech deleted a comment Aug 26, 2024
@altmannmarcelo altmannmarcelo added this to the v.40 milestone Aug 29, 2024
@altmannmarcelo altmannmarcelo added the Medium priority Created by Linear-GitHub Sync label Aug 29, 2024
@altmannmarcelo altmannmarcelo modified the milestones: v.40, v.41, v.42 Sep 2, 2024
@altmannmarcelo altmannmarcelo modified the milestones: v.42, v.43 Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium priority Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

1 participant