summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2016-10-04 05:27:00 +0000
committerPavan Deolasee2016-10-18 10:07:48 +0000
commit60410705b5ee50ac147562c9d68e0ec660721a1a (patch)
treefd42390257cd7a21672b15fc9d554a1dbda98858
parent0d4e41c26386e31ab58c97a024bafa1384e67b17 (diff)
Correctly initialise coordMaxWALSenders and datanodeMaxWALSenders while adding
new nodes via pgxc_ctl
-rw-r--r--contrib/pgxc_ctl/coord_cmd.c4
-rw-r--r--contrib/pgxc_ctl/datanode_cmd.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/contrib/pgxc_ctl/coord_cmd.c b/contrib/pgxc_ctl/coord_cmd.c
index ec69a35760..00afd1e52e 100644
--- a/contrib/pgxc_ctl/coord_cmd.c
+++ b/contrib/pgxc_ctl/coord_cmd.c
@@ -967,6 +967,7 @@ int add_coordinatorMaster(char *name, char *host, int port, int pooler,
int size, idx;
char port_s[MAXTOKEN+1];
char pooler_s[MAXTOKEN+1];
+ char max_wal_senders_s[MAXTOKEN+1];
int gtmPxyIdx;
int connCordIndx;
char *gtmHost;
@@ -1039,12 +1040,13 @@ int add_coordinatorMaster(char *name, char *host, int port, int pooler,
*/
snprintf(port_s, MAXTOKEN, "%d", port);
snprintf(pooler_s, MAXTOKEN, "%d", pooler);
+ snprintf(max_wal_senders_s, MAXTOKEN, "%d", getDefaultWalSender(true));
assign_arrayEl(VAR_coordNames, idx, name, NULL);
assign_arrayEl(VAR_coordMasterServers, idx, host, NULL);
assign_arrayEl(VAR_coordPorts, idx, port_s, "-1");
assign_arrayEl(VAR_poolerPorts, idx, pooler_s, NULL);
assign_arrayEl(VAR_coordMasterDirs, idx, dir, NULL);
- assign_arrayEl(VAR_coordMaxWALSenders, idx, aval(VAR_coordMaxWALSenders)[0], "-1"); /* Could be vulnerable */
+ assign_arrayEl(VAR_coordMaxWALSenders, idx, max_wal_senders_s, NULL);
assign_arrayEl(VAR_coordSlaveServers, idx, "none", NULL);
assign_arrayEl(VAR_coordSlavePorts, idx, "none", NULL);
assign_arrayEl(VAR_coordSlavePoolerPorts, idx, "none", NULL);
diff --git a/contrib/pgxc_ctl/datanode_cmd.c b/contrib/pgxc_ctl/datanode_cmd.c
index dff0001e76..4a3b83b325 100644
--- a/contrib/pgxc_ctl/datanode_cmd.c
+++ b/contrib/pgxc_ctl/datanode_cmd.c
@@ -964,7 +964,8 @@ int add_datanodeMaster(char *name, char *host, int port, int pooler, char *dir,
FILE *f, *lockf;
int size, idx;
char port_s[MAXTOKEN+1];
- char pooler_s[MAXTOKEN+1];
+ char pooler_s[MAXTOKEN+1];
+ char max_wal_senders_s[MAXTOKEN+1];
int gtmPxyIdx;
int connCordIdx;
char *gtmHost;
@@ -1072,13 +1073,14 @@ int add_datanodeMaster(char *name, char *host, int port, int pooler, char *dir,
*/
snprintf(port_s, MAXTOKEN, "%d", port);
snprintf(pooler_s, MAXTOKEN, "%d", pooler);
+ snprintf(max_wal_senders_s, MAXTOKEN, "%d", getDefaultWalSender(false));
assign_arrayEl(VAR_datanodeNames, idx, name, NULL);
assign_arrayEl(VAR_datanodeMasterServers, idx, host, NULL);
assign_arrayEl(VAR_datanodePorts, idx, port_s, "-1");
assign_arrayEl(VAR_datanodePoolerPorts, idx, pooler_s, "-1");
assign_arrayEl(VAR_datanodeMasterDirs, idx, dir, NULL);
assign_arrayEl(VAR_datanodeMasterWALDirs, idx, waldir, NULL);
- assign_arrayEl(VAR_datanodeMaxWALSenders, idx, aval(VAR_datanodeMaxWALSenders)[0], NULL); /* Could be vulnerable */
+ assign_arrayEl(VAR_datanodeMaxWALSenders, idx, max_wal_senders_s, NULL);
if (isVarYes(VAR_datanodeSlave))
{
assign_arrayEl(VAR_datanodeSlaveServers, idx, "none", NULL);