mirror of
https://github.com/postgres/postgres.git
synced 2025-10-31 10:30:33 +03:00
Add the "snapshot too old" feature
This feature is controlled by a new old_snapshot_threshold GUC. A value of -1 disables the feature, and that is the default. The value of 0 is just intended for testing. Above that it is the number of minutes a snapshot can reach before pruning and vacuum are allowed to remove dead tuples which the snapshot would otherwise protect. The xmin associated with a transaction ID does still protect dead tuples. A connection which is using an "old" snapshot does not get an error unless it accesses a page modified recently enough that it might not be able to produce accurate results. This is similar to the Oracle feature, and we use the same SQLSTATE and error message for compatibility.
This commit is contained in:
@@ -18,12 +18,13 @@
|
||||
#include "storage/itemptr.h"
|
||||
#include "storage/off.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/snapshot.h"
|
||||
|
||||
/* struct definition lives in brin_revmap.c */
|
||||
typedef struct BrinRevmap BrinRevmap;
|
||||
|
||||
extern BrinRevmap *brinRevmapInitialize(Relation idxrel,
|
||||
BlockNumber *pagesPerRange);
|
||||
BlockNumber *pagesPerRange, Snapshot snapshot);
|
||||
extern void brinRevmapTerminate(BrinRevmap *revmap);
|
||||
|
||||
extern void brinRevmapExtend(BrinRevmap *revmap,
|
||||
@@ -34,6 +35,6 @@ extern void brinSetHeapBlockItemptr(Buffer rmbuf, BlockNumber pagesPerRange,
|
||||
BlockNumber heapBlk, ItemPointerData tid);
|
||||
extern BrinTuple *brinGetTupleForHeapBlock(BrinRevmap *revmap,
|
||||
BlockNumber heapBlk, Buffer *buf, OffsetNumber *off,
|
||||
Size *size, int mode);
|
||||
Size *size, int mode, Snapshot snapshot);
|
||||
|
||||
#endif /* BRIN_REVMAP_H */
|
||||
|
||||
Reference in New Issue
Block a user