Remove MaxTrackedWorkerNodes use MaxWorkerNodesTracked

preventConflictingFlags
Onder Kalaci 2020-03-26 10:50:03 +01:00
parent 188e571d3c
commit 34dec931f4
3 changed files with 11 additions and 35 deletions

View File

@ -84,16 +84,6 @@ typedef struct SharedConnStatsHashEntry
} SharedConnStatsHashEntry;
/*
* Controlled via a GUC.
*
* By default, Citus tracks 1024 worker nodes, which is already
* very unlikely number of worker nodes. Given that the shared
* memory required per worker is pretty small (~120 Bytes), we think it
* is a good default that wouldn't hurt any users in any dimension.
*/
int MaxTrackedWorkerNodes = 1024;
static int MaxSharedPoolSize = 100;
/* the following two structs used for accessing shared memory */
@ -398,9 +388,9 @@ SharedConnectionStatsShmemSize(void)
Size size = 0;
size = add_size(size, sizeof(ConnectionStatsSharedData));
size = add_size(size, mul_size(sizeof(LWLock), MaxTrackedWorkerNodes));
size = add_size(size, mul_size(sizeof(LWLock), MaxWorkerNodesTracked));
Size hashSize = hash_estimate_size(MaxTrackedWorkerNodes,
Size hashSize = hash_estimate_size(MaxWorkerNodesTracked,
sizeof(SharedConnStatsHashEntry));
size = add_size(size, hashSize);
@ -453,8 +443,8 @@ SharedConnectionStatsShmemInit(void)
/* allocate hash table */
SharedConnStatsHash =
ShmemInitHash("Shared Conn. Stats Hash", MaxTrackedWorkerNodes,
MaxTrackedWorkerNodes, &info, hashFlags);
ShmemInitHash("Shared Conn. Stats Hash", MaxWorkerNodesTracked,
MaxWorkerNodesTracked, &info, hashFlags);
LWLockRelease(AddinShmemInitLock);

View File

@ -936,9 +936,14 @@ RegisterCitusConfigVariables(void)
"health status are tracked in a shared hash table on "
"the master node. This configuration value limits the "
"size of the hash table, and consequently the maximum "
"number of worker nodes that can be tracked."),
"number of worker nodes that can be tracked."
"Citus keeps some information about the worker nodes "
"in the shared memory for certain optimizations. The "
"optimizations are enforced up to this number of worker "
"nodes. Any additional worker nodes may not benefit from"
"the optimizations."),
&MaxWorkerNodesTracked,
2048, 8, INT_MAX,
2048, 1024, INT_MAX,
PGC_POSTMASTER,
GUC_STANDARD,
NULL, NULL, NULL);
@ -1012,23 +1017,6 @@ RegisterCitusConfigVariables(void)
GUC_STANDARD,
NULL, NULL, NULL);
DefineCustomIntVariable(
"citus.max_tracked_worker_nodes",
gettext_noop("Sets the maximum number of worker tracked."),
gettext_noop("Citus doesn't have any limitations in terms of the "
"number of worker nodes allowed in the cluster. But, "
"Citus keeps some information about the worker nodes "
"in the shared memory for certain optimizations. The "
"optimizations are enforced up to this number of worker "
"nodes. Any additional worker nodes may not benefit from"
"the optimizations."),
&MaxTrackedWorkerNodes,
1024, 256, INT_MAX,
PGC_POSTMASTER,
GUC_STANDARD,
NULL, NULL, NULL);
DefineCustomIntVariable(
"citus.max_running_tasks_per_node",
gettext_noop("Sets the maximum number of tasks to run concurrently per node."),

View File

@ -11,8 +11,6 @@
#ifndef SHARED_CONNECTION_STATS_H
#define SHARED_CONNECTION_STATS_H
extern int MaxTrackedWorkerNodes;
extern void InitializeSharedConnectionStats(void);
extern bool TryToIncrementSharedConnectionCounter(const char *hostname, int port);
extern void WaitOrErrorForSharedConnection(const char *hostname, int port);