Cleanup GTM API: make functions static, remove dead code
authorTomas Vondra <[email protected]>
Sat, 4 Nov 2017 15:46:56 +0000 (16:46 +0100)
committerTomas Vondra <[email protected]>
Sat, 4 Nov 2017 15:46:56 +0000 (16:46 +0100)
The cleanup does two basic things:

* Functions used only in a single source file are made static (and also
  removed from the header file, of course). This reduces the size of the
  public GTM API.

* Unused functions (identified by the compiler thanks to making other
  functions static in the previous step) are removed. The assumption is
  that this code was not really tested at all, and would only make
  future improvements harder.

21 files changed:
src/gtm/client/gtm_client.c
src/gtm/common/gtm_lock.c
src/gtm/common/gtm_serialize.c
src/gtm/common/gtm_utils.c
src/gtm/main/gtm_seq.c
src/gtm/main/gtm_snap.c
src/gtm/main/gtm_standby.c
src/gtm/main/gtm_thread.c
src/gtm/main/gtm_txn.c
src/gtm/recovery/register_common.c
src/include/gtm/gtm.h
src/include/gtm/gtm_backup.h
src/include/gtm/gtm_client.h
src/include/gtm/gtm_gxid.h
src/include/gtm/gtm_lock.h
src/include/gtm/gtm_seq.h
src/include/gtm/gtm_serialize.h
src/include/gtm/gtm_standby.h
src/include/gtm/gtm_txn.h
src/include/gtm/gtm_utils.h
src/include/gtm/register.h

index ce9845e9758290bb05cbd007317942d57168407d..a9e0c6f911e573898da8d889ce31db890545711c 100644 (file)
@@ -110,12 +110,6 @@ connect_gtm(const char *connect_string)
        return PQconnectGTM(connect_string);
 }
 
-void
-disconnect_gtm(GTM_Conn *conn)
-{
-       GTMPQfinish(conn);
-}
-
 /*
  * begin_replication_initial_sync() acquires several locks to prepare
  * for copying internal transaction, xid and sequence information
index 53ccd0a463d8a3a6ea06904ab85c677fba1f3a46..d46b338fa728c17e1a2a221cf2e35c4920ab91bb 100644 (file)
@@ -203,63 +203,6 @@ GTM_RWLockDestroy(GTM_RWLock *lock)
        return pthread_rwlock_destroy(&lock->lk_lock);
 }
 
-/*
- * Conditionally acquire a lock. If the lock is not available, the function
- * immediately returns without blocking.
- *
- * Returns true if lock is successfully acquired. Otherwise returns false
- */
-bool
-GTM_RWLockConditionalAcquire(GTM_RWLock *lock, GTM_LockMode mode)
-{
-       int status = EINVAL;
-
-       switch (mode)
-       {
-               case GTM_LOCKMODE_WRITE:
-                       status = pthread_rwlock_trywrlock(&lock->lk_lock);
-#ifdef GTM_LOCK_DEBUG
-                       if (!status)
-                       {
-                               pthread_mutex_lock(&lock->lk_debug_mutex);
-                               lock->wr_granted = true;
-                               lock->wr_owner = pthread_self();
-                               lock->rd_holders_count = 0;
-                               lock->rd_holders_overflow = false;
-                               pthread_mutex_unlock(&lock->lk_debug_mutex);
-                       }
-#endif
-                       break;
-
-               case GTM_LOCKMODE_READ:
-                       status = pthread_rwlock_tryrdlock(&lock->lk_lock);
-#ifdef GTM_LOCK_DEBUG
-                       if (!status)
-                       {
-                               pthread_mutex_lock(&lock->lk_debug_mutex);
-                               if (lock->rd_holders_count == GTM_LOCK_DEBUG_MAX_READ_TRACKERS)
-                               {
-                                       elog(WARNING, "Too many threads waiting for a read-lock");
-                                       lock->rd_holders_overflow = true;
-                               }
-                               else
-                               {
-                                       lock->rd_holders[lock->rd_holders_count++] = pthread_self();
-                                       lock->rd_holders_overflow = false;
-                               }
-                               pthread_mutex_unlock(&lock->lk_debug_mutex);
-                       }
-#endif
-                       break;
-
-               default:
-                       elog(ERROR, "Invalid lockmode");
-                       break;
-       }
-
-       return status ? false : true;
-}
-
 /*
  * Initialize a mutex lock
  */
@@ -299,19 +242,6 @@ GTM_MutexLockRelease(GTM_MutexLock *lock)
        return pthread_mutex_unlock(&lock->lk_lock);
 }
 
-/*
- * Conditionally acquire a lock. If the lock is not available, the function
- * immediately returns without blocking.
- *
- * Returns true if lock is successfully acquired. Otherwise returns false
- */
-bool
-GTM_MutexLockConditionalAcquire(GTM_MutexLock *lock)
-{
-       int status = pthread_mutex_trylock(&lock->lk_lock);
-       return status ? false : true;
-}
-
 /*
  * Initialize a condition variable
  */
@@ -321,15 +251,6 @@ GTM_CVInit(GTM_CV *cv)
        return pthread_cond_init(&cv->cv_condvar, NULL);
 }
 
-/*
- * Destroy the conditional variable
- */
-int
-GTM_CVDestroy(GTM_CV *cv)
-{
-       return pthread_cond_destroy(&cv->cv_condvar);
-}
-
 /*
  * Wake up all the threads waiting on this conditional variable
  */
index d28535aeeb87eb1eef117a93ce24e2beb98c164d..4ff5ad72ec2e0e8c5c73b381b474fb3ef410d53a 100644 (file)
@@ -43,7 +43,7 @@
  * ---> sn_xcnt ---> GXID * sn_xcnt
  *  |<--- sn_xip -->|
  */
