Skip to content

Commit

Permalink
check keyspace snapshot time for restore
Browse files Browse the repository at this point in the history
Signed-off-by: Priya Bibra <pbibra@slack-corp.com>
  • Loading branch information
pbibra committed Jul 18, 2023
1 parent 82cf45b commit 4db244c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go/vt/vttablet/tabletmanager/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ func (tm *TabletManager) restoreDataLocked(ctx context.Context, logger logutil.L
return err
}

// If backupTime not specified in restore_from_backup_ts, check to see if the keyspace has a SNAPSHOT time
// to restore from (for PITR)
if backupTime.IsZero() {
backupTime = logutil.ProtoToTime(keyspaceInfo.SnapshotTime)
}

// For a SNAPSHOT keyspace, we have to look for backups of BaseKeyspace
// so we will pass the BaseKeyspace in RestoreParams instead of tablet.Keyspace
if keyspaceInfo.KeyspaceType == topodatapb.KeyspaceType_SNAPSHOT {
Expand Down

0 comments on commit 4db244c

Please sign in to comment.