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
(1) |
3
|
4
|
5
(1) |
6
|
7
(2) |
8
|
9
|
10
|
11
|
12
(1) |
13
(1) |
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
(5) |
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
31
|
From: mason_s <ma...@us...> - 2010-07-07 13:34:41
|
Project "Postgres-XC". The branch, master has been updated via 8ce8906c2d45e0aa1164c9beaedb2637853a2e03 (commit) from 5800b1b7b84dac3759f25a4a37afcb2ed26a1a63 (commit) - Log ----------------------------------------------------------------- commit 8ce8906c2d45e0aa1164c9beaedb2637853a2e03 Author: Mason S <masonsharp@mason-sharps-macbook.local> Date: Wed Jul 7 15:33:45 2010 +0200 Fix a crash that may occur within the pooler when a data node crashes. Written by Andrei Matsinchyk diff --git a/src/backend/pgxc/pool/poolmgr.c b/src/backend/pgxc/pool/poolmgr.c index 79106b5..6427da3 100644 --- a/src/backend/pgxc/pool/poolmgr.c +++ b/src/backend/pgxc/pool/poolmgr.c @@ -4,15 +4,15 @@ * * Connection pool manager handles connections to DataNodes * - * The pooler runs as a separate process and is forked off from a - * coordinator postmaster. If the coordinator needs a connection from a + * The pooler runs as a separate process and is forked off from a + * coordinator postmaster. If the coordinator needs a connection from a * data node, it asks for one from the pooler, which maintains separate * pools for each data node. A group of connections can be requested in - * a single request, and the pooler returns a list of file descriptors + * a single request, and the pooler returns a list of file descriptors * to use for the connections. * * Note the current implementation does not yet shrink the pool over time - * as connections are idle. Also, it does not queue requests; if a + * as connections are idle. Also, it does not queue requests; if a * connection is unavailable, it will simply fail. This should be implemented * one day, although there is a chance for deadlocks. For now, limiting * connections should be done between the application and coordinator. @@ -113,8 +113,8 @@ extern int pqReadReady(PGconn *conn); static volatile sig_atomic_t shutdown_requested = false; -/* - * Initialize internal structures +/* + * Initialize internal structures */ int PoolManagerInit() @@ -433,8 +433,8 @@ PoolManagerInit() } -/* - * Destroy internal structures +/* + * Destroy internal structures */ int PoolManagerDestroy(void) @@ -575,8 +575,8 @@ PoolManagerConnect(PoolHandle *handle, const char *database) } -/* - * Init PoolAgent +/* + * Init PoolAgent */ static void agent_init(PoolAgent *agent, const char *database, List *nodes) @@ -598,8 +598,8 @@ agent_init(PoolAgent *agent, const char *database, List *nodes) } -/* - * Destroy PoolAgent +/* + * Destroy PoolAgent */ static void agent_destroy(PoolAgent *agent) @@ -636,8 +636,8 @@ agent_destroy(PoolAgent *agent) } -/* - * Release handle to pool manager +/* + * Release handle to pool manager */ void PoolManagerDisconnect(PoolHandle *handle) @@ -653,8 +653,8 @@ PoolManagerDisconnect(PoolHandle *handle) } -/* - * Get pooled connections +/* + * Get pooled connections */ int * PoolManagerGetConnections(List *nodelist) @@ -759,7 +759,7 @@ agent_handle_input(PoolAgent * agent, StringInfo s) } -/* +/* * acquire connection */ static int * @@ -827,8 +827,8 @@ agent_acquire_connections(PoolAgent *agent, List *nodelist) } -/* - * Retun connections back to the pool +/* + * Retun connections back to the pool */ void PoolManagerReleaseConnections(void) @@ -972,8 +972,8 @@ destroy_database_pool(const char *database) } -/* - * Insert new database pool to the list +/* + * Insert new database pool to the list */ static void insert_database_pool(DatabasePool *databasePool) @@ -991,8 +991,8 @@ insert_database_pool(DatabasePool *databasePool) } -/* - * Find pool for specified database in the list +/* + * Find pool for specified database in the list */ static DatabasePool * @@ -1015,8 +1015,8 @@ find_database_pool(const char *database) } -/* - * Remove pool for specified database from the list +/* + * Remove pool for specified database from the list */ static DatabasePool * remove_database_pool(const char *database) @@ -1075,41 +1075,40 @@ acquire_connection(DatabasePool *dbPool, int node) } /* Check available connections */ - if (nodePool && nodePool->freeSize > 0) + while (nodePool && nodePool->freeSize > 0) { int poll_result; - while (nodePool->freeSize > 0) - { - slot = nodePool->slot[--(nodePool->freeSize)]; + slot = nodePool->slot[--(nodePool->freeSize)]; retry: - /* Make sure connection is ok */ - poll_result = pqReadReady(slot->conn); - - if (poll_result == 0) - break; /* ok, no data */ - else if (poll_result < 0) - { - if (errno == EAGAIN || errno == EINTR) - goto retry; + /* Make sure connection is ok */ + poll_result = pqReadReady(slot->conn); - elog(WARNING, "Error in checking connection, errno = %d", errno); - } - else - elog(WARNING, "Unexpected data on connection, cleaning."); + if (poll_result == 0) + break; /* ok, no data */ + else if (poll_result < 0) + { + if (errno == EAGAIN || errno == EINTR) + goto retry; - destroy_slot(slot); - /* Decrement current max pool size */ - (nodePool->size)--; - /* Ensure we are not below minimum size */ - grow_pool(dbPool, node - 1); + elog(WARNING, "Error in checking connection, errno = %d", errno); } + else + elog(WARNING, "Unexpected data on connection, cleaning."); + + destroy_slot(slot); + slot = NULL; + + /* Decrement current max pool size */ + (nodePool->size)--; + /* Ensure we are not below minimum size */ + grow_pool(dbPool, node - 1); } - else - ereport(LOG, - (errcode(ERRCODE_INSUFFICIENT_RESOURCES), - errmsg("connection pool is empty"))); + + if (slot == NULL) + elog(WARNING, "can not connect to data node %d", node); + return slot; } ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/pool/poolmgr.c | 101 +++++++++++++++++++-------------------- 1 files changed, 50 insertions(+), 51 deletions(-) hooks/post-receive -- Postgres-XC |
From: mason_s <ma...@us...> - 2010-07-07 13:33:07
|
Project "Postgres-XC". The branch, master has been updated via 5800b1b7b84dac3759f25a4a37afcb2ed26a1a63 (commit) via 73249fbb42f4c05de85181428a7ae143c0c8d254 (commit) from 47f4b06f6e25426bb775d7a7372309b68c7e1f47 (commit) - Log ----------------------------------------------------------------- commit 5800b1b7b84dac3759f25a4a37afcb2ed26a1a63 Author: Mason S <masonsharp@mason-sharps-macbook.local> Date: Wed Jul 7 15:31:15 2010 +0200 In Postgres-XC, the error stack may overflow because AbortTransaction may be called multiple times, each time calling DataNodeRollback, which may fail again if a data node is down. Instead, if we are already in an abort state, we do not bother repeating abort actions. diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 757f99d..491d0d5 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -2697,6 +2697,20 @@ AbortCurrentTransaction(void) } } +#ifdef PGXC +/* + * AbortCurrentTransactionOnce + * + * Abort transaction, but only if we have not already. + */ +void +AbortCurrentTransactionOnce(void) +{ + if (CurrentTransactionState->state != TRANS_ABORT) + AbortCurrentTransaction(); +} +#endif + /* * PreventTransactionChain * diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 4cb0b27..553a682 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3768,7 +3768,15 @@ PostgresMain(int argc, char *argv[], const char *username) /* * Abort the current transaction in order to recover. */ +#ifdef PGXC + /* + * Temporarily do not abort if we are already in an abort state. + * This change tries to handle the case where the error data stack fills up. + */ + AbortCurrentTransactionOnce(); +#else AbortCurrentTransaction(); +#endif /* * Now return to normal top-level context and clear ErrorContext for diff --git a/src/include/access/xact.h b/src/include/access/xact.h index fe69611..5bd157b 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -163,6 +163,9 @@ extern void CommandCounterIncrement(void); extern void ForceSyncCommit(void); extern void StartTransactionCommand(void); extern void CommitTransactionCommand(void); +#ifdef PGXC +extern void AbortCurrentTransactionOnce(void); +#endif extern void AbortCurrentTransaction(void); extern void BeginTransactionBlock(void); extern bool EndTransactionBlock(void); commit 73249fbb42f4c05de85181428a7ae143c0c8d254 Author: Mason S <masonsharp@mason-sharps-macbook.local> Date: Wed Jul 7 15:30:16 2010 +0200 Changed some error messages so that they will not be duplicates to better pinpoint some issues. diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index 1ee1d59..c6f9042 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -475,7 +475,7 @@ HandleCopyOutComplete(RemoteQueryState *combiner) /* Inconsistent responses */ ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes for 'c' message, current request type %d", combiner->request_type))); /* Just do nothing, close message is managed by the coordinator */ combiner->copy_out_count++; } @@ -559,7 +559,7 @@ HandleRowDescription(RemoteQueryState *combiner, char *msg_body, size_t len) /* Inconsistent responses */ ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes for 'T' message, current request type %d", combiner->request_type))); } /* Increment counter and check if it was first */ if (combiner->description_count++ == 0) @@ -583,7 +583,7 @@ HandleParameterStatus(RemoteQueryState *combiner, char *msg_body, size_t len) /* Inconsistent responses */ ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes for 'S' message, current request type %d", combiner->request_type))); } /* Proxy last */ if (++combiner->description_count == combiner->node_count) @@ -605,7 +605,7 @@ HandleCopyIn(RemoteQueryState *combiner) /* Inconsistent responses */ ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes for 'G' message, current request type %d", combiner->request_type))); } /* * The normal PG code will output an G message when it runs in the @@ -627,7 +627,7 @@ HandleCopyOut(RemoteQueryState *combiner) /* Inconsistent responses */ ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes for 'H' message, current request type %d", combiner->request_type))); } /* * The normal PG code will output an H message when it runs in the @@ -649,7 +649,7 @@ HandleCopyDataRow(RemoteQueryState *combiner, char *msg_body, size_t len) if (combiner->request_type != REQUEST_TYPE_COPY_OUT) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes for 'd' message, current request type %d", combiner->request_type))); /* If there is a copy file, data has to be sent to the local file */ if (combiner->copy_file) @@ -675,7 +675,7 @@ HandleDataRow(RemoteQueryState *combiner, char *msg_body, size_t len) /* Inconsistent responses */ ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes for 'D' message, current request type %d", combiner->request_type))); } /* @@ -943,7 +943,8 @@ data_node_receive_responses(const int conn_count, DataNodeHandle ** connections, data_node_receive(count, to_receive, timeout); while (i < count) { - switch (handle_response(to_receive[i], combiner)) + int result = handle_response(to_receive[i], combiner); + switch (result) { case RESPONSE_EOF: /* have something to read, keep receiving */ i++; @@ -960,7 +961,7 @@ data_node_receive_responses(const int conn_count, DataNodeHandle ** connections, /* Inconsistent responses */ ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes, result = %d, request type %d", result, combiner->request_type))); } } } @@ -1679,7 +1680,7 @@ DataNodeCopyOut(Exec_Nodes *exec_nodes, DataNodeHandle** copy_connections, FILE* pfree(copy_connections); ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("Unexpected response from the data nodes"))); + errmsg("Unexpected response from the data nodes when combining, request type %d", combiner->request_type))); } return processed; ----------------------------------------------------------------------- Summary of changes: src/backend/access/transam/xact.c | 14 ++++++++++++++ src/backend/pgxc/pool/execRemote.c | 21 +++++++++++---------- src/backend/tcop/postgres.c | 8 ++++++++ src/include/access/xact.h | 3 +++ 4 files changed, 36 insertions(+), 10 deletions(-) hooks/post-receive -- Postgres-XC |