Check autoConverted for the input relation only

talha_tes1
Ahmet Gedemenli 2021-10-25 17:21:23 +03:00
parent bf18e7db0b
commit cccd035cbb
1 changed files with 10 additions and 9 deletions

View File

@ -146,6 +146,16 @@ GetForeignKeyConnectedRelationIdList(Oid relationId)
bool
ShouldUndistributeCitusLocalTable(Oid relationId)
{
CitusTableCacheEntry *cacheEntry = GetCitusTableCacheEntry(relationId);
if (!cacheEntry->autoConverted)
{
/*
* The relation is not added to metadata automatically,
* we shouldn't undistribute it.
*/
return false;
}
/*
* As we will operate on foreign key connected relations, here we
* invalidate foreign key graph so that we act on fresh graph.
@ -171,15 +181,6 @@ ShouldUndistributeCitusLocalTable(Oid relationId)
*/
return false;
}
CitusTableCacheEntry *cacheEntry = GetCitusTableCacheEntry(relationOid);
if (!cacheEntry->autoConverted)
{
/*
* The relation is connected to a (or, is a) Citus Local Table created
* by the user. We shouldn't undistribute it.
*/
return false;
}
}
return true;