summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2014-08-11 11:16:29 +0000
committerPavan Deolasee2014-09-01 14:20:31 +0000
commit254d30805a9b998cd9ed7a3285bc58fd0c8f344a (patch)
treeffd15c7db5b4421fcc1226b08153f3f6a2ed15cb
parent4ab9c483a0da62c17441b8fece7eb34218c54c19 (diff)
Fix configure command so that datanodes are configured too
We now support "configure all", "configure datanode <list>", "configure coordinator <list>" commands so that new datanodes and coordinators can be properly configured when they are added to the cluster. PGXC has the same command, but XL was missing the datanode configuration which is required. Pooler information on the configured node is automatically reloaded, but user may still need to do that on other existing nodes
-rw-r--r--contrib/pgxc_ctl/coord_cmd.c3
-rw-r--r--contrib/pgxc_ctl/coord_cmd.h1
-rw-r--r--contrib/pgxc_ctl/do_command.c14
3 files changed, 14 insertions, 4 deletions
diff --git a/contrib/pgxc_ctl/coord_cmd.c b/contrib/pgxc_ctl/coord_cmd.c
index 7e090108f2..1007a379c2 100644
--- a/contrib/pgxc_ctl/coord_cmd.c
+++ b/contrib/pgxc_ctl/coord_cmd.c
@@ -35,7 +35,6 @@
static int failover_oneCoordinator(int coordIdx);
-static int configure_datanodes(char **nodeList);
static cmd_t *prepare_configureDataNode(char *nodeName);
static char date[MAXTOKEN+1];
@@ -395,7 +394,7 @@ int configure_nodes(char **nodeList)
return(rc);
}
-static int configure_datanodes(char **nodeList)
+int configure_datanodes(char **nodeList)
{
char **actualNodeList;
int ii;
diff --git a/contrib/pgxc_ctl/coord_cmd.h b/contrib/pgxc_ctl/coord_cmd.h
index 84a7b4d141..77f33aaded 100644
--- a/contrib/pgxc_ctl/coord_cmd.h
+++ b/contrib/pgxc_ctl/coord_cmd.h
@@ -21,6 +21,7 @@ extern cmd_t *prepare_initCoordinatorMaster(char *nodeName);
extern cmd_t *prepare_initCoordinatorSlave(char *nodeName);
extern int configure_nodes(char **nodeList);
+extern int configure_datanodes(char **nodeList);
extern int configure_nodes_all(void);
extern cmd_t *prepare_configureNode(char *nodeName);
diff --git a/contrib/pgxc_ctl/do_command.c b/contrib/pgxc_ctl/do_command.c
index 8e418d9e96..33f82b038c 100644
--- a/contrib/pgxc_ctl/do_command.c
+++ b/contrib/pgxc_ctl/do_command.c
@@ -2107,14 +2107,24 @@ static void do_configure_command(char *line)
if (!GetToken() || TestToken("all"))
{
- configure_nodes(aval(VAR_coordNames));
+ configure_nodes_all();
}
else
{
+ if (!TestToken("datanode") && !TestToken("coordinator"))
+ {
+ elog(ERROR, "ERROR: must specify either coordinator or datanode\n");
+ return;
+ }
do
AddMember(nodeList, token);
while (GetToken());
- configure_nodes(nodeList);
+
+ if (TestToken("datanode"))
+ configure_datanodes(nodeList);
+ else
+ configure_nodes(nodeList);
+
CleanArray(nodeList);
}
}