diff --git a/src/backend/distributed/connection/shared_connection_stats.c b/src/backend/distributed/connection/shared_connection_stats.c index 6b0bbb435..d33a7ac42 100644 --- a/src/backend/distributed/connection/shared_connection_stats.c +++ b/src/backend/distributed/connection/shared_connection_stats.c @@ -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); diff --git a/src/backend/distributed/shared_library_init.c b/src/backend/distributed/shared_library_init.c index 21e34892d..9c6393039 100644 --- a/src/backend/distributed/shared_library_init.c +++ b/src/backend/distributed/shared_library_init.c @@ -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."), diff --git a/src/include/distributed/shared_connection_stats.h b/src/include/distributed/shared_connection_stats.h index 8458bca8e..77023cc24 100644 --- a/src/include/distributed/shared_connection_stats.h +++ b/src/include/distributed/shared_connection_stats.h @@ -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);