|
20 | 20 | #include "utils/snapshot.h"
|
21 | 21 |
|
22 | 22 |
|
| 23 | +/* |
| 24 | + * These are to implement PROCARRAY_FLAGS_XXX |
| 25 | + * |
| 26 | + * Note: These flags are cloned from PROC_XXX flags in src/include/storage/proc.h |
| 27 | + * to avoid forcing to include proc.h when including procarray.h. So if you modify |
| 28 | + * PROC_XXX flags, you need to modify these flags. |
| 29 | + */ |
| 30 | +#define PROCARRAY_VACUUM_FLAG 0x02 /* currently running lazy vacuum */ |
| 31 | +#define PROCARRAY_ANALYZE_FLAG 0x04 /* currently running analyze */ |
| 32 | +#define PROCARRAY_LOGICAL_DECODING_FLAG 0x10 /* currently doing logical |
| 33 | + * decoding outside xact */ |
| 34 | + |
| 35 | +/* Use the following flags as an input "flags" to GetOldestXmin function */ |
| 36 | +/* Consider all backends except for logical decoding ones which manage xmin separately */ |
| 37 | +#define PROCARRAY_FLAGS_DEFAULT PROCARRAY_LOGICAL_DECODING_FLAG |
| 38 | +/* Ignore vacuum backends */ |
| 39 | +#define PROCARRAY_FLAGS_VACUUM PROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG |
| 40 | +/* Ignore analyze backends */ |
| 41 | +#define PROCARRAY_FLAGS_ANALYZE PROCARRAY_FLAGS_DEFAULT | PROCARRAY_ANALYZE_FLAG |
| 42 | +/* Ignore both vacuum and analyze backends */ |
| 43 | +#define PROCARRAY_FLAGS_VACUUM_ANALYZE PROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG | PROCARRAY_ANALYZE_FLAG |
| 44 | + |
23 | 45 | extern Size ProcArrayShmemSize(void);
|
24 | 46 | extern void CreateSharedProcArray(void);
|
25 | 47 | extern void ProcArrayAdd(PGPROC *proc);
|
@@ -53,7 +75,7 @@ extern RunningTransactions GetRunningTransactionData(void);
|
53 | 75 |
|
54 | 76 | extern bool TransactionIdIsInProgress(TransactionId xid);
|
55 | 77 | extern bool TransactionIdIsActive(TransactionId xid);
|
56 |
| -extern TransactionId GetOldestXmin(Relation rel, bool ignoreVacuum); |
| 78 | +extern TransactionId GetOldestXmin(Relation rel, int flags); |
57 | 79 | extern TransactionId GetOldestActiveTransactionId(void);
|
58 | 80 | extern TransactionId GetOldestSafeDecodingTransactionId(void);
|
59 | 81 |
|
|
0 commit comments