mirror of https://github.com/citusdata/citus.git
Do not send metadata changes during add node if citus.enable_metadata_sync is set to false
(cherry picked from commit 7157152f6c
)
release-11.0-onder-30-may
parent
d147d5d0c5
commit
3227d6551e
|
@ -1899,12 +1899,15 @@ RemoveNodeFromCluster(char *nodeName, int32 nodePort)
|
|||
|
||||
RemoveOldShardPlacementForNodeGroup(workerNode->groupId);
|
||||
|
||||
char *nodeDeleteCommand = NodeDeleteCommand(workerNode->nodeId);
|
||||
|
||||
/* make sure we don't have any lingering session lifespan connections */
|
||||
CloseNodeConnectionsAfterTransaction(workerNode->workerName, nodePort);
|
||||
|
||||
SendCommandToWorkersWithMetadata(nodeDeleteCommand);
|
||||
if (EnableMetadataSync)
|
||||
{
|
||||
char *nodeDeleteCommand = NodeDeleteCommand(workerNode->nodeId);
|
||||
|
||||
SendCommandToWorkersWithMetadata(nodeDeleteCommand);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2155,18 +2158,21 @@ AddNodeMetadata(char *nodeName, int32 nodePort,
|
|||
|
||||
workerNode = FindWorkerNodeAnyCluster(nodeName, nodePort);
|
||||
|
||||
/* send the delete command to all primary nodes with metadata */
|
||||
char *nodeDeleteCommand = NodeDeleteCommand(workerNode->nodeId);
|
||||
SendCommandToWorkersWithMetadata(nodeDeleteCommand);
|
||||
|
||||
/* finally prepare the insert command and send it to all primary nodes */
|
||||
uint32 primariesWithMetadata = CountPrimariesWithMetadata();
|
||||
if (primariesWithMetadata != 0)
|
||||
if (EnableMetadataSync)
|
||||
{
|
||||
List *workerNodeList = list_make1(workerNode);
|
||||
char *nodeInsertCommand = NodeListInsertCommand(workerNodeList);
|
||||
/* send the delete command to all primary nodes with metadata */
|
||||
char *nodeDeleteCommand = NodeDeleteCommand(workerNode->nodeId);
|
||||
SendCommandToWorkersWithMetadata(nodeDeleteCommand);
|
||||
|
||||
SendCommandToWorkersWithMetadata(nodeInsertCommand);
|
||||
/* finally prepare the insert command and send it to all primary nodes */
|
||||
uint32 primariesWithMetadata = CountPrimariesWithMetadata();
|
||||
if (primariesWithMetadata != 0)
|
||||
{
|
||||
List *workerNodeList = list_make1(workerNode);
|
||||
char *nodeInsertCommand = NodeListInsertCommand(workerNodeList);
|
||||
|
||||
SendCommandToWorkersWithMetadata(nodeInsertCommand);
|
||||
}
|
||||
}
|
||||
|
||||
return workerNode->nodeId;
|
||||
|
@ -2185,11 +2191,13 @@ SetWorkerColumn(WorkerNode *workerNode, int columnIndex, Datum value)
|
|||
{
|
||||
workerNode = SetWorkerColumnLocalOnly(workerNode, columnIndex, value);
|
||||
|
||||
char *metadataSyncCommand = GetMetadataSyncCommandToSetNodeColumn(workerNode,
|
||||
columnIndex,
|
||||
value);
|
||||
if (EnableMetadataSync)
|
||||
{
|
||||
char *metadataSyncCommand =
|
||||
GetMetadataSyncCommandToSetNodeColumn(workerNode, columnIndex, value);
|
||||
|
||||
SendCommandToWorkersWithMetadata(metadataSyncCommand);
|
||||
SendCommandToWorkersWithMetadata(metadataSyncCommand);
|
||||
}
|
||||
|
||||
return workerNode;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue