[Postgres-xl-developers] [fix regress]fix datanode start failed for pooler port conflict

Jov amutu at amutu.com
Sun Dec 14 19:08:23 PST 2014


I try to setup a pgxl buildfarm,but find the regress test running failed.I
will try to fix the regress with Series patches for easy review.This is the
first patch fix the datanode start up failed for pooler port conflict.
The Original test case is for pgxc,which only coord nodes have pooler
process.But for pgxl,data nodes also have pooler process.So when the
regress start 2 data nodes,the second datanode will refuse start because
the default pooler port default 6667 which conflict with the first datanode.
To fix the problem, also add pooler_port configure for data node config
file.

diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index fe16e9a..9e4f0c8 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -132,6 +132,8 @@ static int port_gtm = -1;
  */
 static int co1_pooler_port = -1;
 static int co2_pooler_port = -1;
+static int dn1_pooler_port = -1;
+static int dn2_pooler_port = -1;

 /* Data folder of each node */
 const char *data_co1 = "data_co1"; /* Coordinator 1 */
@@ -551,7 +553,9 @@ get_pooler_port(PGXCNodeTypeNum node)
  case PGXC_COORD_2:
  return co2_pooler_port;
  case PGXC_DATANODE_1:
+ return dn1_pooler_port;
  case PGXC_DATANODE_2:
+ return dn2_pooler_port;
  default:
  /* Should not happen */
  return -1;
@@ -851,13 +855,8 @@ set_node_config_file(PGXCNodeTypeNum node)
  snprintf(buf, sizeof(buf), "gtm_port = %d\n", get_port_number(PGXC_GTM));
  fputs(buf, pg_conf);

- /* Set pooler port for Coordinators */
- if (node == PGXC_COORD_1 ||
- node == PGXC_COORD_2)
- {
- snprintf(buf, sizeof(buf), "pooler_port = %d\n", get_pooler_port(node));
- fputs(buf, pg_conf);
- }
+ snprintf(buf, sizeof(buf), "pooler_port = %d\n", get_pooler_port(node));
+ fputs(buf, pg_conf);

  if (temp_config != NULL)
  {
@@ -2812,6 +2811,8 @@ regression_main(int argc, char *argv[], init_function
ifunc, test_function tfunc
  port_gtm = (0xC000 | (PG_VERSION_NUM & 0x3FFF)) + 4;
  co1_pooler_port = (0xC000 | (PG_VERSION_NUM & 0x3FFF)) + 5;
  co2_pooler_port = (0xC000 | (PG_VERSION_NUM & 0x3FFF)) + 6;
+ dn1_pooler_port = (0xC000 | (PG_VERSION_NUM & 0x3FFF)) + 7;
+ dn2_pooler_port = (0xC000 | (PG_VERSION_NUM & 0x3FFF)) + 8;
 #endif

  inputdir = make_absolute_path(inputdir);

Jov
blog: http:amutu.com/blog <http://amutu.com/blog>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20141215/501c16ed/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_pg_regress_start_dn.patch
Type: application/octet-stream
Size: 1681 bytes
Desc: not available
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20141215/501c16ed/attachment.obj>


More information about the Postgres-xl-developers mailing list