Skip to content

Commit b932678

Browse files
committed
catalog/externalcatalog: delete namespace entries during clean up
Previously, the external catalog logic would never clean up namespace entries for descriptors when DropIngestedExternalCatalog was invoked. This would lead to left over junk in the system.namespace table, contrary to the normal object deletion protocol. To address this, this patch also deletes namespace entries. Fixes: #140551 Release note: None
1 parent bce8eb6 commit b932678

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/sql/catalog/externalcatalog/external_catalog.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ func DropIngestedExternalCatalog(
256256
if err := descsCol.WriteDescToBatch(ctx, kvTrace, t, b); err != nil {
257257
return errors.Wrap(err, "writing dropping table to batch")
258258
}
259+
if err := descsCol.DeleteNamespaceEntryToBatch(ctx, kvTrace, t, b); err != nil {
260+
return errors.Wrap(err, "writing namespace delete to batch")
261+
}
259262
}
260263
return txn.KV().Run(ctx, b)
261264
}

0 commit comments

Comments
 (0)