diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/storage/proc.h | 10 | ||||
-rw-r--r-- | src/include/storage/procarray.h | 6 | ||||
-rw-r--r-- | src/include/storage/procsignal.h | 8 | ||||
-rw-r--r-- | src/include/storage/standby.h | 7 | ||||
-rw-r--r-- | src/include/tcop/tcopprot.h | 4 |
5 files changed, 19 insertions, 16 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index cee02c359d7..50500903245 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.117 2010/01/15 09:19:09 heikki Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.118 2010/01/16 10:05:50 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -96,11 +96,11 @@ struct PGPROC uint8 vacuumFlags; /* vacuum-related flags, see above */ /* - * While in hot standby mode, setting recoveryConflictMode instructs - * the backend to commit suicide. Possible values are the same as those - * passed to ResolveRecoveryConflictWithVirtualXIDs(). + * While in hot standby mode, shows that a conflict signal has been sent + * for the current transaction. Set/cleared while holding ProcArrayLock, + * though not required. Accessed without lock, if needed. */ - int recoveryConflictMode; + bool recoveryConflictPending; /* Info about LWLock the process is currently waiting for, if any. */ bool lwWaiting; /* true if waiting for an LW lock */ diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index 4572f489af8..42953b0843c 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.29 2010/01/10 15:44:28 sriggs Exp $ + * $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.30 2010/01/16 10:05:56 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -15,6 +15,7 @@ #define PROCARRAY_H #include "storage/lock.h" +#include "storage/procsignal.h" #include "storage/standby.h" #include "utils/snapshot.h" @@ -58,8 +59,7 @@ extern VirtualTransactionId *GetCurrentVirtualXIDs(TransactionId limitXmin, int *nvxids); extern VirtualTransactionId *GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid, bool skipExistingConflicts); -extern pid_t CancelVirtualTransaction(VirtualTransactionId vxid, - int cancel_mode); +extern pid_t CancelVirtualTransaction(VirtualTransactionId vxid, ProcSignalReason sigmode); extern int CountActiveBackends(void); extern int CountDBBackends(Oid databaseid); diff --git a/src/include/storage/procsignal.h b/src/include/storage/procsignal.h index 9b707520ef8..cbe0e24c672 100644 --- a/src/include/storage/procsignal.h +++ b/src/include/storage/procsignal.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/procsignal.h,v 1.2 2010/01/02 16:58:08 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/procsignal.h,v 1.3 2010/01/16 10:05:57 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -32,6 +32,12 @@ typedef enum PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */ PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */ + /* Recovery conflict reasons */ + PROCSIG_RECOVERY_CONFLICT_DATABASE, + PROCSIG_RECOVERY_CONFLICT_TABLESPACE, + PROCSIG_RECOVERY_CONFLICT_LOCK, + PROCSIG_RECOVERY_CONFLICT_SNAPSHOT, + NUM_PROCSIGNALS /* Must be last! */ } ProcSignalReason; diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h index 3f2e2c2d855..8c982cffb63 100644 --- a/src/include/storage/standby.h +++ b/src/include/storage/standby.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.3 2010/01/14 11:08:02 sriggs Exp $ + * $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.4 2010/01/16 10:05:57 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -19,11 +19,6 @@ extern int vacuum_defer_cleanup_age; -/* cancel modes for ResolveRecoveryConflictWithVirtualXIDs */ -#define CONFLICT_MODE_NOT_SET 0 -#define CONFLICT_MODE_ERROR 1 /* Conflict can be resolved by canceling query */ -#define CONFLICT_MODE_FATAL 2 /* Conflict can only be resolved by disconnecting session */ - extern void ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid); extern void ResolveRecoveryConflictWithTablespace(Oid tsid); extern void ResolveRecoveryConflictWithDatabase(Oid dbid); diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index 891979dc8a2..b46160160ea 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.102 2010/01/02 16:58:09 momjian Exp $ + * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.103 2010/01/16 10:05:59 sriggs Exp $ * * OLD COMMENTS * This file was created so that other c files could get the two @@ -21,6 +21,7 @@ #include "executor/execdesc.h" #include "nodes/parsenodes.h" +#include "storage/procsignal.h" #include "utils/guc.h" @@ -64,6 +65,7 @@ extern void die(SIGNAL_ARGS); extern void quickdie(SIGNAL_ARGS); extern void StatementCancelHandler(SIGNAL_ARGS); extern void FloatExceptionHandler(SIGNAL_ARGS); +extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1 handler */ extern void prepare_for_client_read(void); extern void client_read_ended(void); extern const char *process_postgres_switches(int argc, char *argv[], |