mirror of https://github.com/citusdata/citus.git
style
parent
5307653577
commit
c375b58335
|
@ -1665,6 +1665,7 @@ citus_is_coordinator(PG_FUNCTION_ARGS)
|
||||||
PG_RETURN_BOOL(isCoordinator);
|
PG_RETURN_BOOL(isCoordinator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* citus_is_primary_node returns whether the current node is a primary for
|
* citus_is_primary_node returns whether the current node is a primary for
|
||||||
* a given group_id. We consider the node a primary if it has
|
* a given group_id. We consider the node a primary if it has
|
||||||
|
@ -1675,7 +1676,6 @@ citus_is_primary_node(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
CheckCitusVersion(ERROR);
|
CheckCitusVersion(ERROR);
|
||||||
|
|
||||||
bool isPrimary = false;
|
|
||||||
int32 groupId = GetLocalGroupId();
|
int32 groupId = GetLocalGroupId();
|
||||||
WorkerNode *workerNode = PrimaryNodeForGroup(groupId, NULL);
|
WorkerNode *workerNode = PrimaryNodeForGroup(groupId, NULL);
|
||||||
if (workerNode == NULL)
|
if (workerNode == NULL)
|
||||||
|
@ -1690,11 +1690,12 @@ citus_is_primary_node(PG_FUNCTION_ARGS)
|
||||||
PG_RETURN_NULL();
|
PG_RETURN_NULL();
|
||||||
}
|
}
|
||||||
|
|
||||||
isPrimary = workerNode->nodeId == GetLocalNodeId();
|
bool isPrimary = workerNode->nodeId == GetLocalNodeId();
|
||||||
|
|
||||||
PG_RETURN_BOOL(isPrimary);
|
PG_RETURN_BOOL(isPrimary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* EnsureParentSessionHasExclusiveLockOnPgDistNode ensures given session id
|
* EnsureParentSessionHasExclusiveLockOnPgDistNode ensures given session id
|
||||||
* holds Exclusive lock on pg_dist_node.
|
* holds Exclusive lock on pg_dist_node.
|
||||||
|
|
Loading…
Reference in New Issue