mirror of https://github.com/citusdata/citus.git
Remove MaxTrackedWorkerNodes use MaxWorkerNodesTracked
parent
188e571d3c
commit
34dec931f4
|
@ -84,16 +84,6 @@ typedef struct SharedConnStatsHashEntry
|
||||||
} 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;
|
static int MaxSharedPoolSize = 100;
|
||||||
|
|
||||||
/* the following two structs used for accessing shared memory */
|
/* the following two structs used for accessing shared memory */
|
||||||
|
@ -398,9 +388,9 @@ SharedConnectionStatsShmemSize(void)
|
||||||
Size size = 0;
|
Size size = 0;
|
||||||
|
|
||||||
size = add_size(size, sizeof(ConnectionStatsSharedData));
|
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));
|
sizeof(SharedConnStatsHashEntry));
|
||||||
|
|
||||||
size = add_size(size, hashSize);
|
size = add_size(size, hashSize);
|
||||||
|
@ -453,8 +443,8 @@ SharedConnectionStatsShmemInit(void)
|
||||||
|
|
||||||
/* allocate hash table */
|
/* allocate hash table */
|
||||||
SharedConnStatsHash =
|
SharedConnStatsHash =
|
||||||
ShmemInitHash("Shared Conn. Stats Hash", MaxTrackedWorkerNodes,
|
ShmemInitHash("Shared Conn. Stats Hash", MaxWorkerNodesTracked,
|
||||||
MaxTrackedWorkerNodes, &info, hashFlags);
|
MaxWorkerNodesTracked, &info, hashFlags);
|
||||||
|
|
||||||
LWLockRelease(AddinShmemInitLock);
|
LWLockRelease(AddinShmemInitLock);
|
||||||
|
|
||||||
|
|
|
@ -936,9 +936,14 @@ RegisterCitusConfigVariables(void)
|
||||||
"health status are tracked in a shared hash table on "
|
"health status are tracked in a shared hash table on "
|
||||||
"the master node. This configuration value limits the "
|
"the master node. This configuration value limits the "
|
||||||
"size of the hash table, and consequently the maximum "
|
"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,
|
&MaxWorkerNodesTracked,
|
||||||
2048, 8, INT_MAX,
|
2048, 1024, INT_MAX,
|
||||||
PGC_POSTMASTER,
|
PGC_POSTMASTER,
|
||||||
GUC_STANDARD,
|
GUC_STANDARD,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
@ -1012,23 +1017,6 @@ RegisterCitusConfigVariables(void)
|
||||||
GUC_STANDARD,
|
GUC_STANDARD,
|
||||||
NULL, NULL, NULL);
|
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(
|
DefineCustomIntVariable(
|
||||||
"citus.max_running_tasks_per_node",
|
"citus.max_running_tasks_per_node",
|
||||||
gettext_noop("Sets the maximum number of tasks to run concurrently per node."),
|
gettext_noop("Sets the maximum number of tasks to run concurrently per node."),
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
#ifndef SHARED_CONNECTION_STATS_H
|
#ifndef SHARED_CONNECTION_STATS_H
|
||||||
#define SHARED_CONNECTION_STATS_H
|
#define SHARED_CONNECTION_STATS_H
|
||||||
|
|
||||||
extern int MaxTrackedWorkerNodes;
|
|
||||||
|
|
||||||
extern void InitializeSharedConnectionStats(void);
|
extern void InitializeSharedConnectionStats(void);
|
||||||
extern bool TryToIncrementSharedConnectionCounter(const char *hostname, int port);
|
extern bool TryToIncrementSharedConnectionCounter(const char *hostname, int port);
|
||||||
extern void WaitOrErrorForSharedConnection(const char *hostname, int port);
|
extern void WaitOrErrorForSharedConnection(const char *hostname, int port);
|
||||||
|
|
Loading…
Reference in New Issue