You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(28) |
Jun
(12) |
Jul
(11) |
Aug
(12) |
Sep
(5) |
Oct
(19) |
Nov
(14) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(30) |
Mar
(115) |
Apr
(89) |
May
(50) |
Jun
(44) |
Jul
(22) |
Aug
(13) |
Sep
(11) |
Oct
(30) |
Nov
(28) |
Dec
(39) |
2012 |
Jan
(38) |
Feb
(18) |
Mar
(43) |
Apr
(91) |
May
(108) |
Jun
(46) |
Jul
(37) |
Aug
(44) |
Sep
(33) |
Oct
(29) |
Nov
(36) |
Dec
(15) |
2013 |
Jan
(35) |
Feb
(611) |
Mar
(5) |
Apr
(55) |
May
(30) |
Jun
(28) |
Jul
(458) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(22) |
Dec
(32) |
2014 |
Jan
(16) |
Feb
(16) |
Mar
(42) |
Apr
(179) |
May
(7) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
|
2
(6) |
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
(2) |
17
(3) |
18
(1) |
19
|
20
|
21
(8) |
22
(6) |
23
(3) |
24
|
25
|
26
|
27
|
28
(1) |
|
|
|
|
|
From: Michael P. <mic...@us...> - 2011-02-17 05:17:59
|
Project "Postgres-XC". The branch, ha_support has been updated via f42b489b49f366c78d816708d47b380f9db640d9 (commit) via 3fdc303e50d599104c551dc62aaabb369086dd22 (commit) via d8d5bedcbde1f8476617102410b27ac74458f12b (commit) from 61d595c720755a27dfd1d53fb62b60e85f4e2732 (commit) - Log ----------------------------------------------------------------- commit f42b489b49f366c78d816708d47b380f9db640d9 Merge: 61d595c 3fdc303 Author: Michael P <mic...@us...> Date: Thu Feb 17 14:23:59 2011 +0900 Merge branch 'master' into ha_support ----------------------------------------------------------------------- Summary of changes: src/backend/rewrite/rewriteHandler.c | 1 + src/gtm/proxy/proxy_main.c | 8 ++++- src/gtm/recovery/register.c | 49 +++++++++++++++++++++++++++------- src/include/gtm/register.h | 27 +++++++++++------- 4 files changed, 62 insertions(+), 23 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-02-17 05:16:01
|
Project "Postgres-XC". The branch, master has been updated via 3fdc303e50d599104c551dc62aaabb369086dd22 (commit) from d8d5bedcbde1f8476617102410b27ac74458f12b (commit) - Log ----------------------------------------------------------------- commit 3fdc303e50d599104c551dc62aaabb369086dd22 Author: Michael P <mic...@us...> Date: Thu Feb 17 14:19:57 2011 +0900 Multiple INSERT support for MODULO tables MODULO tables use the same distribution mechanism to select nodes as HASH tables (but not the same distribution functions). diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index d9fc689..62875f8 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -2325,6 +2325,7 @@ RewriteInsertStmt(Query *query, RangeTblEntry *values_rte) switch(locatorType) { + case LOCATOR_TYPE_MODULO: case LOCATOR_TYPE_HASH: { bool first = true; ----------------------------------------------------------------------- Summary of changes: src/backend/rewrite/rewriteHandler.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-02-17 01:32:53
|
Project "Postgres-XC". The branch, master has been updated via d8d5bedcbde1f8476617102410b27ac74458f12b (commit) from f01d77a3423159c85cb6efd65cee01910adf793a (commit) - Log ----------------------------------------------------------------- commit d8d5bedcbde1f8476617102410b27ac74458f12b Author: Michael P <mic...@us...> Date: Thu Feb 17 10:31:43 2011 +0900 Fix for bug 3172438: node registration protocol When a node using the same ID as a node, already running and registered, tried to register itself GTM returned an error and the node that failed registration tries to register once again. on GTM. Between the first and second registration, connection to GTM was reinitialiazed, making the node running marked as disconnected. Then the node that failed registration tries a second time and modifies the information of the node already running. At this point, GTM had to return an error but the registration succeeds at the second time. This patch adds some additional control when disconnecting a registered node on GTM by checking the socket ID of the connection used for node registration. This permits to keep consistent data in GTM and proxies for nodes in the cluster. diff --git a/src/gtm/proxy/proxy_main.c b/src/gtm/proxy/proxy_main.c index 9a00bee..d892680 100644 --- a/src/gtm/proxy/proxy_main.c +++ b/src/gtm/proxy/proxy_main.c @@ -1350,7 +1350,8 @@ ProcessPGXCNodeCommand(GTMProxy_ConnectionInfo *conninfo, GTM_Conn *gtm_conn, NODE_CONNECTED, remote_host, cmd_data.cd_reg.datafolder, - false)) + false, + conninfo->con_port->sock)) { ereport(ERROR, (EINVAL, @@ -1376,7 +1377,10 @@ ProcessPGXCNodeCommand(GTMProxy_ConnectionInfo *conninfo, GTM_Conn *gtm_conn, oldContext = MemoryContextSwitchTo(TopMostMemoryContext); /* Unregister Node also on Proxy */ - if (Recovery_PGXCNodeUnregister(cmd_data.cd_reg.type, cmd_data.cd_reg.nodenum, false)) + if (Recovery_PGXCNodeUnregister(cmd_data.cd_reg.type, + cmd_data.cd_reg.nodenum, + false, + conninfo->con_port->sock)) { ereport(ERROR, (EINVAL, diff --git a/src/gtm/recovery/register.c b/src/gtm/recovery/register.c index 766072d..163a860 100644 --- a/src/gtm/recovery/register.c +++ b/src/gtm/recovery/register.c @@ -163,8 +163,11 @@ pgxcnode_add_info(GTM_PGXCNodeInfo *nodeinfo) else { /* - * Check if its data (port, datafolder and remote IP) has changed - * and modify it + * Node has been disconnected abruptly. + * And we are sure that disconnections are not done by other node + * trying to use the same ID. + * So check if its data (port, datafolder and remote IP) has changed + * and modify it. */ if (!pgxcnode_port_equal(curr_nodeinfo->port, nodeinfo->port)) curr_nodeinfo->port = nodeinfo->port; @@ -193,6 +196,9 @@ pgxcnode_add_info(GTM_PGXCNodeInfo *nodeinfo) /* Reconnect a disconnected node */ curr_nodeinfo->status = NODE_CONNECTED; + + /* Set socket number with the new one */ + curr_nodeinfo->socket = nodeinfo->socket; GTM_RWLockRelease(&bucket->nhb_lock); return 0; } @@ -236,12 +242,19 @@ pgxcnode_copy_char(const char *str) * Unregister the given node */ int -Recovery_PGXCNodeUnregister(GTM_PGXCNodeType type, GTM_PGXCNodeId nodenum, bool in_recovery) +Recovery_PGXCNodeUnregister(GTM_PGXCNodeType type, GTM_PGXCNodeId nodenum, bool in_recovery, int socket) { GTM_PGXCNodeInfo *nodeinfo = pgxcnode_find_info(type, nodenum); if (nodeinfo != NULL) { + /* + * Unregistration has to be made by the same connection as the one used for registration + * or the one that reconnected the node. + */ + if (!in_recovery && socket != nodeinfo->socket) + return EINVAL; + pgxcnode_remove_info(nodeinfo); /* Add a record to file on disk saying that this node has been unregistered correctly */ @@ -266,7 +279,8 @@ Recovery_PGXCNodeRegister(GTM_PGXCNodeType type, GTM_PGXCNodeStatus status, char *ipaddress, char *datafolder, - bool in_recovery) + bool in_recovery, + int socket) { GTM_PGXCNodeInfo *nodeinfo = NULL; int errcode = 0; @@ -286,6 +300,7 @@ Recovery_PGXCNodeRegister(GTM_PGXCNodeType type, nodeinfo->datafolder = pgxcnode_copy_char(datafolder); nodeinfo->ipaddress = pgxcnode_copy_char(ipaddress); nodeinfo->status = status; + nodeinfo->socket = socket; /* Add PGXC Node Info to the global hash table */ errcode = pgxcnode_add_info(nodeinfo); @@ -384,7 +399,7 @@ ProcessPGXCNodeRegister(Port *myport, StringInfo message) if (Recovery_PGXCNodeRegister(type, nodenum, port, proxynum, NODE_CONNECTED, - ipaddress, datafolder, false)) + ipaddress, datafolder, false, myport->sock)) { ereport(ERROR, (EINVAL, @@ -438,7 +453,7 @@ ProcessPGXCNodeUnregister(Port *myport, StringInfo message) */ oldContext = MemoryContextSwitchTo(TopMostMemoryContext); - if (Recovery_PGXCNodeUnregister(type, nodenum, false)) + if (Recovery_PGXCNodeUnregister(type, nodenum, false, myport->sock)) { ereport(ERROR, (EINVAL, @@ -652,9 +667,9 @@ Recovery_RestoreRegisterInfo(void) /* Rebuild based on the records */ if (magic == NodeRegisterMagic) Recovery_PGXCNodeRegister(type, nodenum, port, proxynum, status, - ipaddress, datafolder, true); + ipaddress, datafolder, true, 0); else - Recovery_PGXCNodeUnregister(type, nodenum, true); + Recovery_PGXCNodeUnregister(type, nodenum, true, 0); read(ctlfd, &magic, sizeof(NodeEndMagic)); @@ -703,9 +718,14 @@ Recovery_PGXCNodeDisconnect(Port *myport) if (nodeinfo != NULL) { + /* Disconnection cannot be made with another socket than the one used for registration */ + if (myport->sock != nodeinfo->socket) + return; + GTM_RWLockAcquire(&nodeinfo->node_lock, GTM_LOCKMODE_WRITE); nodeinfo->status = NODE_DISCONNECTED; + nodeinfo->socket = 0; GTM_RWLockRelease(&nodeinfo->node_lock); } @@ -714,16 +734,25 @@ Recovery_PGXCNodeDisconnect(Port *myport) } int -Recovery_PGXCNodeBackendDisconnect(GTM_PGXCNodeType type, GTM_PGXCNodeId nodenum) +Recovery_PGXCNodeBackendDisconnect(GTM_PGXCNodeType type, GTM_PGXCNodeId nodenum, int socket) { GTM_PGXCNodeInfo *nodeinfo = pgxcnode_find_info(type, nodenum); int errcode = 0; + if (nodeinfo != NULL) { + /* + * A node can be only disconnected by the same connection as the one used for registration + * or reconnection. + */ + if (socket != nodeinfo->socket) + return -1; + GTM_RWLockAcquire(&nodeinfo->node_lock, GTM_LOCKMODE_WRITE); nodeinfo->status = NODE_DISCONNECTED; + nodeinfo->socket = 0; GTM_RWLockRelease(&nodeinfo->node_lock); } @@ -770,7 +799,7 @@ ProcessPGXCNodeBackendDisconnect(Port *myport, StringInfo message) */ oldContext = MemoryContextSwitchTo(TopMostMemoryContext); - if (Recovery_PGXCNodeBackendDisconnect(type, nodenum) < 0) + if (Recovery_PGXCNodeBackendDisconnect(type, nodenum, myport->sock) < 0) { elog(LOG, "Cannot disconnect Unregistered node"); } diff --git a/src/include/gtm/register.h b/src/include/gtm/register.h index 0e4b23f..9b11d1d 100644 --- a/src/include/gtm/register.h +++ b/src/include/gtm/register.h @@ -40,14 +40,15 @@ typedef enum GTM_PGXCNodeStatus typedef struct GTM_PGXCNodeInfo { - GTM_PGXCNodeType type; - GTM_PGXCNodeId nodenum; - GTM_PGXCNodeId proxynum; - GTM_PGXCNodePort port; - char *ipaddress; - char *datafolder; - GTM_PGXCNodeStatus status; - GTM_RWLock node_lock; + GTM_PGXCNodeType type; /* Type of node */ + GTM_PGXCNodeId nodenum; /* Node number */ + GTM_PGXCNodeId proxynum; /* Proxy number the node goes through */ + GTM_PGXCNodePort port; /* Port number of the node */ + char *ipaddress; /* IP address of the nodes */ + char *datafolder; /* Data folder of the node */ + GTM_PGXCNodeStatus status; /* Node status */ + GTM_RWLock node_lock; /* Lock on this structure */ + int socket; /* socket number used for registration */ } GTM_PGXCNodeInfo; int Recovery_PGXCNodeRegister(GTM_PGXCNodeType type, @@ -57,9 +58,13 @@ int Recovery_PGXCNodeRegister(GTM_PGXCNodeType type, GTM_PGXCNodeStatus status, char *ipaddress, char *datafolder, - bool in_recovery); -int Recovery_PGXCNodeUnregister(GTM_PGXCNodeType type, GTM_PGXCNodeId nodenum, bool in_recovery); -int Recovery_PGXCNodeBackendDisconnect(GTM_PGXCNodeType type, GTM_PGXCNodeId nodenum); + bool in_recovery, + int socket); +int Recovery_PGXCNodeUnregister(GTM_PGXCNodeType type, + GTM_PGXCNodeId nodenum, + bool in_recovery, + int socket); +int Recovery_PGXCNodeBackendDisconnect(GTM_PGXCNodeType type, GTM_PGXCNodeId nodenum, int socket); void Recovery_RecordRegisterInfo(GTM_PGXCNodeInfo *nodeinfo, bool is_register); void Recovery_RestoreRegisterInfo(void); ----------------------------------------------------------------------- Summary of changes: src/gtm/proxy/proxy_main.c | 8 +++++- src/gtm/recovery/register.c | 49 ++++++++++++++++++++++++++++++++++-------- src/include/gtm/register.h | 27 ++++++++++++++--------- 3 files changed, 61 insertions(+), 23 deletions(-) hooks/post-receive -- Postgres-XC |