diff options
author | Pavan Deolasee | 2016-03-28 08:29:04 +0000 |
---|---|---|
committer | Pavan Deolasee | 2016-10-18 10:04:34 +0000 |
commit | c661af3eaa555345baff0e73b8039cffe03ef0d3 (patch) | |
tree | 91c23cc914b9cd120795f2c071afb66d2adaf04b | |
parent | 7c02872e36ed7242e6589334ba9dd51e24ab72d4 (diff) |
Use a non-zero default value for max_wal_senders on coordinator and datanode
master
-rw-r--r-- | contrib/pgxc_ctl/config.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/contrib/pgxc_ctl/config.c b/contrib/pgxc_ctl/config.c index b36fa2bc82..b35c4c1f27 100644 --- a/contrib/pgxc_ctl/config.c +++ b/contrib/pgxc_ctl/config.c @@ -1196,6 +1196,13 @@ NodeType getNodeType(char *nodeName) } +#define DEFAULT_PGXC_CTL_MAX_WAL_SENDERS 5 + +/* + * Determine default value for max_wal_senders. We pick up the value specified + * for some other existing coordinator or datanode or return the + * DEFAULT_PGXC_CTL_MAX_WAL_SENDERS value if none is spcified + */ int getDefaultWalSender(int isCoord) { int ii; @@ -1206,8 +1213,11 @@ int getDefaultWalSender(int isCoord) for (ii = 0; aval(names)[ii]; ii++) { if (doesExist(names, ii) && !is_none(aval(names)[ii]) && (atoi(aval(walSender)[ii]) >= 0)) - return atoi(aval(walSender)[ii]); + { + int nsenders = atoi(aval(walSender)[ii]); + return nsenders ? nsenders : DEFAULT_PGXC_CTL_MAX_WAL_SENDERS; + } } - /* If none found, return 5 as the default value.. */ - return 5; + /* If none found, return the default value.. */ + return DEFAULT_PGXC_CTL_MAX_WAL_SENDERS; } |