mirror of https://github.com/citusdata/citus.git
implement CanHaveReferenceTablePlacements
parent
24dd4ca64f
commit
df95b5fe6e
|
@ -46,6 +46,7 @@ static WorkerNode * FindRandomNodeFromList(List *candidateWorkerNodeList);
|
||||||
static bool OddNumber(uint32 number);
|
static bool OddNumber(uint32 number);
|
||||||
static bool ListMember(List *currentList, WorkerNode *workerNode);
|
static bool ListMember(List *currentList, WorkerNode *workerNode);
|
||||||
static bool NodeIsPrimaryWorker(WorkerNode *node);
|
static bool NodeIsPrimaryWorker(WorkerNode *node);
|
||||||
|
static bool CanHaveReferenceTablePlacements(void);
|
||||||
static bool NodeIsReadableWorker(WorkerNode *node);
|
static bool NodeIsReadableWorker(WorkerNode *node);
|
||||||
|
|
||||||
|
|
||||||
|
@ -401,6 +402,27 @@ NodeIsPrimaryWorker(WorkerNode *node)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CanHaveReferenceTablePlacements returns true if current node can have
|
||||||
|
* reference table placements. This is only possible if we called below
|
||||||
|
* command formerly
|
||||||
|
* "SELECT master_add_node(coordinator_hostname, coordinator_port, groupId => 0)"
|
||||||
|
*/
|
||||||
|
static bool
|
||||||
|
CanHaveReferenceTablePlacements()
|
||||||
|
{
|
||||||
|
bool hasReferenceTableReplica = false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* All groups that have pg_dist_node entries, also have reference
|
||||||
|
* table placements.
|
||||||
|
*/
|
||||||
|
PrimaryNodeForGroup(GetLocalGroupId(), &hasReferenceTableReplica);
|
||||||
|
|
||||||
|
return hasReferenceTableReplica;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ReferenceTablePlacementNodeList returns the set of nodes that should have
|
* ReferenceTablePlacementNodeList returns the set of nodes that should have
|
||||||
* reference table placements. This includes all primaries, including the
|
* reference table placements. This includes all primaries, including the
|
||||||
|
|
Loading…
Reference in New Issue