Skip to content

Commit

Permalink
feat(spanner): Add support for Cloud Spanner Incremental Backups (#2085)
Browse files Browse the repository at this point in the history
* feat(spanner): Add support for Cloud Spanner Incremental Backups

PiperOrigin-RevId: 657612329

Source-Link: googleapis/googleapis@e77b669

Source-Link: googleapis/googleapis-gen@0f66346
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGY2NjM0NjlmM2VkY2MzNGM2MGMxYmJlMDE3MjdjYzVlYjk3MWM2MCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: danieljbruce <[email protected]>
  • Loading branch information
3 people authored Aug 5, 2024
1 parent 4ec1561 commit 33b9645
Show file tree
Hide file tree
Showing 5 changed files with 542 additions and 4 deletions.
43 changes: 43 additions & 0 deletions protos/google/spanner/admin/database/v1/backup.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@ message Backup {
// Output only. Size of the backup in bytes.
int64 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The number of bytes that will be freed by deleting this
// backup. This value will be zero if, for example, this backup is part of an
// incremental backup chain and younger backups in the chain require that we
// keep its data. For backups not in an incremental backup chain, this is
// always the size of the backup. This value may change if backups on the same
// chain get created, deleted or expired.
int64 freeable_size_bytes = 15 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. For a backup in an incremental backup chain, this is the
// storage space needed to keep the data that has changed since the previous
// backup. For all other backups, this is always the size of the backup. This
// value may change if backups on the same chain get deleted or expired.
//
// This field can be used to calculate the total storage space used by a set
// of backups. For example, the total space used by all backups of a database
// can be computed by summing up this field.
int64 exclusive_size_bytes = 16 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The current state of the backup.
State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

Expand Down Expand Up @@ -168,6 +186,23 @@ message Backup {
// single backup schedule URI associated with creating this backup.
repeated string backup_schedules = 14
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Populated only for backups in an incremental backup chain.
// Backups share the same chain id if and only if they belong to the same
// incremental backup chain. Use this field to determine which backups are
// part of the same incremental backup chain. The ordering of backups in the
// chain can be determined by ordering the backup `version_time`.
string incremental_backup_chain_id = 17
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Data deleted at a time older than this is guaranteed not to be
// retained in order to support this backup. For a backup in an incremental
// backup chain, this is the version time of the oldest backup that exists or
// ever existed in the chain. For all other backups, this is the version time
// of the backup. This field can be used to understand what data is being
// retained by the backup system.
google.protobuf.Timestamp oldest_version_time = 18
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request for
Expand Down Expand Up @@ -705,3 +740,11 @@ message CopyBackupEncryptionConfig {
// A full backup stores the entire contents of the database at a given
// version time.
message FullBackupSpec {}

// The specification for incremental backup chains.
// An incremental backup stores the delta of changes between a previous
// backup and the database contents at a given version time. An
// incremental backup chain consists of a full backup and zero or more
// successive incremental backups. The first backup created for an
// incremental backup chain is always a full backup.
message IncrementalBackupSpec {}
3 changes: 3 additions & 0 deletions protos/google/spanner/admin/database/v1/backup_schedule.proto
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ message BackupSchedule {
oneof backup_type_spec {
// The schedule creates only full backups.
FullBackupSpec full_backup_spec = 7;

// The schedule creates incremental backup chains.
IncrementalBackupSpec incremental_backup_spec = 8;
}

// Output only. The timestamp at which the schedule was last updated.
Expand Down
123 changes: 122 additions & 1 deletion protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 33b9645

Please sign in to comment.