acquire lock on a ref table

onder/fix/reference-lock-contention
Onder Kalaci 2022-08-17 11:18:04 +02:00
parent 0bfd9a253f
commit 541b1525cb
1 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,14 @@ EnsureReferenceTablesExistOnAllNodesExtended(char transferMode)
return; 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 * Most of the time this function should result in a conclusion where we do not need