feat(bigtable): Hot backups#11215
Conversation
DerekLeeCS
left a comment
There was a problem hiding this comment.
overall logic looks good, just have a few suggestions for the implementation
| } | ||
|
|
||
| // BackupOption can be used to specify parameters for backup operations. | ||
| type BackupOption interface { |
There was a problem hiding this comment.
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.
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 |
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: