diff --git a/pkg/ccl/backupccl/backuputils/utils.go b/pkg/ccl/backupccl/backuputils/utils.go index 8c75f79d2bbe..7b029d26e8a6 100644 --- a/pkg/ccl/backupccl/backuputils/utils.go +++ b/pkg/ccl/backupccl/backuputils/utils.go @@ -103,8 +103,8 @@ func AppendPaths(uris []string, tailDir ...string) ([]string, error) { func ValidateDescriptors( ctx context.Context, descriptors catalog.Descriptors, version roachpb.Version, ) (bool, string, error) { - descTable := make(doctor.DescriptorTable, len(descriptors)) - namespaceTable := make(doctor.NamespaceTable, len(descriptors)) + descTable := make(doctor.DescriptorTable, 0, len(descriptors)) + namespaceTable := make(doctor.NamespaceTable, 0, len(descriptors)) for _, desc := range descriptors { bytes, err := protoutil.Marshal(desc.DescriptorProto()) diff --git a/pkg/ccl/backupccl/restore_job.go b/pkg/ccl/backupccl/restore_job.go index 67a68fc05192..54cac8b3debb 100644 --- a/pkg/ccl/backupccl/restore_job.go +++ b/pkg/ccl/backupccl/restore_job.go @@ -701,8 +701,8 @@ func validateRestoredDescriptors(ctx context.Context, execConfig *sql.ExecutorCo if err != nil { return err } - targetDescs := make([]catalog.Descriptor, 0) - for _, desc := range allDescs { + // targetDescs := make([]catalog.Descriptor, 0) + /*for _, desc := range allDescs { // While we could filter out descriptors that aren't targets of the restore, // this would cause a spurious validation failure if the restoring // descriptors have references to descriptors that already exist in the @@ -714,8 +714,8 @@ func validateRestoredDescriptors(ctx context.Context, execConfig *sql.ExecutorCo // when they're in the dropped stage. continue } - } - ok, invalidMsg, err := backuputils.ValidateDescriptors(ctx, targetDescs, + }*/ + ok, invalidMsg, err := backuputils.ValidateDescriptors(ctx, allDescs, execConfig.Settings.Version.BinaryVersion()) if err != nil { return err