-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Introduce backup data formats for cross-version compatibility. #3575
Conversation
currently backups are storing data in the internal format. If that format changes backups will not work accross version. This PR introduces new formats for both keys and values (posting lists) to solve this problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @martinmr)
protos/pb.proto, line 504 at r1 (raw file):
// A key stored in the format used for writing backups. message BackupKey { bytes byteType = 1;
Make this an enum.
protos/pb.proto, line 510 at r1 (raw file):
string term = 5; uint32 count = 6; bytes byte_prefix = 7;
We shouldn't need this. We just need enough info here to call the keys.go functions to generate the corresponding key.
x/keys.go, line 372 at r1 (raw file):
// FromBackupKey takes a key in the format used for backups and converts it to a ParsedKey. func FromBackupKey(key *pb.BackupKey) (*ParsedKey, error) {
This shouldn't return a ParsedKey. It should just return a key, which uses DataKey, CountKey, etc. functions to generate the right key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @manishrjain)
protos/pb.proto, line 504 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
Make this an enum.
Done.
protos/pb.proto, line 510 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
We shouldn't need this. We just need enough info here to call the keys.go functions to generate the corresponding key.
Done.
x/keys.go, line 372 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
This shouldn't return a ParsedKey. It should just return a key, which uses DataKey, CountKey, etc. functions to generate the right key.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @martinmr)
x/keys.go, line 244 at r2 (raw file):
// IsCountOrCountRev returns whether the key is a count or a count rev key. func (p ParsedKey) IsCountOrCountRev() bool { return p.bytePrefix == DefaultPrefix && (p.byteType == ByteCount ||
Don't repeat logic.
return p.IsCount() || p.IsCountRev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @manishrjain)
x/keys.go, line 244 at r2 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
Don't repeat logic.
return p.IsCount() || p.IsCountRev
Done.
…h-io#3575) Currently backups are storing data in the internal format. If that format changes backups will not work accross version. This PR introduces new formats for both keys and values (posting lists) to solve this problem.
Currently backups are storing data in the internal format. If that
format changes backups will not work accross version. This PR introduces
new formats for both keys and values (posting lists) to solve this
problem.
This change is