From 4c2dc3278edecb57fc5e86cecf902bf7638f0a2c Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Wed, 16 Feb 2022 17:31:44 -0500 Subject: [PATCH] backupccl: don't back up dropped databases or schemas Hack to deal with bugs that Aditya is fixing. Release note: None --- pkg/ccl/backupccl/backupresolver/targets.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/ccl/backupccl/backupresolver/targets.go b/pkg/ccl/backupccl/backupresolver/targets.go index d0d8d1adcb50..65c2dcdb237d 100644 --- a/pkg/ccl/backupccl/backupresolver/targets.go +++ b/pkg/ccl/backupccl/backupresolver/targets.go @@ -182,6 +182,9 @@ func NewDescriptorResolver(descs []catalog.Descriptor) (*DescriptorResolver, err // check the ParentID for tables, and all the valid parents must be // known before we start to check that. for _, desc := range descs { + if desc.Dropped() { + continue + } if _, isDB := desc.(catalog.DatabaseDescriptor); isDB { if _, ok := r.DbsByName[desc.GetName()]; ok { return nil, errors.Errorf("duplicate database name: %q used for ID %d and %d", @@ -207,6 +210,9 @@ func NewDescriptorResolver(descs []catalog.Descriptor) (*DescriptorResolver, err // Add all schemas to the resolver. for _, desc := range descs { + if desc.Dropped() { + continue + } if sc, ok := desc.(catalog.SchemaDescriptor); ok { schemaMap := r.ObjsByName[sc.GetParentID()] if schemaMap == nil {