Skip to content

Commit 0b98fd7

Browse files
craig[bot]fqazi
craig[bot]
andcommitted
Merge #140564
140564: catalog/externalcatalog: delete namespace entries during clean up r=msbutler a=fqazi 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 Co-authored-by: Faizan Qazi <[email protected]>
2 parents 871fb9f + b932678 commit 0b98fd7

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)