-size_t
+static size_t
 gtm_get_snapshotdata_size(GTM_SnapshotData *data)
 {
        size_t len = 0;
@@ -63,7 +63,7 @@ gtm_get_snapshotdata_size(GTM_SnapshotData *data)
  * gtm_serialize_snapshotdata
  * Serialize a GTM_SnapshotData structure
  */
-size_t
+static size_t
 gtm_serialize_snapshotdata(GTM_SnapshotData *data, char *buf, size_t buflen)
 {
        int len = 0;
@@ -109,7 +109,7 @@ gtm_serialize_snapshotdata(GTM_SnapshotData *data, char *buf, size_t buflen)
  * Deserialize a GTM_SnapshotData structure
  * -----------------------------------------------------
  */
-size_t
+static size_t
 gtm_deserialize_snapshotdata(GTM_SnapshotData *data, const char *buf, size_t buflen)
 {
        size_t len = 0;
@@ -153,7 +153,7 @@ gtm_deserialize_snapshotdata(GTM_SnapshotData *data, const char *buf, size_t buf
  * Original gti_gid serialization was just "null-terminated string".
  * This should be prefixed with the length of the string.
  */
-size_t
+static size_t
 gtm_get_transactioninfo_size(GTM_TransactionInfo *data)
 {
        size_t len = 0;
@@ -191,7 +191,7 @@ gtm_get_transactioninfo_size(GTM_TransactionInfo *data)
  * Serialize a GTM_TransactionInfo structure
  * -----------------------------------------------------
  */
-size_t
+static size_t
 gtm_serialize_transactioninfo(GTM_TransactionInfo *data, char *buf, size_t buflen)
 {
        int len = 0;
@@ -304,7 +304,7 @@ gtm_serialize_transactioninfo(GTM_TransactionInfo *data, char *buf, size_t bufle
  * Deserialize a GTM_TransactionInfo structure
  * -----------------------------------------------------
  */
-size_t
+static size_t
 gtm_deserialize_transactioninfo(GTM_TransactionInfo *data, const char *buf, size_t maxlen)
 {
        int len = 0;
index 6e72ecc0dba8e0fae0aafe4a519dbbd5ad83ba30..12e9b024f1dfca57f2c679c60c0dfc78c6b307b7 100644 (file)
@@ -149,6 +149,7 @@ static int message_max;
 static char **result_name = NULL;
 static int result_max;
 
+static
 void gtm_util_init_nametabs(void)
 {
        int ii;
@@ -190,12 +191,3 @@ char *gtm_util_message_name(GTM_MessageType type)
                return "UNKNOWN_MESSAGE";
        return message_name[type];
 }
-
-char *gtm_util_result_name(GTM_ResultType type)
-{
-       if (result_name == NULL)
-               gtm_util_init_nametabs();
-       if (type > result_max)
-               return "UNKNOWN_RESULT";
-       return result_name[type];
-}
index 5ff1ee0fddd5f99ce926297a5397a4248b44659d..47cf7559f16f9740d1219d09cd16d186e1d7cfaf 100644 (file)
@@ -358,7 +358,7 @@ seq_copy_key(GTM_SequenceKey key)
 /*
  * Initialize a new sequence. Optionally set the initial value of the sequence.
  */
-int
+static int
 GTM_SeqOpen(GTM_SequenceKey seqkey,
                        GTM_Sequence increment_by,
                        GTM_Sequence minval,
@@ -478,14 +478,15 @@ GTM_SeqOpen(GTM_SequenceKey seqkey,
  * We don't track altered sequences because changes to sequence values are not
  * transactional and must not be rolled back if the transaction aborts.
  */
-int GTM_SeqAlter(GTM_SequenceKey seqkey,
-                                GTM_Sequence increment_by,
-                                GTM_Sequence minval,
-                                GTM_Sequence maxval,
-                                GTM_Sequence startval,
-                                GTM_Sequence lastval,
-                                bool cycle,
-                                bool is_restart)
+static int
+GTM_SeqAlter(GTM_SequenceKey seqkey,
+                        GTM_Sequence increment_by,
+                        GTM_Sequence minval,
+                        GTM_Sequence maxval,
+                        GTM_Sequence startval,
+                        GTM_Sequence lastval,
+                        bool cycle,
+                        bool is_restart)
 {
        GTM_SeqInfo *seqinfo = seq_find_seqinfo(seqkey);
 
@@ -585,7 +586,7 @@ GTM_SeqRestore(GTM_SequenceKey seqkey,
 /*
  * Destroy the given sequence depending on type of given key
  */
-int
+static int
 GTM_SeqClose(GTM_SequenceKey seqkey, GlobalTransactionId gxid)
 {
        int res;
@@ -753,7 +754,7 @@ seq_drop_with_dbkey(GTM_SequenceKey nsp)
 /*
  * Rename an existing sequence with a new name
  */
-int
+static int
 GTM_SeqRename(GTM_SequenceKey seqkey, GTM_SequenceKey newseqkey,
                GlobalTransactionId gxid)
 {
@@ -788,7 +789,7 @@ GTM_SeqRename(GTM_SequenceKey seqkey, GTM_SequenceKey newseqkey,
 /*
  * Get current value for the sequence without incrementing it
  */
-void
+static void
 GTM_SeqGetCurrent(GTM_SequenceKey seqkey, char *coord_name,
                                  int coord_procid, GTM_Sequence *result)
 {
@@ -899,7 +900,7 @@ seq_set_lastval(GTM_SeqInfo *seqinfo, char *coord_name,
 /*
  * Set values for the sequence
  */
-int
+static int
 GTM_SeqSetVal(GTM_SequenceKey seqkey, char *coord_name,
                          int coord_procid, GTM_Sequence nextval, bool iscalled)
 {
@@ -933,7 +934,7 @@ GTM_SeqSetVal(GTM_SequenceKey seqkey, char *coord_name,
 /*
  * Get next value for the sequence
  */
-int
+static int
 GTM_SeqGetNext(GTM_SequenceKey seqkey, char *coord_name,
                           int coord_procid, GTM_Sequence range,
                           GTM_Sequence *result, GTM_Sequence *rangemax)
@@ -1089,7 +1090,7 @@ get_rangemax(GTM_SeqInfo *seqinfo, GTM_Sequence range)
 /*
  * Reset the sequence
  */
-int
+static int
 GTM_SeqReset(GTM_SequenceKey seqkey)
 {
        GTM_SeqInfo *seqinfo = seq_find_seqinfo(seqkey);
index f8e3d3197624158786fc88110ac533454df9335f..a331ed418942dde5a21be22cda0ba58a80c98f5c 100644 (file)
@@ -49,7 +49,7 @@
  * Note: this function should probably not be called with an argument that's
  * not statically allocated (see xip allocation below).
  */
-GTM_Snapshot
+static GTM_Snapshot
 GTM_GetTransactionSnapshot(GTM_TransactionHandle handle[], int txn_count, int *status)
 {
        GlobalTransactionId xmin;
@@ -449,20 +449,3 @@ retry:
 
        return;
 }
-
-/*
- * Free the snapshot data. The snapshot itself is not freed though
- */
-void
-GTM_FreeSnapshotData(GTM_Snapshot snapshot)
-{
-       if (snapshot == NULL)
-               return;
-
-       if (snapshot->sn_xip != NULL)
-       {
-               Assert(snapshot->sn_xcnt);
-               pfree(snapshot->sn_xip);
-               snapshot->sn_xip = NULL;
-       }
-}
index 5c8a6a49795512b73fefafbc9c9e2dfc685f55b4..5ae1da0c284ca9cf51e9ab51b9af2a5847342b00 100644 (file)
@@ -416,7 +416,7 @@ gtm_standby_disconnect_from_standby(GTM_Conn *conn)
 }
 
 
-GTM_Conn *
+static GTM_Conn *
 gtm_standby_reconnect_to_standby(GTM_Conn *old_conn, int retry_max)
 {
        GTM_Conn *newconn = NULL;
index 9d166f4a0eb2ce1e17dd5dc135d98177fd261433..462a2a85170b320017cbe73d582ef04eb2efa739 100644 (file)
@@ -298,37 +298,6 @@ GTM_ThreadCreate(GTM_ConnectionInfo *conninfo,
        return thrinfo;
 }
 
-/*
- * Exit the current thread
- */
-void
-GTM_ThreadExit(void)
-{
-       /* XXX To be implemented */
-}
-
-int
-GTM_ThreadJoin(GTM_ThreadInfo *thrinfo)
-{
-       int error;
-       void *data;
-
-       error = pthread_join(thrinfo->thr_id, &data);
-
-       return error;
-}
-
-/*
- * Get thread information for the given thread, identified by the
- * thread_id
- */
-GTM_ThreadInfo *
-GTM_GetThreadInfo(GTM_ThreadID thrid)
-{
-
-       return NULL;
-}
-
 /*
  * Cleanup routine for the thread
  */
@@ -440,32 +409,6 @@ GTM_ThreadMainWrapper(void *argp)
        return thrinfo;
 }
 
-void
-GTM_LockAllOtherThreads(void)
-{
-       GTM_ThreadInfo *my_threadinfo = GetMyThreadInfo;
-       int ii;
-
-       for (ii = 0; ii < GTMThreads->gt_array_size; ii++)
-       {
-               if (GTMThreads->gt_threads[ii] && GTMThreads->gt_threads[ii] != my_threadinfo)
-                       GTM_RWLockAcquire(&GTMThreads->gt_threads[ii]->thr_lock, GTM_LOCKMODE_WRITE);
-       }
-}
-
-void
-GTM_UnlockAllOtherThreads(void)
-{
-       GTM_ThreadInfo *my_threadinfo = GetMyThreadInfo;
-       int ii;
-
-       for (ii = 0; ii < GTMThreads->gt_array_size; ii++)
-       {
-               if (GTMThreads->gt_threads[ii] && GTMThreads->gt_threads[ii] != my_threadinfo)
-                       GTM_RWLockRelease(&GTMThreads->gt_threads[ii]->thr_lock);
-       }
-}
-
 void
 GTM_DoForAllOtherThreads(void (* process_routine)(GTM_ThreadInfo *))
 {
index 706b9bc2567a84caa81794a91e0c504f220fd7fa..1fde21aff8fee767bed1e13608a195b3bfad74a7 100644 (file)
@@ -35,7 +35,6 @@ extern bool Backup_synchronously;
 #define GTM_CONTROL_VERSION    20160302
 
 /* Local functions */
-static XidStatus GlobalTransactionIdGetStatus(GlobalTransactionId transactionId);
 static bool GTM_SetDoVacuum(GTM_TransactionHandle handle);
 static void init_GTM_TransactionInfo(GTM_TransactionInfo *gtm_txninfo,
                                                                         GTM_TransactionHandle txn,
@@ -47,6 +46,9 @@ static void init_GTM_TransactionInfo(GTM_TransactionInfo *gtm_txninfo,
 static void clean_GTM_TransactionInfo(GTM_TransactionInfo *gtm_txninfo);
 static GTM_TransactionHandle GTM_GlobalSessionIDToHandle(
                                                                        const char *global_sessionid);
+static bool GTM_NeedXidRestoreUpdate(void);
+static int GTM_CommitTransaction(GTM_TransactionHandle txn,
+               int waited_xid_count, GlobalTransactionId *waited_xids);
 
 GlobalTransactionId ControlXid;  /* last one written to control file */
 GTM_Transactions GTMTransactions;
@@ -118,33 +120,6 @@ GTM_InitTxnManager(void)
        return;
 }
 
-/*
- * Get the status of current or past transaction.
- */
-static XidStatus
-GlobalTransactionIdGetStatus(GlobalTransactionId transactionId)
-{
-       XidStatus       xidstatus = TRANSACTION_STATUS_IN_PROGRESS;
-
-       /*
-        * Also, check to see if the transaction ID is a permanent one.
-        */
-       if (!GlobalTransactionIdIsNormal(transactionId))
-       {
-               if (GlobalTransactionIdEquals(transactionId, BootstrapGlobalTransactionId))
-                       return TRANSACTION_STATUS_COMMITTED;
-               if (GlobalTransactionIdEquals(transactionId, FrozenGlobalTransactionId))
-                       return TRANSACTION_STATUS_COMMITTED;
-               return TRANSACTION_STATUS_ABORTED;
-       }
-
-       /*
-        * TODO To be implemented
-        * This code is not completed yet and the latter code must not be reached.
-        */
-       Assert(0);
-       return xidstatus;
-}
 
 /*
  * Given the GXID, find the corresponding transaction handle.
@@ -210,7 +185,7 @@ GTM_GlobalSessionIDToHandle(const char *global_sessionid)
        return InvalidTransactionHandle;
 }
 
-bool
+static bool
 GTM_IsGXIDInProgress(GlobalTransactionId gxid)
 {
        return (GTM_GXIDToHandle_Internal(gxid, false) !=
@@ -220,7 +195,7 @@ GTM_IsGXIDInProgress(GlobalTransactionId gxid)
  * Given the GID (for a prepared transaction), find the corresponding
  * transaction handle.
  */
-GTM_TransactionHandle
+static GTM_TransactionHandle
 GTM_GIDToHandle(char *gid)
 {
        gtm_ListCell *elem = NULL;
@@ -423,59 +398,6 @@ GTMGetLastClientIdentifier(void)
        return last_client_id;
 }
 
-/*
- * GlobalTransactionIdDidCommit
- *             True iff transaction associated with the identifier did commit.
- *
- * Note:
- *             Assumes transaction identifier is valid.
- */
-bool                                                   /* true if given transaction committed */
-GlobalTransactionIdDidCommit(GlobalTransactionId transactionId)
-{
-       XidStatus       xidstatus;
-
-       xidstatus = GlobalTransactionIdGetStatus(transactionId);
-
-       /*
-        * If it's marked committed, it's committed.
-        */
-       if (xidstatus == TRANSACTION_STATUS_COMMITTED)
-               return true;
-
-       /*
-        * It's not committed.
-        */
-       return false;
-}
-
-/*
- * GlobalTransactionIdDidAbort
- *             True iff transaction associated with the identifier did abort.
- *
- * Note:
- *             Assumes transaction identifier is valid.
- */
-bool                                                   /* true if given transaction aborted */
-GlobalTransactionIdDidAbort(GlobalTransactionId transactionId)
-{
-       XidStatus       xidstatus;
-
-       xidstatus = GlobalTransactionIdGetStatus(transactionId);
-
-       /*
-        * If it's marked aborted, it's aborted.
-        */
-       if (xidstatus == TRANSACTION_STATUS_ABORTED)
-               return true;
-
-       /*
-        * It's not aborted.
-        */
-       return false;
-}
-
-
 /*
  * Set that the transaction is doing vacuum
  *
@@ -498,7 +420,7 @@ GTM_SetDoVacuum(GTM_TransactionHandle handle)
  * The new XID is also stored into the transaction info structure of the given
  * transaction before returning.
  */
-bool
+static bool
 GTM_GetGlobalTransactionIdMulti(GTM_TransactionHandle handle[], int txn_count,
                GlobalTransactionId gxid[], GTM_TransactionHandle new_handle[],
                int *new_txn_count)
@@ -668,7 +590,7 @@ SetControlXid(GlobalTransactionId gxid)
 }
 
 /* Transaction Control */
-int
+static int
 GTM_BeginTransactionMulti(GTM_IsolationLevel isolevel[],
                                         bool readonly[],
                                         const char *global_sessionid[],
@@ -762,7 +684,7 @@ GTM_BeginTransactionMulti(GTM_IsolationLevel isolevel[],
 }
 
 /* Transaction Control */
-GTM_TransactionHandle
+static GTM_TransactionHandle
 GTM_BeginTransaction(GTM_IsolationLevel isolevel,
                                         bool readonly,
                                         const char *global_sessionid)
@@ -912,7 +834,7 @@ clean_GTM_TransactionInfo(GTM_TransactionInfo *gtm_txninfo)
 }
 
 
-void
+static void
 GTM_BkupBeginTransactionMulti(GTM_IsolationLevel *isolevel,
                                                          bool *readonly,
                                                          const char **global_sessionid,
@@ -937,7 +859,7 @@ GTM_BkupBeginTransactionMulti(GTM_IsolationLevel *isolevel,
        MemoryContextSwitchTo(oldContext);
 }
 
-void
+static void
 GTM_BkupBeginTransaction(GTM_IsolationLevel isolevel,
                                                 bool readonly,
                                                 const char *global_sessionid,
@@ -949,20 +871,11 @@ GTM_BkupBeginTransaction(GTM_IsolationLevel isolevel,
                        &global_sessionid,
                        &client_id, &connid, 1);
 }
-/*
- * Same as GTM_RollbackTransaction, but takes GXID as input
- */
-int
-GTM_RollbackTransactionGXID(GlobalTransactionId gxid)
-{
-       GTM_TransactionHandle txn = GTM_GXIDToHandle(gxid);
-       return GTM_RollbackTransaction(txn);
-}
 
 /*
  * Rollback multiple transactions in one go
  */
-int
+static int
 GTM_RollbackTransactionMulti(GTM_TransactionHandle txn[], int txn_count, int status[])
 {
        GTM_TransactionInfo *gtm_txninfo[txn_count];
@@ -995,7 +908,7 @@ GTM_RollbackTransactionMulti(GTM_TransactionHandle txn[], int txn_count, int sta
 /*
  * Rollback a transaction
  */
-int
+static int
 GTM_RollbackTransaction(GTM_TransactionHandle txn)
 {
        int status;
@@ -1003,21 +916,10 @@ GTM_RollbackTransaction(GTM_TransactionHandle txn)
        return status;
 }
 
-
-/*
- * Same as GTM_CommitTransaction but takes GXID as input
- */
-int
-GTM_CommitTransactionGXID(GlobalTransactionId gxid)
-{
-       GTM_TransactionHandle txn = GTM_GXIDToHandle(gxid);
-       return GTM_CommitTransaction(txn, 0, NULL);
-}
-
 /*
  * Commit multiple transactions in one go
  */
-int
+static int
 GTM_CommitTransactionMulti(GTM_TransactionHandle txn[], int txn_count,
                int waited_xid_count, GlobalTransactionId *waited_xids,
                int status[])
@@ -1080,7 +982,7 @@ GTM_CommitTransactionMulti(GTM_TransactionHandle txn[], int txn_count,
 /*
  * Prepare a transaction
  */
-int
+static int
 GTM_PrepareTransaction(GTM_TransactionHandle txn)
 {
        GTM_TransactionInfo *gtm_txninfo = NULL;
@@ -1103,7 +1005,7 @@ GTM_PrepareTransaction(GTM_TransactionHandle txn)
 /*
  * Commit a transaction
  */
-int
+static int
 GTM_CommitTransaction(GTM_TransactionHandle txn, int waited_xid_count,
                GlobalTransactionId *waited_xids)
 {
@@ -1115,7 +1017,7 @@ GTM_CommitTransaction(GTM_TransactionHandle txn, int waited_xid_count,
 /*
  * Prepare a transaction
  */
-int
+static int
 GTM_StartPreparedTransaction(GTM_TransactionHandle txn,
                                                         char *gid,
                                                         char *nodestring)
@@ -1158,19 +1060,7 @@ GTM_StartPreparedTransaction(GTM_TransactionHandle txn,
        return STATUS_OK;
 }
 
-/*
- * Same as GTM_PrepareTransaction but takes GXID as input
- */
-int
-GTM_StartPreparedTransactionGXID(GlobalTransactionId gxid,
-                                                                char *gid,
-                                                                char *nodestring)
-{
-       GTM_TransactionHandle txn = GTM_GXIDToHandle(gxid);
-       return GTM_StartPreparedTransaction(txn, gid, nodestring);
-}
-
-int
+static int
 GTM_GetGIDData(GTM_TransactionHandle prepared_txn,
                           GlobalTransactionId *prepared_gxid,
                           char **nodestring)
@@ -1200,26 +1090,6 @@ GTM_GetGIDData(GTM_TransactionHandle prepared_txn,
        return STATUS_OK;
 }
 
-/*
- * Get status of the given transaction
- */
-GTM_TransactionStates
-GTM_GetStatus(GTM_TransactionHandle txn)
-{
-       GTM_TransactionInfo *gtm_txninfo = GTM_HandleToTransactionInfo(txn);
-       return gtm_txninfo->gti_state;
-}
-
-/*
- * Same as GTM_GetStatus but takes GXID as input
- */
-GTM_TransactionStates
-GTM_GetStatusGXID(GlobalTransactionId gxid)
-{
-       GTM_TransactionHandle txn = GTM_GXIDToHandle(gxid);
-       return GTM_GetStatus(txn);
-}
-
 /*
  * Process MSG_TXN_BEGIN message
  */
@@ -2814,18 +2684,12 @@ GTM_SetShuttingDown(void)
        GTM_RWLockRelease(&GTMTransactions.gt_XidGenLock);
 }
 
+static
 bool GTM_NeedXidRestoreUpdate(void)
 {
        return(GlobalTransactionIdPrecedesOrEquals(GTMTransactions.gt_backedUpXid, GTMTransactions.gt_nextXid));
 }
 
-
-GlobalTransactionId
-GTM_GetLatestCompletedXID(void)
-{
-       return GTMTransactions.gt_latestCompletedXid;
-}
-
 void
 GTM_ForgetCreatedSequence(GlobalTransactionId gxid, void *seq)
 {
@@ -2890,15 +2754,3 @@ GTM_RememberAlteredSequence(GlobalTransactionId gxid, void *seq)
        gtm_txninfo->gti_altered_seqs = gtm_lcons(seq,
                        gtm_txninfo->gti_altered_seqs);
 }
-
-
-/*
- * TODO
- */
-int GTM_GetAllTransactions(GTM_TransactionInfo txninfo[], uint32 txncnt);
-
-/*
- * TODO
- */
-uint32 GTM_GetAllPrepared(GlobalTransactionId gxids[], uint32 gxidcnt);
-
index 4e999bd0020fb10064d08a34dbe5fbac82077445..ff0f960e33adb3c3e36fdf0e8e63bbd992208eaa 100644 (file)
@@ -68,6 +68,9 @@ static int pgxcnode_remove_info(GTM_PGXCNodeInfo *node);
 static int pgxcnode_add_info(GTM_PGXCNodeInfo *node);
 static char *pgxcnode_copy_char(const char *str);
 
+static void Recovery_RecordRegisterInfo(GTM_PGXCNodeInfo *nodeinfo,
+                                                                               bool is_register);
+
 #define pgxcnode_type_equal(type1,type2) (type1 == type2)
 #define pgxcnode_port_equal(port1,port2) (port1 == port2)
 
@@ -582,7 +585,7 @@ Recovery_SaveRegisterInfo(void)
 /*
  * Add a Register or Unregister record on PGXC Node file on disk.
  */
-void
+static void
 Recovery_RecordRegisterInfo(GTM_PGXCNodeInfo *nodeinfo, bool is_register)
 {
        int ctlfd;
@@ -726,7 +729,7 @@ Recovery_PGXCNodeDisconnect(Port *myport)
        MemoryContextSwitchTo(oldContext);
 }
 
-int
+static int
 Recovery_PGXCNodeBackendDisconnect(GTM_PGXCNodeType type, char *nodename, int socket)
 {
        GTM_PGXCNodeInfo *nodeinfo = pgxcnode_find_info(type, nodename);
index 7b494fb6a25528a4e4c3ee955e594ee27c05fd92..f069477736d1f92c0abf73f6765eadd16b4eddbb 100644 (file)
@@ -87,22 +87,17 @@ typedef struct GTM_RestoreContext {
 
 int GTM_ThreadAdd(GTM_ThreadInfo *thrinfo);
 int GTM_ThreadRemove(GTM_ThreadInfo *thrinfo);
-int GTM_ThreadJoin(GTM_ThreadInfo *thrinfo);
-void GTM_ThreadExit(void);
 void ConnFree(Port *port);
-void GTM_LockAllOtherThreads(void);
-void GTM_UnlockAllOtherThreads(void);
 void GTM_DoForAllOtherThreads(void (* process_routine)(GTM_ThreadInfo *));
 void GTM_SetInitialAndNextClientIdentifierAtPromote(void);
 
 GTM_ThreadInfo *GTM_ThreadCreate(GTM_ConnectionInfo *conninfo,
                                  void *(* startroutine)(void *));
-GTM_ThreadInfo * GTM_GetThreadInfo(GTM_ThreadID thrid);
-#ifdef XCP
+
 extern void SaveControlInfo(void);
 void GTM_RestoreSeqInfo(FILE *ctlf, struct GTM_RestoreContext *context);
+
 #define CONTROL_INTERVAL               50000
-#endif
 
 /*
  * pthread keys to get thread specific information
@@ -138,14 +133,6 @@ extern GTM_ThreadID                                                TopMostThreadID;
 #define GTM_MAX_CACHED_TRANSINFO               0
 #define GTM_HaveEnoughCachedTransInfo()        (gtm_list_length(GTM_CachedTransInfo) >= GTM_MAX_CACHED_TRANSINFO)
 
-#define START_CRIT_SECTION()  (CritSectionCount++)
-
-#define END_CRIT_SECTION() \
-       do { \
-                   Assert(CritSectionCount > 0); \
-                   CritSectionCount--; \
-       } while(0)
-
 #define GTM_CLIENT_ID_EQ(a, b)         \
        ((a) == (b))
 #define GTM_CLIENT_ID_LT(a, b)         \
index 4e6893344a0c61965029bd23a1096c8fb463963e..c8135ea5e28f7a7249911e63864834f74301da18 100644 (file)
@@ -23,7 +23,6 @@ extern GTM_RWLock     gtm_bkup_lock;
 #define RestoreDuration        2000
 
 extern void GTM_WriteRestorePoint(void);
-extern void GTM_MakeBackup(char *path);
 extern void GTM_SetNeedBackup(void);
 extern bool GTM_NeedBackup(void);
 extern void GTM_WriteBarrierBackup(char *barrier_id);
index 021bf512b271c0f5d9102602ed54f92ea598f601..744118f2368fb9eb7cc6f1d14306ee49e6339ba6 100644 (file)
@@ -167,7 +167,6 @@ typedef struct GTM_Result
  * Connection Management API
  */
 GTM_Conn *connect_gtm(const char *connect_string);
-void disconnect_gtm(GTM_Conn *conn);
 
 int begin_replication_initial_sync(GTM_Conn *);
 int end_replication_initial_sync(GTM_Conn *);
index 7fe3cf732c75da933182426472c09bb11b120a4b..4afa05b38cd1485c5488888949ea9fa7255dc454 100644 (file)
@@ -12,8 +12,6 @@
  * Note: if you need to change it, you must change pg_class.h as well.
  * ----------------
  */
-#define BootstrapGlobalTransactionId           ((GlobalTransactionId) 1)
-#define FrozenGlobalTransactionId                      ((GlobalTransactionId) 2)
 #define FirstNormalGlobalTransactionId ((GlobalTransactionId) 3)
 #define MaxGlobalTransactionId                 ((GlobalTransactionId) 0xFFFFFFFF)
 
@@ -23,8 +21,6 @@
  */
 #define GlobalTransactionIdIsNormal(xid)               ((xid) >= FirstNormalGlobalTransactionId)
 #define GlobalTransactionIdEquals(id1, id2)    ((id1) == (id2))
-#define GlobalTransactionIdStore(xid, dest)    (*(dest) = (xid))
-#define StoreInvalidGlobalTransactionId(dest) (*(dest) = InvalidGlobalTransactionId)
 
 /* advance a transaction ID variable, handling wraparound correctly */
 #define GlobalTransactionIdAdvance(dest)       \
                        (dest) = FirstNormalGlobalTransactionId; \
        } while(0)
 
-/* back up a transaction ID variable, handling wraparound correctly */
-#define GlobalTransactionIdRetreat(dest)       \
-       do { \
-               (dest)--; \
-       } while ((dest) < FirstNormalGlobalTransactionId)
-
 extern bool GlobalTransactionIdPrecedes(GlobalTransactionId id1, GlobalTransactionId id2);
 extern bool GlobalTransactionIdPrecedesOrEquals(GlobalTransactionId id1, GlobalTransactionId id2);
 extern bool GlobalTransactionIdFollows(GlobalTransactionId id1, GlobalTransactionId id2);
index 26e8faee49a19db33f082f4b3bc0695b63891842..94e9908346e1e5b843d0f5020e2cf388eb092539 100644 (file)
@@ -55,16 +55,13 @@ extern bool GTM_RWLockAcquire(GTM_RWLock *lock, GTM_LockMode mode);
 extern bool GTM_RWLockRelease(GTM_RWLock *lock);
 extern int GTM_RWLockInit(GTM_RWLock *lock);
 extern int GTM_RWLockDestroy(GTM_RWLock *lock);
-extern bool GTM_RWLockConditionalAcquire(GTM_RWLock *lock, GTM_LockMode mode);
 
 extern bool GTM_MutexLockAcquire(GTM_MutexLock *lock);
 extern bool GTM_MutexLockRelease(GTM_MutexLock *lock);
 extern int GTM_MutexLockInit(GTM_MutexLock *lock);
 extern int GTM_MutexLockDestroy(GTM_MutexLock *lock);
-extern bool GTM_MutexLockConditionalAcquire(GTM_MutexLock *lock);
 
 extern int GTM_CVInit(GTM_CV *cv);
-extern int GTM_CVDestroy(GTM_CV *cv);
 extern int GTM_CVSignal(GTM_CV *cv);
 extern int GTM_CVBcast(GTM_CV *cv);
 extern int GTM_CVWait(GTM_CV *cv, GTM_MutexLock *lock);
index e619d6964cbd30ee6c9d176813c4f447006039c4..6b34fba57317cf10f12df35ff66fe35364e9fe2e 100644 (file)
@@ -67,33 +67,8 @@ typedef struct GTM_SeqInfo
 
 /* SEQUENCE Management */
 void GTM_InitSeqManager(void);
-int GTM_SeqOpen(GTM_SequenceKey seqkey,
-                       GTM_Sequence increment_by,
-                       GTM_Sequence minval,
-                       GTM_Sequence maxval,
-                       GTM_Sequence startval,
-                       bool cycle,
-                       GlobalTransactionId gxid);
-int GTM_SeqAlter(GTM_SequenceKey seqkey,
-                                GTM_Sequence increment_by,
-                                GTM_Sequence minval,
-                                GTM_Sequence maxval,
-                                GTM_Sequence startval,
-                                GTM_Sequence lastval,
-                                bool cycle,
-                                bool is_restart);
-int GTM_SeqClose(GTM_SequenceKey seqkey, GlobalTransactionId gxid);
-int GTM_SeqRename(GTM_SequenceKey seqkey, GTM_SequenceKey newseqkey,
-                                 GlobalTransactionId gxid);
-int GTM_SeqGetNext(GTM_SequenceKey seqkey, char *coord_name,
-                          int coord_procid, GTM_Sequence range,
-                          GTM_Sequence *result, GTM_Sequence *rangemax);
-void GTM_SeqGetCurrent(GTM_SequenceKey seqkey, char *coord_name,
-                                 int coord_procid, GTM_Sequence *result);
-int GTM_SeqSetVal(GTM_SequenceKey seqkey, char *coord_name,
-                         int coord_procid, GTM_Sequence nextval, bool iscalled);
-int GTM_SeqReset(GTM_SequenceKey seqkey);
 
+/* sequence commands in gtm/main/gtm_seq.c */
 void ProcessSequenceInitCommand(Port *myport, StringInfo message, bool is_backup);
 void ProcessSequenceGetCurrentCommand(Port *myport, StringInfo message);
 void ProcessSequenceGetNextCommand(Port *myport, StringInfo message, bool is_backup);
index 4f8cecdf5cb54049a8537beaf68c93daec91677f..4f09db18a727ee0de6d91972a4d392353c326c18 100644 (file)
 #include "gtm/register.h"
 #include "gtm/gtm_seq.h"
 
-size_t gtm_get_snapshotdata_size(GTM_SnapshotData *);
-size_t gtm_serialize_snapshotdata(GTM_SnapshotData *, char *, size_t);
-size_t gtm_deserialize_snapshotdata(GTM_SnapshotData *, const char *, size_t);
-
-size_t gtm_get_transactioninfo_size(GTM_TransactionInfo *);
-size_t gtm_serialize_transactioninfo(GTM_TransactionInfo *, char *, size_t);
-size_t gtm_deserialize_transactioninfo(GTM_TransactionInfo *, const char *, size_t);
-
 size_t gtm_get_transactions_size(GTM_Transactions *);
 size_t gtm_serialize_transactions(GTM_Transactions *, char *, size_t);
 size_t gtm_deserialize_transactions(GTM_Transactions *, const char *, size_t);
index e9fa57f6bf5e8d37fc802333132fa1bae52db9ed..57a55fa6af3ad3d7fd15b5783bbf407cd1f4ae8b 100644 (file)
@@ -23,9 +23,6 @@
 /*
  * Variables to interact with GTM active under GTM standby mode.
  */
-bool gtm_is_standby(void);
-void gtm_set_standby(bool standby);
-void gtm_set_active_conninfo(const char *addr, int port);
 
 int gtm_standby_start_startup(void);
 int gtm_standby_finish_startup(void);
@@ -40,20 +37,15 @@ int gtm_standby_activate_self(void);
 
 GTM_Conn *gtm_standby_connect_to_standby(void);
 void gtm_standby_disconnect_from_standby(GTM_Conn *conn);
-GTM_Conn *gtm_standby_reconnect_to_standby(GTM_Conn *old_conn, int retry_max);
 bool gtm_standby_check_communication_error(int *retry_count, GTM_Conn *oldconn);
 
 GTM_PGXCNodeInfo *find_standby_node_info(void);
 
 int gtm_standby_begin_backup(void);
 int gtm_standby_end_backup(void);
-void gtm_standby_closeActiveConn(void);
 
 void gtm_standby_finishActiveConn(void);
 
-
-
-
 /*
  * Startup mode
  */
index f175062b0014dee8bbb936ee215dffbb0d558f2a..c8b1fdc85504c597ec73e4b196c385cde48cc343 100644 (file)
@@ -29,32 +29,24 @@ typedef int XidStatus;
 #define TRANSACTION_STATUS_ABORTED          0x02
 
 struct GTM_RestoreContext;
-/*
- * prototypes for functions in transam/transam.c
- */
-extern bool GlobalTransactionIdDidCommit(GlobalTransactionId transactionId);
-extern bool GlobalTransactionIdDidAbort(GlobalTransactionId transactionId);
-extern void GlobalTransactionIdAbort(GlobalTransactionId transactionId);
 
-/* in transam/varsup.c */
+/* gtm/main/gtm_txn.c */
 extern GlobalTransactionId GTM_GetGlobalTransactionId(GTM_TransactionHandle handle);
-extern bool GTM_GetGlobalTransactionIdMulti(
-               GTM_TransactionHandle handle[],
-               int txn_count,
-               GlobalTransactionId gxids[],
-               GTM_TransactionHandle new_handle[],
-               int *new_txn_count);
 extern GlobalTransactionId ReadNewGlobalTransactionId(void);
-extern GlobalTransactionId GTM_GetLatestCompletedXID(void);
-extern void SetGlobalTransactionIdLimit(GlobalTransactionId oldest_datfrozenxid);
 extern void SetNextGlobalTransactionId(GlobalTransactionId gxid);
 extern void SetControlXid(GlobalTransactionId gxid);
 extern void GTM_SetShuttingDown(void);
 
-/* For restoration point backup */
-extern bool GTM_NeedXidRestoreUpdate(void);
+/* for restoration point backup (gtm/main/gtm_backup.c) */
 extern void GTM_WriteRestorePointXid(FILE *f);
+extern void GTM_WriteRestorePointVersion(FILE *f);
+extern void GTM_RestoreStart(FILE *ctlf, struct GTM_RestoreContext *context);
+extern void GTM_SaveTxnInfo(FILE *ctlf);
+extern void GTM_RestoreTxnInfo(FILE *ctlf, GlobalTransactionId next_gxid,
+                                               struct GTM_RestoreContext *context, bool force_xid);
 
+
+/* States of the GTM component */
 typedef enum GTM_States
 {
        GTM_STARTING,
@@ -77,6 +69,7 @@ typedef enum GTM_TransactionStates
 
 #define GTM_MAX_SESSION_ID_LEN                 64
 
+/* Information about a global transaction tracked by the GTM */
 typedef struct GTM_TransactionInfo
 {
        GTM_TransactionHandle   gti_handle;
@@ -102,13 +95,13 @@ typedef struct GTM_TransactionInfo
        gtm_List                                *gti_altered_seqs;
 } GTM_TransactionInfo;
 
-#define GTM_MAX_2PC_NODES                              16
 /* By default a GID length is limited to 256 bits in PostgreSQL */
 #define GTM_MAX_GID_LEN                                        256
 #define GTM_MAX_NODESTRING_LEN                 1024
 #define GTM_CheckTransactionHandle(x)  ((x) >= 0 && (x) < GTM_MAX_GLOBAL_TRANSACTIONS)
 #define GTM_IsTransSerializable(x)             ((x)->gti_isolevel == GTM_ISOLATION_SERIALIZABLE)
 
+/* Array of all global transactions tracked by the GTM */
 typedef struct GTM_Transactions
 {
        uint32                          gt_txn_count;
@@ -145,75 +138,29 @@ typedef struct GTM_Transactions
 
 extern GTM_Transactions        GTMTransactions;
 
-/* NOTE: This macro should be used with READ lock held on gt_TransArrayLock! */
-#define GTM_CountOpenTransactions()    (gtm_list_length(GTMTransactions.gt_open_transactions))
-
 /*
  * Two hash tables will be maintained to quickly find the
  * GTM_TransactionInfo block given either the GXID or the GTM_TransactionHandle.
+ *
+ * XXX seems we don't actually have the hash tables, and we simply lookup the
+ * transactions by index (handle) or by walking through open transactions and
+ * checking the GXID.
  */
 
 GTM_TransactionInfo *GTM_HandleToTransactionInfo(GTM_TransactionHandle handle);
 GTM_TransactionHandle GTM_GXIDToHandle(GlobalTransactionId gxid);
-GTM_TransactionHandle GTM_GIDToHandle(char *gid);
-bool GTM_IsGXIDInProgress(GlobalTransactionId gxid);
 
 /* Transaction Control */
 void GTM_InitTxnManager(void);
-GTM_TransactionHandle GTM_BeginTransaction(GTM_IsolationLevel isolevel,
-                                                                                  bool readonly,
-                                                                                  const char *global_sessionid);
-int GTM_BeginTransactionMulti(GTM_IsolationLevel isolevel[],
-                                                                                  bool readonly[],
-                                                                                  const char *global_sessionid[],
-                                                                                  GTMProxy_ConnID connid[],
-                                                                                  int txn_count,
-                                                                                  GTM_TransactionHandle txns[]);
-int GTM_RollbackTransaction(GTM_TransactionHandle txn);
-int GTM_RollbackTransactionMulti(GTM_TransactionHandle txn[], int txn_count, int status[]);
-int GTM_RollbackTransactionGXID(GlobalTransactionId gxid);
-int GTM_CommitTransaction(GTM_TransactionHandle txn,
-               int waited_xid_count, GlobalTransactionId *waited_xids);
-int GTM_CommitTransactionMulti(GTM_TransactionHandle txn[], int txn_count,
-               int waited_xid_count, GlobalTransactionId *waited_xids,
-               int status[]);
-int GTM_CommitTransactionGXID(GlobalTransactionId gxid);
-int GTM_PrepareTransaction(GTM_TransactionHandle txn);
-int GTM_StartPreparedTransaction(GTM_TransactionHandle txn,
-                                                                char *gid,
-                                                                char *nodestring);
-int GTM_StartPreparedTransactionGXID(GlobalTransactionId gxid,
-                                                                        char *gid,
-                                                                        char *nodestring);
-int GTM_GetGIDData(GTM_TransactionHandle prepared_txn,
-                                  GlobalTransactionId *prepared_gxid,
-                                  char **nodestring);
-uint32 GTM_GetAllPrepared(GlobalTransactionId gxids[], uint32 gxidcnt);
-GTM_TransactionStates GTM_GetStatus(GTM_TransactionHandle txn);
-GTM_TransactionStates GTM_GetStatusGXID(GlobalTransactionId gxid);
-int GTM_GetAllTransactions(GTM_TransactionInfo txninfo[], uint32 txncnt);
 void GTM_RemoveAllTransInfos(uint32 client_id, int backend_id);
-uint32 GTMGetFirstClientIdentifier(void);
 uint32 GTMGetLastClientIdentifier(void);
 
-GTM_Snapshot GTM_GetSnapshotData(GTM_TransactionInfo *my_txninfo,
-                                                                GTM_Snapshot snapshot);
-GTM_Snapshot GTM_GetTransactionSnapshot(GTM_TransactionHandle handle[],
-               int txn_count, int *status);
-void GTM_FreeCachedTransInfo(void);
-
+/* processing of messages in gtm_txn.c */
 void ProcessBeginTransactionCommand(Port *myport, StringInfo message);
 void ProcessBkupBeginTransactionCommand(Port *myport, StringInfo message);
-void GTM_BkupBeginTransactionMulti(GTM_IsolationLevel *isolevel,
-                                                                  bool *readonly,
-                                                                  const char **global_sessionid,
-                                                                  uint32 *client_id,
-                                                                  GTMProxy_ConnID *connid,
-                                                                  int  txn_count);
-
-void ProcessBeginTransactionCommandMulti(Port *myport, StringInfo message);
 void ProcessBeginTransactionGetGXIDCommand(Port *myport, StringInfo message);
 void ProcessCommitTransactionCommand(Port *myport, StringInfo message, bool is_backup);
+void ProcessCommitTransactionCommandMulti(Port *myport, StringInfo message, bool is_backup);
 void ProcessCommitPreparedTransactionCommand(Port *myport, StringInfo message, bool is_backup);
 void ProcessRollbackTransactionCommand(Port *myport, StringInfo message, bool is_backup);
 void ProcessStartPreparedTransactionCommand(Port *myport, StringInfo message, bool is_backup);
@@ -228,18 +175,8 @@ void ProcessBeginTransactionGetGXIDAutovacuumCommand(Port *myport, StringInfo me
 void ProcessBkupBeginTransactionGetGXIDAutovacuumCommand(Port *myport, StringInfo message);
 
 void ProcessBeginTransactionGetGXIDCommandMulti(Port *myport, StringInfo message);
-void ProcessCommitTransactionCommandMulti(Port *myport, StringInfo message, bool is_backup);
 void ProcessRollbackTransactionCommandMulti(Port *myport, StringInfo message, bool is_backup) ;
 
-void GTM_WriteRestorePointVersion(FILE *f);
-void GTM_RestoreStart(FILE *ctlf, struct GTM_RestoreContext *context);
-void GTM_SaveTxnInfo(FILE *ctlf);
-void GTM_RestoreTxnInfo(FILE *ctlf, GlobalTransactionId next_gxid,
-               struct GTM_RestoreContext *context, bool force_xid);
-void GTM_BkupBeginTransaction(GTM_IsolationLevel isolevel,
-                                                         bool readonly,
-                                                         const char *global_sessionid,
-                                                         uint32 client_id);
 void ProcessBkupBeginTransactionGetGXIDCommand(Port *myport, StringInfo message);
 void ProcessBkupBeginTransactionGetGXIDCommandMulti(Port *myport, StringInfo message);
 
@@ -249,7 +186,6 @@ void ProcessBkupBeginTransactionGetGXIDCommandMulti(Port *myport, StringInfo mes
  */
 void ProcessGetSnapshotCommand(Port *myport, StringInfo message, bool get_gxid);
 void ProcessGetSnapshotCommandMulti(Port *myport, StringInfo message);
-void GTM_FreeSnapshotData(GTM_Snapshot snapshot);
 void GTM_RememberDroppedSequence(GlobalTransactionId gxid, void *seq);
 void GTM_ForgetCreatedSequence(GlobalTransactionId gxid, void *seq);
 void GTM_RememberCreatedSequence(GlobalTransactionId gxid, void *seq);
index c40f4c912d9f9121a3810309e68ed1f0e487e7f0..4d50f3e82d193d8d88a13495b840efbc0fc97f31 100644 (file)
@@ -17,8 +17,6 @@
 #include "gtm/libpq-int.h"
 #include "gtm/gtm_msg.h"
 
-void gtm_util_init_nametabs(void);
 char *gtm_util_message_name(GTM_MessageType type);
-char *gtm_util_result_name(GTM_ResultType type);
 
 #endif /* GTM_UTILS_H */
index 332a4c89ddb97919c4fb42e628230fa8c04b9876..661a286c574f2fafa718c3ef278fde2ec457b5f1 100644 (file)
@@ -98,9 +98,7 @@ int Recovery_PGXCNodeUnregister(GTM_PGXCNodeType type,
                                                                char *node_name,
                                                                bool in_recovery,
                                                                int socket);
-int Recovery_PGXCNodeBackendDisconnect(GTM_PGXCNodeType type, char *nodename, int socket);
 
-void Recovery_RecordRegisterInfo(GTM_PGXCNodeInfo *nodeinfo, bool is_register);
 void Recovery_SaveRegisterInfo(void);
 void Recovery_PGXCNodeDisconnect(Port *myport);
 void Recovery_SaveRegisterFileName(char *dir);