|
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 | +#definePROCARRAY_VACUUM_FLAG0x02/* currently running lazy vacuum */ |
| 31 | +#definePROCARRAY_ANALYZE_FLAG0x04/* currently running analyze */ |
| 32 | +#definePROCARRAY_LOGICAL_DECODING_FLAG0x10/* 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 | +#definePROCARRAY_FLAGS_DEFAULTPROCARRAY_LOGICAL_DECODING_FLAG |
| 38 | +/* Ignore vacuum backends */ |
| 39 | +#definePROCARRAY_FLAGS_VACUUMPROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG |
| 40 | +/* Ignore analyze backends */ |
| 41 | +#definePROCARRAY_FLAGS_ANALYZEPROCARRAY_FLAGS_DEFAULT | PROCARRAY_ANALYZE_FLAG |
| 42 | +/* Ignore both vacuum and analyze backends */ |
| 43 | +#definePROCARRAY_FLAGS_VACUUM_ANALYZEPROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG | PROCARRAY_ANALYZE_FLAG |
| 44 | + |
23 | 45 | externSizeProcArrayShmemSize(void);
|
24 | 46 | externvoidCreateSharedProcArray(void);
|
25 | 47 | externvoidProcArrayAdd(PGPROC*proc);
|
@@ -53,7 +75,7 @@ extern RunningTransactions GetRunningTransactionData(void);
|
53 | 75 |
|
54 | 76 | externboolTransactionIdIsInProgress(TransactionIdxid);
|
55 | 77 | externboolTransactionIdIsActive(TransactionIdxid);
|
56 |
| -externTransactionIdGetOldestXmin(Relationrel,boolignoreVacuum); |
| 78 | +externTransactionIdGetOldestXmin(Relationrel,intflags); |
57 | 79 | externTransactionIdGetOldestActiveTransactionId(void);
|
58 | 80 | externTransactionIdGetOldestSafeDecodingTransactionId(void);
|
59 | 81 |
|
|