|
|
|
@ -20,6 +20,28 @@ |
|
|
|
|
#include "utils/snapshot.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* These are to implement PROCARRAY_FLAGS_XXX |
|
|
|
|
* |
|
|
|
|
* Note: These flags are cloned from PROC_XXX flags in src/include/storage/proc.h |
|
|
|
|
* to avoid forcing to include proc.h when including procarray.h. So if you modify |
|
|
|
|
* PROC_XXX flags, you need to modify these flags. |
|
|
|
|
*/ |
|
|
|
|
#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running lazy vacuum */ |
|
|
|
|
#define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running analyze */ |
|
|
|
|
#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing logical |
|
|
|
|
* decoding outside xact */ |
|
|
|
|
|
|
|
|
|
/* Use the following flags as an input "flags" to GetOldestXmin function */ |
|
|
|
|
/* Consider all backends except for logical decoding ones which manage xmin separately */ |
|
|
|
|
#define PROCARRAY_FLAGS_DEFAULT PROCARRAY_LOGICAL_DECODING_FLAG |
|
|
|
|
/* Ignore vacuum backends */ |
|
|
|
|
#define PROCARRAY_FLAGS_VACUUM PROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG |
|
|
|
|
/* Ignore analyze backends */ |
|
|
|
|
#define PROCARRAY_FLAGS_ANALYZE PROCARRAY_FLAGS_DEFAULT | PROCARRAY_ANALYZE_FLAG |
|
|
|
|
/* Ignore both vacuum and analyze backends */ |
|
|
|
|
#define PROCARRAY_FLAGS_VACUUM_ANALYZE PROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG | PROCARRAY_ANALYZE_FLAG |
|
|
|
|
|
|
|
|
|
extern Size ProcArrayShmemSize(void); |
|
|
|
|
extern void CreateSharedProcArray(void); |
|
|
|
|
extern void ProcArrayAdd(PGPROC *proc); |
|
|
|
@ -53,7 +75,7 @@ extern RunningTransactions GetRunningTransactionData(void); |
|
|
|
|
|
|
|
|
|
extern bool TransactionIdIsInProgress(TransactionId xid); |
|
|
|
|
extern bool TransactionIdIsActive(TransactionId xid); |
|
|
|
|
extern TransactionId GetOldestXmin(Relation rel, bool ignoreVacuum); |
|
|
|
|
extern TransactionId GetOldestXmin(Relation rel, int flags); |
|
|
|
|
extern TransactionId GetOldestActiveTransactionId(void); |
|
|
|
|
extern TransactionId GetOldestSafeDecodingTransactionId(void); |
|
|
|
|
|
|
|
|
|