Rename argument to localOnly

pg_dist_object-metadatasync
Jelte Fennema 2021-07-22 11:33:05 +02:00
parent f3b7e53734
commit 428b819516
9 changed files with 27 additions and 27 deletions

View File

@ -700,8 +700,8 @@ MarkSequenceListDistributed(List *sequenceList)
ObjectAddress address;
ObjectAddressSet(address, RelationRelationId, sequenceOid);
bool shouldSyncMetadata = true;
MarkObjectDistributed(&address, shouldSyncMetadata);
bool localOnly = false;
MarkObjectDistributed(&address, localOnly);
}
}

View File

@ -121,8 +121,8 @@ EnsureDependenciesExistOnAllNodes(const ObjectAddress *target)
ObjectAddress *dependency = NULL;
foreach_ptr(dependency, dependenciesWithCommands)
{
bool shouldSyncMetadata = true;
MarkObjectDistributed(dependency, shouldSyncMetadata);
bool localOnly = false;
MarkObjectDistributed(dependency, localOnly);
}
}

View File

@ -591,8 +591,8 @@ MarkExistingObjectDependenciesDistributedIfSupported()
ObjectAddress *objectAddress = NULL;
foreach_ptr(objectAddress, uniqueObjectAddresses)
{
bool shouldSyncMetadata = true;
MarkObjectDistributed(objectAddress, shouldSyncMetadata);
bool localOnly = false;
MarkObjectDistributed(objectAddress, localOnly);
}
}

View File

@ -191,8 +191,8 @@ create_distributed_function(PG_FUNCTION_ARGS)
ENABLE_DDL_PROPAGATION);
SendCommandToWorkersAsUser(NON_COORDINATOR_NODES, CurrentUserName(), ddlCommand.data);
bool shouldSyncMetadata = true;
MarkObjectDistributed(&functionAddress, shouldSyncMetadata);
bool localOnly = false;
MarkObjectDistributed(&functionAddress, localOnly);
if (distributionArgumentName != NULL)
{
@ -238,9 +238,9 @@ DistributeFunctionWithDistributionArgument(RegProcedure funcOid,
distributionArgumentOid);
/* record the distribution argument and colocationId */
bool shouldSyncMetadata = true;
bool localOnly = false;
UpdateFunctionDistributionInfo(functionAddress, &distributionArgumentIndex,
&colocationId, shouldSyncMetadata);
&colocationId, localOnly);
/*
* Once we have at least one distributed function/procedure with distribution
@ -277,10 +277,10 @@ DistributeFunctionColocatedWithDistributedTable(RegProcedure funcOid,
" parameter should also be provided")));
}
bool shouldSyncMetadata = true;
bool localOnly = false;
/* set distribution argument and colocationId to NULL */
UpdateFunctionDistributionInfo(functionAddress, NULL, NULL, shouldSyncMetadata);
UpdateFunctionDistributionInfo(functionAddress, NULL, NULL, localOnly);
}
@ -296,9 +296,9 @@ DistributeFunctionColocatedWithReferenceTable(const ObjectAddress *functionAddre
/* set distribution argument to NULL and colocationId to the reference table colocation id */
int *distributionArgumentIndex = NULL;
bool shouldSyncMetadata = true;
bool localOnly = false;
UpdateFunctionDistributionInfo(functionAddress, distributionArgumentIndex,
&colocationId, shouldSyncMetadata);
&colocationId, localOnly);
/*
* Once we have at least one distributed function/procedure that reads
@ -573,7 +573,7 @@ EnsureFunctionCanBeColocatedWithTable(Oid functionOid, Oid distributionColumnTyp
void
UpdateFunctionDistributionInfo(const ObjectAddress *distAddress,
int *distribution_argument_index,
int *colocationId, bool shouldSyncMetadata)
int *colocationId, bool localOnly)
{
const bool indexOK = true;
@ -644,7 +644,7 @@ UpdateFunctionDistributionInfo(const ObjectAddress *distAddress,
table_close(pgDistObjectRel, NoLock);
if (shouldSyncMetadata)
if (!localOnly)
{
char *workerMetadataUpdateCommand = DistributedObjectCreateCommand(
distAddress, distribution_argument_index, colocationId);

View File

@ -654,8 +654,8 @@ ProcessUtilityInternal(PlannedStmt *pstmt,
if (ops && ops->markDistributed)
{
ObjectAddress address = GetObjectAddressFromParseTree(parsetree, false);
bool shouldSyncMetadata = true;
MarkObjectDistributed(&address, shouldSyncMetadata);
bool localOnly = false;
MarkObjectDistributed(&address, localOnly);
}
}

View File

@ -141,7 +141,7 @@ ObjectExists(const ObjectAddress *address)
* by adding appropriate entries to citus.pg_dist_object.
*/
void
MarkObjectDistributed(const ObjectAddress *distAddress, bool shouldSyncMetadata)
MarkObjectDistributed(const ObjectAddress *distAddress, bool localOnly)
{
int paramCount = 3;
Oid paramTypes[3] = {
@ -165,7 +165,7 @@ MarkObjectDistributed(const ObjectAddress *distAddress, bool shouldSyncMetadata)
ereport(ERROR, (errmsg("failed to insert object into citus.pg_dist_object")));
}
if (shouldSyncMetadata)
if (!localOnly)
{
char *workerMetadataUpdateCommand = DistributedObjectCreateCommand(
distAddress, NULL, NULL);

View File

@ -399,8 +399,8 @@ SyncMetadataSnapshotToNode(WorkerNode *workerNode, bool raiseOnError)
ObjectAddress *address;
foreach_ptr(address, newDistributedObjects)
{
bool shouldSyncMetadata = true;
MarkObjectDistributed(address, shouldSyncMetadata);
bool localOnly = false;
MarkObjectDistributed(address, localOnly);
}
return true;
}
@ -2661,10 +2661,10 @@ citus_internal_add_object_metadata(PG_FUNCTION_ARGS)
ObjectAddress address = { 0 };
ObjectAddressSubSet(address, classid, objid, objsubid);
bool shouldSyncMetadata = false;
MarkObjectDistributed(&address, shouldSyncMetadata);
bool localOnly = true;
MarkObjectDistributed(&address, localOnly);
UpdateFunctionDistributionInfo(&address, distributionArgumentIndex, colocationId,
shouldSyncMetadata);
localOnly);
PG_RETURN_VOID();
}

View File

@ -474,7 +474,7 @@ extern ObjectWithArgs * ObjectWithArgsFromOid(Oid funcOid);
extern void UpdateFunctionDistributionInfo(const ObjectAddress *distAddress,
int *distribution_argument_index,
int *colocationId,
bool shouldSyncMetadata);
bool localOnly);
/* vacuum.c - forward declarations */
extern void PostprocessVacuumStmt(VacuumStmt *vacuumStmt, const char *vacuumCommand);

View File

@ -21,7 +21,7 @@ extern bool CitusExtensionObject(const ObjectAddress *objectAddress);
extern bool IsObjectDistributed(const ObjectAddress *address);
extern bool ClusterHasDistributedFunctionWithDistArgument(void);
extern void MarkObjectDistributed(const ObjectAddress *distAddress,
bool shouldSyncMetadata);
bool localOnly);
extern void UnmarkObjectDistributed(const ObjectAddress *address);
extern bool IsTableOwnedByExtension(Oid relationId);
extern bool IsObjectAddressOwnedByExtension(const ObjectAddress *target,