Skip to content

Commit

Permalink
backupccl: don't back up dropped databases or schemas
Browse files Browse the repository at this point in the history
Hack to deal with bugs that Aditya is fixing.

Release note: None
  • Loading branch information
ajwerner committed Feb 17, 2022
1 parent a1da054 commit 4c2dc32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ccl/backupccl/backupresolver/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 {
Expand Down

0 comments on commit 4c2dc32

Please sign in to comment.