Skip to content

Commit

Permalink
Merge #65673
Browse files Browse the repository at this point in the history
65673: backupccl: fix include interleaved tables option for scheduled backup r=adityamaru a=annezhu98

This commit fixes the bug that causes error when creating scheduled backup with interleaved tables, when the `include_deprecated_interleaves` option is included, the option gets ignored.

Resolves: #65558

Release note (bug fix): scheduled backup with interleaved tables can now be created with the `include_deprecated_interleaves` option.

Co-authored-by: Anne Zhu <[email protected]>
  • Loading branch information
craig[bot] and azhu-crl committed May 26, 2021
2 parents aa0e5f6 + f80dc1a commit 4e3437f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/ccl/backupccl/create_scheduled_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ func doCreateBackupSchedules(
// Prepare backup statement (full).
backupNode := &tree.Backup{
Options: tree.BackupOptions{
CaptureRevisionHistory: eval.BackupOptions.CaptureRevisionHistory,
Detached: true,
CaptureRevisionHistory: eval.BackupOptions.CaptureRevisionHistory,
Detached: true,
IncludeDeprecatedInterleaves: eval.BackupOptions.IncludeDeprecatedInterleaves,
},
Nested: true,
AppendToLatest: false,
Expand Down
13 changes: 13 additions & 0 deletions pkg/ccl/backupccl/create_scheduled_backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,19 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
},
},
},
{
name: "full-cluster-with-interleaved-table",
query: "CREATE SCHEDULE FOR BACKUP INTO 'nodelocal://0/backup?AWS_SECRET_ACCESS_KEY=neverappears' WITH INCLUDE_DEPRECATED_INTERLEAVES RECURRING '@hourly'",
user: freeUser,
expectedSchedules: []expectedSchedule{
{
nameRe: "BACKUP .+",
backupStmt: "BACKUP INTO 'nodelocal://0/backup?AWS_SECRET_ACCESS_KEY=neverappears' WITH detached, include_deprecated_interleaves",
shownStmt: "BACKUP INTO 'nodelocal://0/backup?AWS_SECRET_ACCESS_KEY=redacted' WITH detached, include_deprecated_interleaves",
period: time.Hour,
},
},
},
{
name: "full-cluster-always",
query: "CREATE SCHEDULE FOR BACKUP INTO 'nodelocal://0/backup' RECURRING '@hourly' FULL BACKUP ALWAYS",
Expand Down

0 comments on commit 4e3437f

Please sign in to comment.