diff --git a/src/backend/distributed/utils/reference_table_utils.c b/src/backend/distributed/utils/reference_table_utils.c index fd683cc3b..f5720539b 100644 --- a/src/backend/distributed/utils/reference_table_utils.c +++ b/src/backend/distributed/utils/reference_table_utils.c @@ -112,6 +112,14 @@ EnsureReferenceTablesExistOnAllNodesExtended(char transferMode) return; } + /* + * Don't let this table dropped, if dropped retry instead of + * erroring out unless we find 1 table. + */ + if (!ConditionalLockRelationOid(referenceTableId, AccessShareLock)) + { + elog(ERROR, "table droppeed concurrently"); + } /* * Most of the time this function should result in a conclusion where we do not need