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
(3) |
2
(5) |
3
|
4
(4) |
5
|
6
|
7
(7) |
8
(10) |
9
(6) |
10
(5) |
11
(1) |
12
|
13
|
14
|
15
|
16
|
17
(4) |
18
(1) |
19
|
20
|
21
(5) |
22
(15) |
23
(18) |
24
(7) |
25
(4) |
26
|
27
|
28
(3) |
29
(2) |
30
(11) |
31
(4) |
|
|
From: Michael P. <mic...@us...> - 2011-03-01 23:27:10
|
Project "Postgres-XC". The branch, ha_support has been updated via 482825deb075f295fc349fa3bb3fda8ca46d92df (commit) from 0941c9d8ff92110c176f8c2a01011b473c2b7951 (commit) - Log ----------------------------------------------------------------- commit 482825deb075f295fc349fa3bb3fda8ca46d92df Author: Michael P <mic...@us...> Date: Wed Mar 2 08:31:27 2011 +0900 Correction of error messages for XCM interface. diff --git a/src/backend/pgxc/pool/mirror.c b/src/backend/pgxc/pool/mirror.c index b7bfbc5..9b22747 100644 --- a/src/backend/pgxc/pool/mirror.c +++ b/src/backend/pgxc/pool/mirror.c @@ -2,10 +2,10 @@ * * mirror.c * - * File containing API to interact with Fault Sync module + * File containing API to interact with XCM module * It is necessary to activate the GUC parameter mirror_mode * to call the APIs of this file. - * Only this file is authorized to call APIs of Fault Sync + * Only this file is authorized to call APIs of XCM * * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 2010-2011 Nippon Telegraph and Telephone Corporation @@ -90,7 +90,7 @@ PGXCMirror_GetPrimaryDatanodeID(void) { int primary_id = 0; /* - * Get the primary node parameters from Fault Sync module + * Get the primary node parameters from XCM module * In other cases GUC params have all the necessary data. */ if (IsXCM) @@ -98,7 +98,7 @@ PGXCMirror_GetPrimaryDatanodeID(void) if (get_xcm_primary_datanode(&primary_id) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get primary node ID"))); + errmsg("XCM ERROR: could not get primary node ID"))); } return primary_id; @@ -123,7 +123,7 @@ PGXCMirror_GetPrimaryMirrorID(void) if (get_xcm_primary_mirror(datanode_id, &mirror_id) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get primary mirror ID"))); + errmsg("XCM ERROR: could not get primary mirror ID"))); Assert(datanode_id <= NumDataNodes && datanode_id > 0); Assert(mirror_id < PGXCMirror_GetMirrorCount(datanode_id)); @@ -148,7 +148,7 @@ PGXCMirror_GetPreferredNodeID(bool is_datanode) if (get_xcm_preferred_mirror(PGXCNodeId, &datanode_id, &mirror_id) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get primary mirror ID"))); + errmsg("XCM ERROR: could not get primary mirror ID"))); Assert(datanode_id <= NumDataNodes && datanode_id > 0); Assert(mirror_id < PGXCMirror_GetMirrorCount(datanode_id)); @@ -191,7 +191,7 @@ PGXCMirror_SetMirrorCountList(void) if (get_xcm_mirror_count(i + 1, &mirror_count) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get Mirror count"))); + errmsg("XCM ERROR: could not get Mirror count"))); PGXCNodeMirrorCount[i] = mirror_count; MirrorTotalCount += PGXCNodeMirrorCount[i]; } @@ -683,7 +683,7 @@ PGXCMirror_GetLocalGTMHost(void) if (err < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get GTM information"))); + errmsg("XCM ERROR: could not get GTM information"))); /* Need Connection points for GTM or Proxy */ if (gtm_id > 0) @@ -720,7 +720,7 @@ PGXCMirror_GetLocalGTMPort(void) if (err < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get GTM information"))); + errmsg("XCM ERROR: could not get GTM information"))); /* Need Connection points for GTM or Proxy */ if (gtm_id > 0) @@ -778,7 +778,7 @@ PGXCMirror_ReportCoordFail(int pgxc_node_id) if (PGXCMirror_ReportFail(REMOTE_CONN_COORD, pgxc_node_id, 0) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not report failed Coordinator"))); + errmsg("XCM ERROR: could not report failed Coordinator"))); } void @@ -790,7 +790,7 @@ PGXCMirror_ReportDataNodeFail(int pgxc_node_id, int mirror_id) if (PGXCMirror_ReportFail(REMOTE_CONN_DATANODE, pgxc_node_id, mirror_id) < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not report failed Datanode"))); + errmsg("XCM ERROR: could not report failed Datanode"))); } /* @@ -824,7 +824,7 @@ report_error: if (err < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not report failed GTM"))); + errmsg("XCM ERROR: could not report failed GTM"))); } /* @@ -860,7 +860,7 @@ PGXCMirror_CheckStatus(RemoteConnTypes conn_type, int pgxc_node_id, int mirror_i if (err < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get Node Status"))); + errmsg("XCM ERROR: could not get Node Status"))); return status; } @@ -1065,7 +1065,7 @@ PGXCMirror_GetConnPoint(RemoteConnTypes conn_type, if (err < 0) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Fault Sync ERROR: could not get Node Host data"))); + errmsg("XCM ERROR: could not get Node Host data"))); return conn_pts; } ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/pool/mirror.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-01 07:51:07
|
Project "Postgres-XC". The branch, ha_support has been updated via 0941c9d8ff92110c176f8c2a01011b473c2b7951 (commit) via 21639943c3c4402d029261e143b27733e39c7c07 (commit) from 180e27c030b192a782dc5312420b38caf83abcb8 (commit) - Log ----------------------------------------------------------------- commit 0941c9d8ff92110c176f8c2a01011b473c2b7951 Author: Michael P <mic...@us...> Date: Tue Mar 1 16:53:42 2011 +0900 Fix for XCM used without mirror mode In Normal mode, the static array holding mirror count for each datanode is not set, causing problems a crash on pooler side when XCM is used to build the host and port arrays for Datanodes. diff --git a/src/backend/pgxc/pool/mirror.c b/src/backend/pgxc/pool/mirror.c index fd51b4d..b7bfbc5 100644 --- a/src/backend/pgxc/pool/mirror.c +++ b/src/backend/pgxc/pool/mirror.c @@ -534,12 +534,17 @@ PGXCMirror_GetHostTotalString(RemoteConnTypes conn_type) } else if (conn_type == REMOTE_CONN_DATANODE) { + /* + * If mirror mode is not active, it means that there is only + * 1 single mirror for a datanode, which is the normal mode... + */ + int num_mirrors = IsPGXCMirrorMode ? PGXCNodeMirrorCount[i] : 1; int count; /* Build Datanode Host string */ - Assert(PGXCNodeMirrorCount[i] > 0); + Assert(num_mirrors > 0); - for (count = 0; count < PGXCNodeMirrorCount[i]; count++) + for (count = 0; count < num_mirrors; count++) { int local_len; char *buf; @@ -614,12 +619,17 @@ PGXCMirror_GetPortTotalString(RemoteConnTypes conn_type) } else if (conn_type == REMOTE_CONN_DATANODE) { + /* + * If mirror mode is not active, it means that there is only + * 1 single mirror for a datanode, which is the normal mode... + */ + int num_mirrors = IsPGXCMirrorMode ? PGXCNodeMirrorCount[i] : 1; int count; /* Build Datanode Host string */ - Assert(PGXCNodeMirrorCount[i] > 0); + Assert(num_mirrors > 0); - for (count = 0; count < PGXCNodeMirrorCount[i]; count++) + for (count = 0; count < num_mirrors; count++) { int local_len; char *buf; commit 21639943c3c4402d029261e143b27733e39c7c07 Author: Michael P <mic...@us...> Date: Tue Mar 1 16:43:20 2011 +0900 Fix to avoid Datanodes to unregister if they are not primary diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 71da4c2..984b3be 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -2215,7 +2215,7 @@ pmdie(SIGNAL_ARGS) /* Unregister Node on GTM */ if (IS_PGXC_COORDINATOR) UnregisterGTM(PGXC_NODE_COORDINATOR); - else if (IS_PGXC_DATANODE) + else if (IS_PGXC_DATANODE && IsPrimaryMirror) UnregisterGTM(PGXC_NODE_DATANODE); #endif pmState = PM_WAIT_BACKUP; @@ -2273,7 +2273,7 @@ pmdie(SIGNAL_ARGS) /* Unregister Node on GTM */ if (IS_PGXC_COORDINATOR) UnregisterGTM(PGXC_NODE_COORDINATOR); - else if (IS_PGXC_DATANODE) + else if (IS_PGXC_DATANODE && IsPrimaryMirror) UnregisterGTM(PGXC_NODE_DATANODE); #endif pmState = PM_WAIT_BACKENDS; ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/pool/mirror.c | 18 ++++++++++++++---- src/backend/postmaster/postmaster.c | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-01 01:44:56
|
Project "Postgres-XC". The branch, ha_support has been updated via 180e27c030b192a782dc5312420b38caf83abcb8 (commit) via 162d967054136baf6bc9cc35f286c771197af71b (commit) via 51cabe99e820989af4634ef7113a294563e8820c (commit) from bd357d3c92dcd3d7bb82ba63d942ba3841cff751 (commit) - Log ----------------------------------------------------------------- commit 180e27c030b192a782dc5312420b38caf83abcb8 Merge: 162d967 51cabe9 Author: Michael P <mic...@us...> Date: Tue Mar 1 10:49:45 2011 +0900 Merge branch 'master' into ha_support Conflicts: src/backend/pgxc/pool/execRemote.c diff --cc src/backend/pgxc/pool/execRemote.c index 4570bdf,dc1d68c..809d08f --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@@ -4607,93 -4572,54 +4607,146 @@@ PGXCNodeGetNodeList(PGXC_NodeId **datan } /* + * Build 2PC Data. + * This is made by a remote Coordinator that is preparing in PrepareTransaction() + * or in CommitTransaction for a Coordinator not preparing. + * + * Data has to be built before sending it to backend nodes. + */ +void +PGXCNode_Build2PCData(bool isimplicit) +{ + PGXCNodeAllHandles *pgxc_handles = pgxc_get_all_transaction_nodes(false); + int co_conn_count = pgxc_handles->co_conn_count; + int dn_conn_count = pgxc_handles->dn_conn_count; + PGXC_NodeId *datanodes = NULL; + int i; + + PGXC_2PCData = (Remote2PCData *) malloc(sizeof(Remote2PCData)); + + PGXC_2PCData->isddl = co_conn_count > 0; + PGXC_2PCData->isimplicit = isimplicit; + PGXC_2PCData->coordnum = PGXCNodeId; + PGXC_2PCData->nodelist = NULL; + + /* + * Build the node list string. + * Format is guc based nodenum1,nodenum2,...,nodenumN + */ + if (dn_conn_count != 0) + { + char buffer[NODELISTSIZE]; + + datanodes = collect_pgxcnode_numbers(dn_conn_count, + pgxc_handles->datanode_handles, REMOTE_CONN_DATANODE); + + sprintf(buffer, "%d", datanodes[0]); + + for (i = 1; i < dn_conn_count; i++) + { + sprintf(buffer, "%s,%d", buffer, datanodes[i]); + } + + PGXC_2PCData->nodelist = (char *) malloc(strlen(buffer) + 1); + memcpy(PGXC_2PCData->nodelist, buffer, strlen(buffer) + 1); + } + else + { + /* This case corresponds to Sequence DDL where only Coordinators are prepared */ + PGXC_2PCData->nodelist = (char *) malloc(2); + sprintf(PGXC_2PCData->nodelist,"n"); + PGXC_2PCData->nodelist[1] = '\0'; + } +} + +/* + * Set 2PC Data received from remote Coordinator. + * This can just be called by a backend node. + */ +void +PGXCNode_Set2PCData(bool isddl, bool isimplicit, int coordnum, const char *nodelist) +{ + PGXC_2PCData = (Remote2PCData *) malloc(sizeof(Remote2PCData)); + + /* Fill in 2PC Data received from other node */ + PGXC_2PCData->isddl = isddl; + PGXC_2PCData->isimplicit = isimplicit; + PGXC_2PCData->coordnum = coordnum; + + PGXC_2PCData->nodelist = (char *) malloc(strlen(nodelist) + 1); + memcpy(PGXC_2PCData->nodelist, nodelist, strlen(nodelist) + 1); +} + +void +PGXCNode_Unset2PCData(void) +{ + if (PGXC_2PCData) + { + if (PGXC_2PCData->nodelist) + free(PGXC_2PCData->nodelist); + free(PGXC_2PCData); + } +} + +/* + * Return 2PC Data necessary to mark the transaction as preparing + * This data is saved in the static list of prepared xacts when marked as preparing. + */ +Remote2PCData* +PGXCNode_Get2PCData(void) +{ + return PGXC_2PCData; +} ++ ++/* + * DataNodeCopyInBinaryForAll + * + * In a COPY TO, send to all datanodes PG_HEADER for a COPY TO in binary mode. + */ + int DataNodeCopyInBinaryForAll(char *msg_buf, int len, PGXCNodeHandle** copy_connections) + { + int i; + int conn_count = 0; + PGXCNodeHandle *connections[NumDataNodes]; + int msgLen = 4 + len + 1; + int nLen = htonl(msgLen); + + for (i = 0; i < NumDataNodes; i++) + { + PGXCNodeHandle *handle = copy_connections[i]; + + if (!handle) + continue; + + connections[conn_count++] = handle; + } + + for (i = 0; i < conn_count; i++) + { + PGXCNodeHandle *handle = connections[i]; + if (handle->state == DN_CONNECTION_STATE_COPY_IN) + { + /* msgType + msgLen */ + if (ensure_out_buffer_capacity(handle->outEnd + 1 + msgLen, handle) != 0) + { + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of memory"))); + } + + handle->outBuffer[handle->outEnd++] = 'd'; + memcpy(handle->outBuffer + handle->outEnd, &nLen, 4); + handle->outEnd += 4; + memcpy(handle->outBuffer + handle->outEnd, msg_buf, len); + handle->outEnd += len; + handle->outBuffer[handle->outEnd++] = '\n'; + } + else + { + add_error_message(handle, "Invalid data node connection"); + return EOF; + } + } + + return 0; + } commit 162d967054136baf6bc9cc35f286c771197af71b Author: Michael P <mic...@us...> Date: Tue Mar 1 10:41:40 2011 +0900 Correction for EXECUTE DIRECT For an EXECUTE DIRECT on a backend Coordinator, the node list was not set correctly, causing XCM to return an error due to an incorrect node number. There is also a fix for utility statements on backend mirrors so as to launch the utility on all the mirrors when not choosing a node number. diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 9cd45a1..ca715e0 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2115,12 +2115,14 @@ transformExecDirectStmt(ParseState *pstate, ExecDirectStmt *stmt) (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Cannot use Mirror ID format for Coordinator"))); - if (node->data_node_id > NumDataNodes) + if (node->data_node_id > NumDataNodes || + node->data_node_id < 1) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Node Number %d is incorrect", node->data_node_id))); - if (node->mirror_id > PGXCMirror_GetMirrorCount(node->data_node_id)) + if (node->mirror_id > PGXCMirror_GetMirrorCount(node->data_node_id) || + node->mirror_id < 1) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Mirror Number %d is incorrect", node->mirror_id))); @@ -2144,6 +2146,7 @@ transformExecDirectStmt(ParseState *pstate, ExecDirectStmt *stmt) else { int nodenum = intVal(lfirst(nodeitem)); + if (nodenum < 1 || (!is_coordinator && nodenum > total_num_nodes) || (is_coordinator && nodenum > total_num_nodes)) @@ -2266,14 +2269,17 @@ transformExecDirectStmt(ParseState *pstate, ExecDirectStmt *stmt) * for a SELECT command pick up only one node in the subset * for a UTILITY command pick up the whole subset * If node number is mirror format dn_id/mirror_id, keep it as it is. + * For a Coordinator, just use the node number. */ - if (step->exec_direct_type == EXEC_DIRECT_LOCAL_UTILITY && + if (step->exec_direct_type == EXEC_DIRECT_UTILITY && IsPGXCMirrorMode && - !nodenum_defined) + !nodenum_defined && + !is_coordinator) step->exec_nodes->nodelist = PGXCMirror_GetSubsetMirrors(nodenum, true); else if (step->exec_direct_type == EXEC_DIRECT_SELECT && IsPGXCMirrorMode && - !nodenum_defined) + !nodenum_defined && + !is_coordinator) step->exec_nodes->nodelist = PGXCMirror_GetSubsetMirrors(nodenum, false); else if (nodenum_defined) /* Node Number where to run has already been calculated */ step->exec_nodes->nodelist = lappend_int(step->exec_nodes->nodelist, nodenum_real); ----------------------------------------------------------------------- Summary of changes: src/backend/commands/copy.c | 90 ++++++++++++++++++++++++++++++++++++ src/backend/parser/analyze.c | 16 ++++-- src/backend/pgxc/pool/execRemote.c | 53 +++++++++++++++++++++ src/include/pgxc/execRemote.h | 1 + 4 files changed, 155 insertions(+), 5 deletions(-) hooks/post-receive -- Postgres-XC |