diff options
author | Michael Paquier | 2012-07-12 23:55:08 +0000 |
---|---|---|
committer | Michael Paquier | 2012-07-12 23:55:08 +0000 |
commit | 5d8d73970dcd36236df3405801349ec01623753f (patch) | |
tree | 3933b8fe7daebbf07045506e0b5e733f2a92cb04 | |
parent | 493f432d2eab89ad17287ab6ceb2793e419cf693 (diff) |
Clean up whitespaces in XC header files and remove gtm_report_failure
gtm_report_failure was a function used to allow report of an error
between XCM and GTM-Standby. XCM is not supported anymore, in consequence
this function becomes useless. It was deactivated by the way.
-rw-r--r-- | src/gtm/common/gtm_utils.c | 21 | ||||
-rw-r--r-- | src/gtm/main/gtm_standby.c | 28 | ||||
-rw-r--r-- | src/include/gtm/gtm_c.h | 2 | ||||
-rw-r--r-- | src/include/gtm/gtm_client.h | 12 | ||||
-rw-r--r-- | src/include/gtm/gtm_msg.h | 2 | ||||
-rw-r--r-- | src/include/gtm/gtm_proxy.h | 16 | ||||
-rw-r--r-- | src/include/gtm/gtm_txn.h | 2 | ||||
-rw-r--r-- | src/include/gtm/gtm_utils.h | 9 | ||||
-rw-r--r-- | src/include/gtm/proxy_utils.h | 1 | ||||
-rw-r--r-- | src/include/pgxc/pgxcnode.h | 4 | ||||
-rw-r--r-- | src/include/pgxc/poolmgr.h | 2 |
11 files changed, 20 insertions, 79 deletions
diff --git a/src/gtm/common/gtm_utils.c b/src/gtm/common/gtm_utils.c index cc28712724..081660ec57 100644 --- a/src/gtm/common/gtm_utils.c +++ b/src/gtm/common/gtm_utils.c @@ -196,24 +196,3 @@ char *gtm_util_result_name(GTM_ResultType type) return "UNKNOWN_RESULT"; return result_name[type]; } - -/* - * gtm_report_failure() is an utility function to report fatal failure - * which occureed inside GTM to XCM, especially communication errors. - * - * failed_conn is null-able when failed to establish a connection - * with other node. - */ -#if 0 -/* - * PGXCTODO: This portion of code needs XCM support - * to be able to report GTM failures to XC watcher and - * enable a GTM reconnection kick. - */ -void -gtm_report_failure(GTM_Conn *failed_conn) -{ - elog(LOG, "Calling report_xcwatch_gtm_failure()..."); - return; -} -#endif diff --git a/src/gtm/main/gtm_standby.c b/src/gtm/main/gtm_standby.c index e641c9f7c4..575d2a12ad 100644 --- a/src/gtm/main/gtm_standby.c +++ b/src/gtm/main/gtm_standby.c @@ -354,16 +354,6 @@ gtm_standby_connect_to_standby(void) conn = gtm_standby_connect_to_standby_int(&report); -#if 0 - /* - * PGXCTODO: This portion of code needs XCM support - * to be able to report GTM failures to XC watcher and - * enable a GTM reconnection kick. - */ - if (!conn && report) - gtm_report_failure(NULL); -#endif - return conn; } @@ -441,16 +431,6 @@ gtm_standby_reconnect_to_standby(GTM_Conn *old_conn, int retry_max) elog(LOG, "gtm_standby_reconnect_to_standby(): re-connect failed. retry=%d", i); } -#if 0 - /* - * PGXCTODO: This portion of code needs XCM support - * to be able to report GTM failures to XC watcher and - * enable a GTM reconnection kick. - */ - if (newconn) - gtm_report_failure(NULL); -#endif - return newconn; } @@ -481,14 +461,6 @@ gtm_standby_check_communication_error(int *retry_count, GTM_Conn *oldconn) } elog(LOG, "communication error with standby."); -#if 0 - /* - * PGXCTODO: This portion of code needs XCM support - * to be able to report GTM failures to XC watcher and - * enable a GTM reconnection kick. - */ - gtm_report_failure(oldconn); -#endif } return false; } diff --git a/src/include/gtm/gtm_c.h b/src/include/gtm/gtm_c.h index 71030b2cbb..f34f4dbb35 100644 --- a/src/include/gtm/gtm_c.h +++ b/src/include/gtm/gtm_c.h @@ -65,7 +65,7 @@ typedef enum GTM_PGXCNodeType * as a handle because we would never have a transaction state at the * GTM without assigned GXID. */ -typedef int32 GTM_TransactionHandle; +typedef int32 GTM_TransactionHandle; #define InvalidTransactionHandle -1 diff --git a/src/include/gtm/gtm_client.h b/src/include/gtm/gtm_client.h index 1e222ff0c6..60d4a8e761 100644 --- a/src/include/gtm/gtm_client.h +++ b/src/include/gtm/gtm_client.h @@ -37,7 +37,7 @@ typedef union GTM_ResultData * TXN_COMMIT_PREPARED * TXN_ROLLBACK */ - + GlobalTransactionId grd_next_gxid; struct @@ -120,7 +120,7 @@ typedef union GTM_ResultData #define GTM_RESULT_ERROR (-1) #define GTM_RESULT_OK (0) /* - * This error is used ion the case where allocated buffer is not large + * This error is used ion the case where allocated buffer is not large * enough to store the errors. It may happen of an allocation failed * so it's status is considered as unknown. */ @@ -166,13 +166,13 @@ size_t get_sequence_list(GTM_Conn *, GTM_SeqInfo **, size_t); * Transaction Management API */ GlobalTransactionId begin_transaction(GTM_Conn *conn, GTM_IsolationLevel isolevel, GTM_Timestamp *timestamp); -int bkup_begin_transaction(GTM_Conn *conn, GTM_TransactionHandle txn, GTM_IsolationLevel isolevel, +int bkup_begin_transaction(GTM_Conn *conn, GTM_TransactionHandle txn, GTM_IsolationLevel isolevel, bool read_only, GTM_Timestamp timestamp); int bkup_begin_transaction_gxid(GTM_Conn *conn, GTM_TransactionHandle txn, GlobalTransactionId gxid, GTM_IsolationLevel isolevel, bool read_only, GTM_Timestamp timestamp); GlobalTransactionId begin_transaction_autovacuum(GTM_Conn *conn, GTM_IsolationLevel isolevel); -int bkup_begin_transaction_autovacuum(GTM_Conn *conn, GTM_TransactionHandle txn, GlobalTransactionId gxid, +int bkup_begin_transaction_autovacuum(GTM_Conn *conn, GTM_TransactionHandle txn, GlobalTransactionId gxid, GTM_IsolationLevel isolevel); int commit_transaction(GTM_Conn *conn, GlobalTransactionId gxid); int bkup_commit_transaction(GTM_Conn *conn, GlobalTransactionId gxid); @@ -199,8 +199,8 @@ begin_transaction_multi(GTM_Conn *conn, int txn_count, GTM_IsolationLevel *txn_i bool *txn_read_only, GTMProxy_ConnID *txn_connid, int *txn_count_out, GlobalTransactionId *gxid_out, GTM_Timestamp *ts_out); int -bkup_begin_transaction_multi(GTM_Conn *conn, int txn_count, - GTM_TransactionHandle *txn, GlobalTransactionId start_gxid, GTM_IsolationLevel *isolevel, +bkup_begin_transaction_multi(GTM_Conn *conn, int txn_count, + GTM_TransactionHandle *txn, GlobalTransactionId start_gxid, GTM_IsolationLevel *isolevel, bool *read_only, GTMProxy_ConnID *txn_connid); int commit_transaction_multi(GTM_Conn *conn, int txn_count, GlobalTransactionId *gxid, diff --git a/src/include/gtm/gtm_msg.h b/src/include/gtm/gtm_msg.h index 168e5bcb48..c2054d6f1b 100644 --- a/src/include/gtm/gtm_msg.h +++ b/src/include/gtm/gtm_msg.h @@ -142,7 +142,7 @@ typedef enum GTM_ResultType * Special message header for the messgaes exchanged between the GTM server and * the proxy. * - * ph_conid: connection identifier which is used to route + * ph_conid: connection identifier which is used to route * the messages to the right backend. */ typedef struct GTM_ProxyMsgHeader diff --git a/src/include/gtm/gtm_proxy.h b/src/include/gtm/gtm_proxy.h index 93d1693d4b..a11f752963 100644 --- a/src/include/gtm/gtm_proxy.h +++ b/src/include/gtm/gtm_proxy.h @@ -71,9 +71,9 @@ typedef struct GTMProxy_ThreadInfo uint32 thr_localid; bool is_main_thread; void * (* thr_startroutine)(void *); - + MemoryContext thr_thread_context; - MemoryContext thr_message_context; + MemoryContext thr_message_context; MemoryContext thr_current_context; MemoryContext thr_error_context; MemoryContext thr_parent_context; @@ -90,15 +90,15 @@ typedef struct GTMProxy_ThreadInfo uint32 thr_conn_count; /* number of connections served by this thread */ - /* + /* * The structure member type/sequence upto this point must match the * GTM_ThreadInfo structure in gtm.h since they are shared in some common * library routines such as elog.c. Keeping them in sync helps us use the * same library for the proxy as well as the server. - */ + */ GTM_MutexLock thr_lock; GTM_CV thr_cv; - + /* * We use a sequence number to track the state of connection/fd array. * Whenever a new connection is added or an existing connection is deleted @@ -176,7 +176,7 @@ typedef union GTMProxy_CommandData GlobalTransactionId gxid; GTM_TransactionHandle handle; } cd_snap; - + struct { GTM_PGXCNodeType type; @@ -258,8 +258,8 @@ extern GTM_ThreadID TopMostThreadID; } \ } while(0) #else -#define Disable_Longjmp() +#define Disable_Longjmp() #define Enable_Longjmp() #endif - + #endif diff --git a/src/include/gtm/gtm_txn.h b/src/include/gtm/gtm_txn.h index cb02d35998..0089064cb0 100644 --- a/src/include/gtm/gtm_txn.h +++ b/src/include/gtm/gtm_txn.h @@ -163,7 +163,7 @@ typedef struct GTM_Transactions int32 gt_lastslot; GTM_TransactionInfo gt_transactions_array[GTM_MAX_GLOBAL_TRANSACTIONS]; gtm_List *gt_open_transactions; - + GTM_RWLock gt_TransArrayLock; } GTM_Transactions; diff --git a/src/include/gtm/gtm_utils.h b/src/include/gtm/gtm_utils.h index db446106cb..75c14a73f0 100644 --- a/src/include/gtm/gtm_utils.h +++ b/src/include/gtm/gtm_utils.h @@ -17,15 +17,6 @@ #include "gtm/libpq-int.h" #include "gtm/gtm_msg.h" -#if 0 -/* - * PGXCTODO: This portion of code needs XCM support - * to be able to report GTM failures to XC watcher and - * enable a GTM reconnection kick. - */ -void gtm_report_failure(GTM_Conn *); -#endif - void gtm_util_init_nametabs(void); char *gtm_util_message_name(GTM_MessageType type); char *gtm_util_result_name(GTM_ResultType type); diff --git a/src/include/gtm/proxy_utils.h b/src/include/gtm/proxy_utils.h index 1f3ff35a28..a59b352f19 100644 --- a/src/include/gtm/proxy_utils.h +++ b/src/include/gtm/proxy_utils.h @@ -20,4 +20,3 @@ bool gtm_standby_check_communication_error(int *, GTM_Conn *); #endif /* PROXY_UTILS_H */ - diff --git a/src/include/pgxc/pgxcnode.h b/src/include/pgxc/pgxcnode.h index 2797b56849..f98504afd3 100644 --- a/src/include/pgxc/pgxcnode.h +++ b/src/include/pgxc/pgxcnode.h @@ -99,8 +99,8 @@ struct pgxc_node_handle size_t inEnd; size_t inCursor; - /* - * Have a variable to enable/disable response checking and + /* + * Have a variable to enable/disable response checking and * if enable then read the result of response checking * * For details see comments of RESP_ROLLBACK diff --git a/src/include/pgxc/poolmgr.h b/src/include/pgxc/poolmgr.h index 7def1eb494..7181968166 100644 --- a/src/include/pgxc/poolmgr.h +++ b/src/include/pgxc/poolmgr.h @@ -43,7 +43,7 @@ * They are sent to remote nodes invloved in the transaction after sending * BEGIN TRANSACTION using a special firing protocol. * They cannot be sent when connections are obtained, making them having no - * effect as BEGIN is sent by backend after connections are obtained and + * effect as BEGIN is sent by backend after connections are obtained and * obtention confirmation has been sent back to backend. * SET CONSTRAINT, SET LOCAL commands are in this category. * |