-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(bigtable): Hot backups #11215
feat(bigtable): Hot backups #11215
Conversation
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.
overall logic looks good, just have a few suggestions for the implementation
bigtable/admin.go
Outdated
} | ||
|
||
// BackupOption can be used to specify parameters for backup operations. | ||
type BackupOption interface { |
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.
I think my main question here for the option style here is how complex you expect the options to become. I see only a single option with two behavior fields, so struct-based options that satisfy the apply() contract may be more than you need.
By way of comparison, if the contract is simplified to the core backupOptions and some funcs that can modify it:
type BackupOption func(*backupOptions)
func WithHotBackupOption(t time.Time) BackupOption {
return func(bo *backupOptions) {
bo.backupType = blah
bo.hotToStandardTime = blah
}
}
func WithExpiration(t time.Time) BackupOption {
return func(bo *backupOptions) {
bo.expireTime = blah
}
}
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.
Thanks for the review. I have updated the code.
@DerekLeeCS , please review. I have updated the code as per review comments |
@shollyman @gkevinzheng, please review. I have updated the code as per review comments |
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.
thanks for the changes!
Fixes: b/365774730
More about hot backups: https://cloud.google.com/bigtable/docs/backups#hot-backups
Generated protos have 2 new fields in the Backup struct. These fields are being added to various methods in this PR:
google-cloud-go/bigtable/admin/apiv2/adminpb/table.pb.go
Lines 1390 to 1400 in 649c075
To create a hot backup that expires after 4 days:
or without specifying HotToStandardTime i.e. hot backup does not get converted to standard backup
To update hot_to_standard_time of hot backup:
To remove hot_to_standard_time of hot backup: