From 46e55ac95ec32d401278e6c8d41297a42e7a085b Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Tue, 14 Mar 2023 08:20:34 -0400 Subject: [PATCH] backupccl: use correct version gate for restore checkpointing PR #97862 introduced a subtle bug which allowed the new restore checkpointing policy to take effect before the 23_1 migrations occured. This patch ensures the new policy only takes effect after all migrations occur. Release note: None Epic: None --- pkg/ccl/backupccl/backup_test.go | 2 +- pkg/ccl/backupccl/restore_job.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ccl/backupccl/backup_test.go b/pkg/ccl/backupccl/backup_test.go index f427ca11e25b..196f4b5d40f4 100644 --- a/pkg/ccl/backupccl/backup_test.go +++ b/pkg/ccl/backupccl/backup_test.go @@ -1811,7 +1811,7 @@ func TestBackupRestoreResume(t *testing.T) { }, }, // Required because restore checkpointing is version gated. - clusterversion.ByKey(clusterversion.V23_1Start), + clusterversion.ByKey(clusterversion.V23_1), ) // If the restore properly took the (incorrect) low-water mark into account, // the first half of the table will be missing. diff --git a/pkg/ccl/backupccl/restore_job.go b/pkg/ccl/backupccl/restore_job.go index ad9e5593ad3d..96867aeafdf0 100644 --- a/pkg/ccl/backupccl/restore_job.go +++ b/pkg/ccl/backupccl/restore_job.go @@ -287,7 +287,7 @@ func restore( return emptyRowCount, err } - on231 := clusterversion.ByKey(clusterversion.V23_1Start).LessEq(job.Payload().CreationClusterVersion) + on231 := clusterversion.ByKey(clusterversion.V23_1).LessEq(job.Payload().CreationClusterVersion) progressTracker, err := makeProgressTracker( dataToRestore.getSpans(), job.Progress().Details.(*jobspb.Progress_Restore).Restore.Checkpoint,