mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Phase 2 pgindent run for v12.
Switch to 2.1 version of pg_bsd_indent. This formats multiline function declarations "correctly", that is with additional lines of parameter declarations indented to match where the first line's left parenthesis is. Discussion: https://postgr.es/m/CAEepm=0P3FeTXRcU5B2W3jv3PgRVZ-kGUXLGfd42FFhUROO3ug@mail.gmail.com
This commit is contained in:
@ -67,13 +67,13 @@ typedef struct BrinOpaque
|
||||
#define BRIN_ALL_BLOCKRANGES InvalidBlockNumber
|
||||
|
||||
static BrinBuildState *initialize_brin_buildstate(Relation idxRel,
|
||||
BrinRevmap *revmap, BlockNumber pagesPerRange);
|
||||
BrinRevmap *revmap, BlockNumber pagesPerRange);
|
||||
static void terminate_brin_buildstate(BrinBuildState *state);
|
||||
static void brinsummarize(Relation index, Relation heapRel, BlockNumber pageRange,
|
||||
bool include_partial, double *numSummarized, double *numExisting);
|
||||
bool include_partial, double *numSummarized, double *numExisting);
|
||||
static void form_and_insert_tuple(BrinBuildState *state);
|
||||
static void union_tuples(BrinDesc *bdesc, BrinMemTuple *a,
|
||||
BrinTuple *b);
|
||||
BrinTuple *b);
|
||||
static void brin_vacuum_scan(Relation idxrel, BufferAccessStrategy strategy);
|
||||
|
||||
|
||||
|
@ -82,9 +82,9 @@ typedef struct InclusionOpaque
|
||||
} InclusionOpaque;
|
||||
|
||||
static FmgrInfo *inclusion_get_procinfo(BrinDesc *bdesc, uint16 attno,
|
||||
uint16 procnum);
|
||||
uint16 procnum);
|
||||
static FmgrInfo *inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno,
|
||||
Oid subtype, uint16 strategynum);
|
||||
Oid subtype, uint16 strategynum);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -30,7 +30,7 @@ typedef struct MinmaxOpaque
|
||||
} MinmaxOpaque;
|
||||
|
||||
static FmgrInfo *minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno,
|
||||
Oid subtype, uint16 strategynum);
|
||||
Oid subtype, uint16 strategynum);
|
||||
|
||||
|
||||
Datum
|
||||
|
@ -34,7 +34,7 @@
|
||||
MAXALIGN(sizeof(BrinSpecialSpace))))
|
||||
|
||||
static Buffer brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz,
|
||||
bool *extended);
|
||||
bool *extended);
|
||||
static Size br_page_get_freespace(Page page);
|
||||
static void brin_initialize_empty_new_buffer(Relation idxrel, Buffer buffer);
|
||||
|
||||
|
@ -57,10 +57,10 @@ struct BrinRevmap
|
||||
|
||||
|
||||
static BlockNumber revmap_get_blkno(BrinRevmap *revmap,
|
||||
BlockNumber heapBlk);
|
||||
BlockNumber heapBlk);
|
||||
static Buffer revmap_get_buffer(BrinRevmap *revmap, BlockNumber heapBlk);
|
||||
static BlockNumber revmap_extend_and_get_blkno(BrinRevmap *revmap,
|
||||
BlockNumber heapBlk);
|
||||
BlockNumber heapBlk);
|
||||
static void revmap_physical_extend(BrinRevmap *revmap);
|
||||
|
||||
/*
|
||||
|
@ -40,8 +40,8 @@
|
||||
|
||||
|
||||
static inline void brin_deconstruct_tuple(BrinDesc *brdesc,
|
||||
char *tp, bits8 *nullbits, bool nulls,
|
||||
Datum *values, bool *allnulls, bool *hasnulls);
|
||||
char *tp, bits8 *nullbits, bool nulls,
|
||||
Datum *values, bool *allnulls, bool *hasnulls);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
static void printtup_startup(DestReceiver *self, int operation,
|
||||
TupleDesc typeinfo);
|
||||
TupleDesc typeinfo);
|
||||
static bool printtup(TupleTableSlot *slot, DestReceiver *self);
|
||||
static bool printtup_20(TupleTableSlot *slot, DestReceiver *self);
|
||||
static bool printtup_internal_20(TupleTableSlot *slot, DestReceiver *self);
|
||||
@ -33,9 +33,9 @@ static void printtup_shutdown(DestReceiver *self);
|
||||
static void printtup_destroy(DestReceiver *self);
|
||||
|
||||
static void SendRowDescriptionCols_2(StringInfo buf, TupleDesc typeinfo,
|
||||
List *targetlist, int16 *formats);
|
||||
List *targetlist, int16 *formats);
|
||||
static void SendRowDescriptionCols_3(StringInfo buf, TupleDesc typeinfo,
|
||||
List *targetlist, int16 *formats);
|
||||
List *targetlist, int16 *formats);
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* printtup / debugtup support
|
||||
|
@ -475,7 +475,7 @@ static bool need_initialization = true;
|
||||
|
||||
static void initialize_reloptions(void);
|
||||
static void parse_one_reloption(relopt_value *option, char *text_str,
|
||||
int text_len, bool validate);
|
||||
int text_len, bool validate);
|
||||
|
||||
/*
|
||||
* initialize_reloptions
|
||||
|
@ -24,10 +24,10 @@
|
||||
|
||||
static void ginFindParents(GinBtree btree, GinBtreeStack *stack);
|
||||
static bool ginPlaceToPage(GinBtree btree, GinBtreeStack *stack,
|
||||
void *insertdata, BlockNumber updateblkno,
|
||||
Buffer childbuf, GinStatsData *buildStats);
|
||||
void *insertdata, BlockNumber updateblkno,
|
||||
Buffer childbuf, GinStatsData *buildStats);
|
||||
static void ginFinishSplit(GinBtree btree, GinBtreeStack *stack,
|
||||
bool freestack, GinStatsData *buildStats);
|
||||
bool freestack, GinStatsData *buildStats);
|
||||
|
||||
/*
|
||||
* Lock buffer by needed method for search.
|
||||
|
@ -104,20 +104,20 @@ typedef struct
|
||||
|
||||
static ItemPointer dataLeafPageGetUncompressed(Page page, int *nitems);
|
||||
static void dataSplitPageInternal(GinBtree btree, Buffer origbuf,
|
||||
GinBtreeStack *stack,
|
||||
void *insertdata, BlockNumber updateblkno,
|
||||
Page *newlpage, Page *newrpage);
|
||||
GinBtreeStack *stack,
|
||||
void *insertdata, BlockNumber updateblkno,
|
||||
Page *newlpage, Page *newrpage);
|
||||
|
||||
static disassembledLeaf *disassembleLeaf(Page page);
|
||||
static bool leafRepackItems(disassembledLeaf *leaf, ItemPointer remaining);
|
||||
static bool addItemsToLeaf(disassembledLeaf *leaf, ItemPointer newItems,
|
||||
int nNewItems);
|
||||
int nNewItems);
|
||||
|
||||
static void computeLeafRecompressWALData(disassembledLeaf *leaf);
|
||||
static void dataPlaceToPageLeafRecompress(Buffer buf, disassembledLeaf *leaf);
|
||||
static void dataPlaceToPageLeafSplit(disassembledLeaf *leaf,
|
||||
ItemPointerData lbound, ItemPointerData rbound,
|
||||
Page lpage, Page rpage);
|
||||
ItemPointerData lbound, ItemPointerData rbound,
|
||||
Page lpage, Page rpage);
|
||||
|
||||
/*
|
||||
* Read TIDs from leaf data page to single uncompressed array. The TIDs are
|
||||
|
@ -21,10 +21,10 @@
|
||||
#include "utils/rel.h"
|
||||
|
||||
static void entrySplitPage(GinBtree btree, Buffer origbuf,
|
||||
GinBtreeStack *stack,
|
||||
GinBtreeEntryInsertData *insertData,
|
||||
BlockNumber updateblkno,
|
||||
Page *newlpage, Page *newrpage);
|
||||
GinBtreeStack *stack,
|
||||
GinBtreeEntryInsertData *insertData,
|
||||
BlockNumber updateblkno,
|
||||
Page *newlpage, Page *newrpage);
|
||||
|
||||
/*
|
||||
* Form a tuple for entry tree.
|
||||
|
@ -30,16 +30,16 @@
|
||||
/* non-export function prototypes */
|
||||
static void gistfixsplit(GISTInsertState *state, GISTSTATE *giststate);
|
||||
static bool gistinserttuple(GISTInsertState *state, GISTInsertStack *stack,
|
||||
GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum);
|
||||
GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum);
|
||||
static bool gistinserttuples(GISTInsertState *state, GISTInsertStack *stack,
|
||||
GISTSTATE *giststate,
|
||||
IndexTuple *tuples, int ntup, OffsetNumber oldoffnum,
|
||||
Buffer leftchild, Buffer rightchild,
|
||||
bool unlockbuf, bool unlockleftchild);
|
||||
GISTSTATE *giststate,
|
||||
IndexTuple *tuples, int ntup, OffsetNumber oldoffnum,
|
||||
Buffer leftchild, Buffer rightchild,
|
||||
bool unlockbuf, bool unlockleftchild);
|
||||
static void gistfinishsplit(GISTInsertState *state, GISTInsertStack *stack,
|
||||
GISTSTATE *giststate, List *splitinfo, bool releasebuf);
|
||||
GISTSTATE *giststate, List *splitinfo, bool releasebuf);
|
||||
static void gistprunepage(Relation rel, Page page, Buffer buffer,
|
||||
Relation heapRel);
|
||||
Relation heapRel);
|
||||
|
||||
|
||||
#define ROTATEDIST(d) do { \
|
||||
|
@ -80,30 +80,30 @@ typedef struct
|
||||
static void gistInitBuffering(GISTBuildState *buildstate);
|
||||
static int calculatePagesPerBuffer(GISTBuildState *buildstate, int levelStep);
|
||||
static void gistBuildCallback(Relation index,
|
||||
HeapTuple htup,
|
||||
Datum *values,
|
||||
bool *isnull,
|
||||
bool tupleIsAlive,
|
||||
void *state);
|
||||
HeapTuple htup,
|
||||
Datum *values,
|
||||
bool *isnull,
|
||||
bool tupleIsAlive,
|
||||
void *state);
|
||||
static void gistBufferingBuildInsert(GISTBuildState *buildstate,
|
||||
IndexTuple itup);
|
||||
IndexTuple itup);
|
||||
static bool gistProcessItup(GISTBuildState *buildstate, IndexTuple itup,
|
||||
BlockNumber startblkno, int startlevel);
|
||||
BlockNumber startblkno, int startlevel);
|
||||
static BlockNumber gistbufferinginserttuples(GISTBuildState *buildstate,
|
||||
Buffer buffer, int level,
|
||||
IndexTuple *itup, int ntup, OffsetNumber oldoffnum,
|
||||
BlockNumber parentblk, OffsetNumber downlinkoffnum);
|
||||
Buffer buffer, int level,
|
||||
IndexTuple *itup, int ntup, OffsetNumber oldoffnum,
|
||||
BlockNumber parentblk, OffsetNumber downlinkoffnum);
|
||||
static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate,
|
||||
BlockNumber childblkno, int level,
|
||||
BlockNumber *parentblk,
|
||||
OffsetNumber *downlinkoffnum);
|
||||
BlockNumber childblkno, int level,
|
||||
BlockNumber *parentblk,
|
||||
OffsetNumber *downlinkoffnum);
|
||||
static void gistProcessEmptyingQueue(GISTBuildState *buildstate);
|
||||
static void gistEmptyAllBuffers(GISTBuildState *buildstate);
|
||||
static int gistGetMaxLevel(Relation index);
|
||||
|
||||
static void gistInitParentMap(GISTBuildState *buildstate);
|
||||
static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child,
|
||||
BlockNumber parent);
|
||||
BlockNumber parent);
|
||||
static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent);
|
||||
static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child);
|
||||
|
||||
|
@ -25,15 +25,15 @@
|
||||
|
||||
static GISTNodeBufferPage *gistAllocateNewPageBuffer(GISTBuildBuffers *gfbb);
|
||||
static void gistAddLoadedBuffer(GISTBuildBuffers *gfbb,
|
||||
GISTNodeBuffer *nodeBuffer);
|
||||
GISTNodeBuffer *nodeBuffer);
|
||||
static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb,
|
||||
GISTNodeBuffer *nodeBuffer);
|
||||
GISTNodeBuffer *nodeBuffer);
|
||||
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
|
||||
GISTNodeBuffer *nodeBuffer);
|
||||
GISTNodeBuffer *nodeBuffer);
|
||||
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
|
||||
IndexTuple item);
|
||||
IndexTuple item);
|
||||
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
|
||||
IndexTuple *item);
|
||||
IndexTuple *item);
|
||||
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
|
||||
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);
|
||||
|
||||
|
@ -27,9 +27,9 @@
|
||||
|
||||
|
||||
static bool gist_box_leaf_consistent(BOX *key, BOX *query,
|
||||
StrategyNumber strategy);
|
||||
StrategyNumber strategy);
|
||||
static bool rtree_internal_consistent(BOX *key, BOX *query,
|
||||
StrategyNumber strategy);
|
||||
StrategyNumber strategy);
|
||||
|
||||
/* Minimum accepted ratio of split */
|
||||
#define LIMIT_RATIO 0.3
|
||||
|
@ -52,14 +52,14 @@ typedef struct
|
||||
} GistVacState;
|
||||
|
||||
static void gistvacuumscan(IndexVacuumInfo *info, GistBulkDeleteResult *stats,
|
||||
IndexBulkDeleteCallback callback, void *callback_state);
|
||||
IndexBulkDeleteCallback callback, void *callback_state);
|
||||
static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno,
|
||||
BlockNumber orig_blkno);
|
||||
BlockNumber orig_blkno);
|
||||
static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info,
|
||||
GistBulkDeleteResult *stats);
|
||||
GistBulkDeleteResult *stats);
|
||||
static bool gistdeletepage(IndexVacuumInfo *info, GistBulkDeleteResult *stats,
|
||||
Buffer buffer, OffsetNumber downlink,
|
||||
Buffer leafBuffer);
|
||||
Buffer buffer, OffsetNumber downlink,
|
||||
Buffer leafBuffer);
|
||||
|
||||
/* allocate the 'stats' struct that's kept over vacuum stages */
|
||||
static GistBulkDeleteResult *
|
||||
|
@ -43,11 +43,11 @@ typedef struct
|
||||
} HashBuildState;
|
||||
|
||||
static void hashbuildCallback(Relation index,
|
||||
HeapTuple htup,
|
||||
Datum *values,
|
||||
bool *isnull,
|
||||
bool tupleIsAlive,
|
||||
void *state);
|
||||
HeapTuple htup,
|
||||
Datum *values,
|
||||
bool *isnull,
|
||||
bool tupleIsAlive,
|
||||
void *state);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "storage/predicate.h"
|
||||
|
||||
static void _hash_vacuum_one_page(Relation rel, Relation hrel,
|
||||
Buffer metabuf, Buffer buf);
|
||||
Buffer metabuf, Buffer buf);
|
||||
|
||||
/*
|
||||
* _hash_doinsert() -- Handle insertion of a single index tuple.
|
||||
|
@ -37,14 +37,14 @@
|
||||
|
||||
|
||||
static bool _hash_alloc_buckets(Relation rel, BlockNumber firstblock,
|
||||
uint32 nblocks);
|
||||
uint32 nblocks);
|
||||
static void _hash_splitbucket(Relation rel, Buffer metabuf,
|
||||
Bucket obucket, Bucket nbucket,
|
||||
Buffer obuf,
|
||||
Buffer nbuf,
|
||||
HTAB *htab,
|
||||
uint32 maxbucket,
|
||||
uint32 highmask, uint32 lowmask);
|
||||
Bucket obucket, Bucket nbucket,
|
||||
Buffer obuf,
|
||||
Buffer nbuf,
|
||||
HTAB *htab,
|
||||
uint32 maxbucket,
|
||||
uint32 highmask, uint32 lowmask);
|
||||
static void log_split_page(Relation rel, Buffer buf);
|
||||
|
||||
|
||||
|
@ -22,13 +22,13 @@
|
||||
#include "storage/predicate.h"
|
||||
|
||||
static bool _hash_readpage(IndexScanDesc scan, Buffer *bufP,
|
||||
ScanDirection dir);
|
||||
static int _hash_load_qualified_items(IndexScanDesc scan, Page page,
|
||||
OffsetNumber offnum, ScanDirection dir);
|
||||
ScanDirection dir);
|
||||
static int _hash_load_qualified_items(IndexScanDesc scan, Page page,
|
||||
OffsetNumber offnum, ScanDirection dir);
|
||||
static inline void _hash_saveitem(HashScanOpaque so, int itemIndex,
|
||||
OffsetNumber offnum, IndexTuple itup);
|
||||
OffsetNumber offnum, IndexTuple itup);
|
||||
static void _hash_readnext(IndexScanDesc scan, Buffer *bufp,
|
||||
Page *pagep, HashPageOpaque *opaquep);
|
||||
Page *pagep, HashPageOpaque *opaquep);
|
||||
|
||||
/*
|
||||
* _hash_next() -- Get the next item in a scan.
|
||||
|
@ -71,39 +71,39 @@
|
||||
|
||||
|
||||
static HeapTuple heap_prepare_insert(Relation relation, HeapTuple tup,
|
||||
TransactionId xid, CommandId cid, int options);
|
||||
TransactionId xid, CommandId cid, int options);
|
||||
static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf,
|
||||
Buffer newbuf, HeapTuple oldtup,
|
||||
HeapTuple newtup, HeapTuple old_key_tup,
|
||||
bool all_visible_cleared, bool new_all_visible_cleared);
|
||||
Buffer newbuf, HeapTuple oldtup,
|
||||
HeapTuple newtup, HeapTuple old_key_tup,
|
||||
bool all_visible_cleared, bool new_all_visible_cleared);
|
||||
static Bitmapset *HeapDetermineModifiedColumns(Relation relation,
|
||||
Bitmapset *interesting_cols,
|
||||
HeapTuple oldtup, HeapTuple newtup);
|
||||
Bitmapset *interesting_cols,
|
||||
HeapTuple oldtup, HeapTuple newtup);
|
||||
static bool heap_acquire_tuplock(Relation relation, ItemPointer tid,
|
||||
LockTupleMode mode, LockWaitPolicy wait_policy,
|
||||
bool *have_tuple_lock);
|
||||
LockTupleMode mode, LockWaitPolicy wait_policy,
|
||||
bool *have_tuple_lock);
|
||||
static void compute_new_xmax_infomask(TransactionId xmax, uint16 old_infomask,
|
||||
uint16 old_infomask2, TransactionId add_to_xmax,
|
||||
LockTupleMode mode, bool is_update,
|
||||
TransactionId *result_xmax, uint16 *result_infomask,
|
||||
uint16 *result_infomask2);
|
||||
uint16 old_infomask2, TransactionId add_to_xmax,
|
||||
LockTupleMode mode, bool is_update,
|
||||
TransactionId *result_xmax, uint16 *result_infomask,
|
||||
uint16 *result_infomask2);
|
||||
static TM_Result heap_lock_updated_tuple(Relation rel, HeapTuple tuple,
|
||||
ItemPointer ctid, TransactionId xid,
|
||||
LockTupleMode mode);
|
||||
ItemPointer ctid, TransactionId xid,
|
||||
LockTupleMode mode);
|
||||
static void GetMultiXactIdHintBits(MultiXactId multi, uint16 *new_infomask,
|
||||
uint16 *new_infomask2);
|
||||
uint16 *new_infomask2);
|
||||
static TransactionId MultiXactIdGetUpdateXid(TransactionId xmax,
|
||||
uint16 t_infomask);
|
||||
uint16 t_infomask);
|
||||
static bool DoesMultiXactIdConflict(MultiXactId multi, uint16 infomask,
|
||||
LockTupleMode lockmode);
|
||||
LockTupleMode lockmode);
|
||||
static void MultiXactIdWait(MultiXactId multi, MultiXactStatus status, uint16 infomask,
|
||||
Relation rel, ItemPointer ctid, XLTW_Oper oper,
|
||||
int *remaining);
|
||||
Relation rel, ItemPointer ctid, XLTW_Oper oper,
|
||||
int *remaining);
|
||||
static bool ConditionalMultiXactIdWait(MultiXactId multi, MultiXactStatus status,
|
||||
uint16 infomask, Relation rel, int *remaining);
|
||||
uint16 infomask, Relation rel, int *remaining);
|
||||
static XLogRecPtr log_heap_new_cid(Relation relation, HeapTuple tup);
|
||||
static HeapTuple ExtractReplicaIdentity(Relation rel, HeapTuple tup, bool key_modified,
|
||||
bool *copy);
|
||||
bool *copy);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -51,12 +51,12 @@
|
||||
|
||||
|
||||
static void reform_and_rewrite_tuple(HeapTuple tuple,
|
||||
Relation OldHeap, Relation NewHeap,
|
||||
Datum *values, bool *isnull, RewriteState rwstate);
|
||||
Relation OldHeap, Relation NewHeap,
|
||||
Datum *values, bool *isnull, RewriteState rwstate);
|
||||
|
||||
static bool SampleHeapTupleVisible(TableScanDesc scan, Buffer buffer,
|
||||
HeapTuple tuple,
|
||||
OffsetNumber tupoffset);
|
||||
HeapTuple tuple,
|
||||
OffsetNumber tupoffset);
|
||||
|
||||
static BlockNumber heapam_scan_get_blocks_done(HeapScanDesc hscan);
|
||||
|
||||
|
@ -43,13 +43,13 @@ typedef struct
|
||||
} PruneState;
|
||||
|
||||
/* Local functions */
|
||||
static int heap_prune_chain(Relation relation, Buffer buffer,
|
||||
OffsetNumber rootoffnum,
|
||||
TransactionId OldestXmin,
|
||||
PruneState *prstate);
|
||||
static int heap_prune_chain(Relation relation, Buffer buffer,
|
||||
OffsetNumber rootoffnum,
|
||||
TransactionId OldestXmin,
|
||||
PruneState *prstate);
|
||||
static void heap_prune_record_prunable(PruneState *prstate, TransactionId xid);
|
||||
static void heap_prune_record_redirect(PruneState *prstate,
|
||||
OffsetNumber offnum, OffsetNumber rdoffnum);
|
||||
OffsetNumber offnum, OffsetNumber rdoffnum);
|
||||
static void heap_prune_record_dead(PruneState *prstate, OffsetNumber offnum);
|
||||
static void heap_prune_record_unused(PruneState *prstate, OffsetNumber offnum);
|
||||
|
||||
|
@ -116,7 +116,7 @@ static ss_scan_locations_t *scan_locations;
|
||||
|
||||
/* prototypes for internal functions */
|
||||
static BlockNumber ss_search(RelFileNode relfilenode,
|
||||
BlockNumber location, bool set);
|
||||
BlockNumber location, bool set);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -68,20 +68,20 @@ typedef struct toast_compress_header
|
||||
|
||||
static void toast_delete_datum(Relation rel, Datum value, bool is_speculative);
|
||||
static Datum toast_save_datum(Relation rel, Datum value,
|
||||
struct varlena *oldexternal, int options);
|
||||
struct varlena *oldexternal, int options);
|
||||
static bool toastrel_valueid_exists(Relation toastrel, Oid valueid);
|
||||
static bool toastid_valueid_exists(Oid toastrelid, Oid valueid);
|
||||
static struct varlena *toast_fetch_datum(struct varlena *attr);
|
||||
static struct varlena *toast_fetch_datum_slice(struct varlena *attr,
|
||||
int32 sliceoffset, int32 length);
|
||||
int32 sliceoffset, int32 length);
|
||||
static struct varlena *toast_decompress_datum(struct varlena *attr);
|
||||
static struct varlena *toast_decompress_datum_slice(struct varlena *attr, int32 slicelength);
|
||||
static int toast_open_indexes(Relation toastrel,
|
||||
LOCKMODE lock,
|
||||
Relation **toastidxs,
|
||||
int *num_indexes);
|
||||
static int toast_open_indexes(Relation toastrel,
|
||||
LOCKMODE lock,
|
||||
Relation **toastidxs,
|
||||
int *num_indexes);
|
||||
static void toast_close_indexes(Relation *toastidxs, int num_indexes,
|
||||
LOCKMODE lock);
|
||||
LOCKMODE lock);
|
||||
static void init_toast_snapshot(Snapshot toast_snapshot);
|
||||
|
||||
|
||||
|
@ -151,30 +151,30 @@ static BufferAccessStrategy vac_strategy;
|
||||
|
||||
/* non-export function prototypes */
|
||||
static void lazy_scan_heap(Relation onerel, VacuumParams *params,
|
||||
LVRelStats *vacrelstats, Relation *Irel, int nindexes,
|
||||
bool aggressive);
|
||||
LVRelStats *vacrelstats, Relation *Irel, int nindexes,
|
||||
bool aggressive);
|
||||
static void lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats);
|
||||
static bool lazy_check_needs_freeze(Buffer buf, bool *hastup);
|
||||
static void lazy_vacuum_index(Relation indrel,
|
||||
IndexBulkDeleteResult **stats,
|
||||
LVRelStats *vacrelstats);
|
||||
IndexBulkDeleteResult **stats,
|
||||
LVRelStats *vacrelstats);
|
||||
static void lazy_cleanup_index(Relation indrel,
|
||||
IndexBulkDeleteResult *stats,
|
||||
LVRelStats *vacrelstats);
|
||||
static int lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer,
|
||||
int tupindex, LVRelStats *vacrelstats, Buffer *vmbuffer);
|
||||
IndexBulkDeleteResult *stats,
|
||||
LVRelStats *vacrelstats);
|
||||
static int lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer,
|
||||
int tupindex, LVRelStats *vacrelstats, Buffer *vmbuffer);
|
||||
static bool should_attempt_truncation(VacuumParams *params,
|
||||
LVRelStats *vacrelstats);
|
||||
LVRelStats *vacrelstats);
|
||||
static void lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats);
|
||||
static BlockNumber count_nondeletable_pages(Relation onerel,
|
||||
LVRelStats *vacrelstats);
|
||||
LVRelStats *vacrelstats);
|
||||
static void lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks);
|
||||
static void lazy_record_dead_tuple(LVRelStats *vacrelstats,
|
||||
ItemPointer itemptr);
|
||||
ItemPointer itemptr);
|
||||
static bool lazy_tid_reaped(ItemPointer itemptr, void *state);
|
||||
static int vac_cmp_itemptr(const void *left, const void *right);
|
||||
static bool heap_page_is_all_visible(Relation rel, Buffer buf,
|
||||
TransactionId *visibility_cutoff_xid, bool *all_frozen);
|
||||
TransactionId *visibility_cutoff_xid, bool *all_frozen);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -99,8 +99,8 @@ do { \
|
||||
} while(0)
|
||||
|
||||
static IndexScanDesc index_beginscan_internal(Relation indexRelation,
|
||||
int nkeys, int norderbys, Snapshot snapshot,
|
||||
ParallelIndexScanDesc pscan, bool temp_snap);
|
||||
int nkeys, int norderbys, Snapshot snapshot,
|
||||
ParallelIndexScanDesc pscan, bool temp_snap);
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
|
@ -32,29 +32,29 @@
|
||||
static Buffer _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf);
|
||||
|
||||
static TransactionId _bt_check_unique(Relation rel, BTInsertState insertstate,
|
||||
Relation heapRel,
|
||||
IndexUniqueCheck checkUnique, bool *is_unique,
|
||||
uint32 *speculativeToken);
|
||||
Relation heapRel,
|
||||
IndexUniqueCheck checkUnique, bool *is_unique,
|
||||
uint32 *speculativeToken);
|
||||
static OffsetNumber _bt_findinsertloc(Relation rel,
|
||||
BTInsertState insertstate,
|
||||
bool checkingunique,
|
||||
BTStack stack,
|
||||
Relation heapRel);
|
||||
BTInsertState insertstate,
|
||||
bool checkingunique,
|
||||
BTStack stack,
|
||||
Relation heapRel);
|
||||
static void _bt_stepright(Relation rel, BTInsertState insertstate, BTStack stack);
|
||||
static void _bt_insertonpg(Relation rel, BTScanInsert itup_key,
|
||||
Buffer buf,
|
||||
Buffer cbuf,
|
||||
BTStack stack,
|
||||
IndexTuple itup,
|
||||
OffsetNumber newitemoff,
|
||||
bool split_only_page);
|
||||
Buffer buf,
|
||||
Buffer cbuf,
|
||||
BTStack stack,
|
||||
IndexTuple itup,
|
||||
OffsetNumber newitemoff,
|
||||
bool split_only_page);
|
||||
static Buffer _bt_split(Relation rel, BTScanInsert itup_key, Buffer buf,
|
||||
Buffer cbuf, OffsetNumber newitemoff, Size newitemsz,
|
||||
IndexTuple newitem);
|
||||
Buffer cbuf, OffsetNumber newitemoff, Size newitemsz,
|
||||
IndexTuple newitem);
|
||||
static void _bt_insert_parent(Relation rel, Buffer buf, Buffer rbuf,
|
||||
BTStack stack, bool is_root, bool is_only);
|
||||
BTStack stack, bool is_root, bool is_only);
|
||||
static bool _bt_pgaddtup(Page page, Size itemsize, IndexTuple itup,
|
||||
OffsetNumber itup_off);
|
||||
OffsetNumber itup_off);
|
||||
static void _bt_vacuum_one_page(Relation rel, Buffer buffer, Relation heapRel);
|
||||
|
||||
/*
|
||||
|
@ -37,12 +37,12 @@ static void _bt_cachemetadata(Relation rel, BTMetaPageData *input);
|
||||
static BTMetaPageData *_bt_getmeta(Relation rel, Buffer metabuf);
|
||||
static bool _bt_mark_page_halfdead(Relation rel, Buffer buf, BTStack stack);
|
||||
static bool _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf,
|
||||
bool *rightsib_empty);
|
||||
bool *rightsib_empty);
|
||||
static bool _bt_lock_branch_parent(Relation rel, BlockNumber child,
|
||||
BTStack stack, Buffer *topparent, OffsetNumber *topoff,
|
||||
BlockNumber *target, BlockNumber *rightsib);
|
||||
BTStack stack, Buffer *topparent, OffsetNumber *topoff,
|
||||
BlockNumber *target, BlockNumber *rightsib);
|
||||
static void _bt_log_reuse_page(Relation rel, BlockNumber blkno,
|
||||
TransactionId latestRemovedXid);
|
||||
TransactionId latestRemovedXid);
|
||||
|
||||
/*
|
||||
* _bt_initmetapage() -- Fill a page buffer with a correct metapage image
|
||||
|
@ -93,10 +93,10 @@ typedef struct BTParallelScanDescData *BTParallelScanDesc;
|
||||
|
||||
|
||||
static void btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
|
||||
IndexBulkDeleteCallback callback, void *callback_state,
|
||||
BTCycleId cycleid, TransactionId *oldestBtpoXact);
|
||||
IndexBulkDeleteCallback callback, void *callback_state,
|
||||
BTCycleId cycleid, TransactionId *oldestBtpoXact);
|
||||
static void btvacuumpage(BTVacState *vstate, BlockNumber blkno,
|
||||
BlockNumber orig_blkno);
|
||||
BlockNumber orig_blkno);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -27,13 +27,13 @@
|
||||
static void _bt_drop_lock_and_maybe_pin(IndexScanDesc scan, BTScanPos sp);
|
||||
static OffsetNumber _bt_binsrch(Relation rel, BTScanInsert key, Buffer buf);
|
||||
static bool _bt_readpage(IndexScanDesc scan, ScanDirection dir,
|
||||
OffsetNumber offnum);
|
||||
OffsetNumber offnum);
|
||||
static void _bt_saveitem(BTScanOpaque so, int itemIndex,
|
||||
OffsetNumber offnum, IndexTuple itup);
|
||||
OffsetNumber offnum, IndexTuple itup);
|
||||
static bool _bt_steppage(IndexScanDesc scan, ScanDirection dir);
|
||||
static bool _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir);
|
||||
static bool _bt_parallel_readpage(IndexScanDesc scan, BlockNumber blkno,
|
||||
ScanDirection dir);
|
||||
ScanDirection dir);
|
||||
static Buffer _bt_walk_left(Relation rel, Buffer buf, Snapshot snapshot);
|
||||
static bool _bt_endpoint(IndexScanDesc scan, ScanDirection dir);
|
||||
static inline void _bt_initialize_more_data(BTScanOpaque so, ScanDirection dir);
|
||||
|
@ -273,34 +273,34 @@ typedef struct BTWriteState
|
||||
|
||||
|
||||
static double _bt_spools_heapscan(Relation heap, Relation index,
|
||||
BTBuildState *buildstate, IndexInfo *indexInfo);
|
||||
BTBuildState *buildstate, IndexInfo *indexInfo);
|
||||
static void _bt_spooldestroy(BTSpool *btspool);
|
||||
static void _bt_spool(BTSpool *btspool, ItemPointer self,
|
||||
Datum *values, bool *isnull);
|
||||
Datum *values, bool *isnull);
|
||||
static void _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2);
|
||||
static void _bt_build_callback(Relation index, HeapTuple htup, Datum *values,
|
||||
bool *isnull, bool tupleIsAlive, void *state);
|
||||
bool *isnull, bool tupleIsAlive, void *state);
|
||||
static Page _bt_blnewpage(uint32 level);
|
||||
static BTPageState *_bt_pagestate(BTWriteState *wstate, uint32 level);
|
||||
static void _bt_slideleft(Page page);
|
||||
static void _bt_sortaddtup(Page page, Size itemsize,
|
||||
IndexTuple itup, OffsetNumber itup_off);
|
||||
IndexTuple itup, OffsetNumber itup_off);
|
||||
static void _bt_buildadd(BTWriteState *wstate, BTPageState *state,
|
||||
IndexTuple itup);
|
||||
IndexTuple itup);
|
||||
static void _bt_uppershutdown(BTWriteState *wstate, BTPageState *state);
|
||||
static void _bt_load(BTWriteState *wstate,
|
||||
BTSpool *btspool, BTSpool *btspool2);
|
||||
BTSpool *btspool, BTSpool *btspool2);
|
||||
static void _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent,
|
||||
int request);
|
||||
int request);
|
||||
static void _bt_end_parallel(BTLeader *btleader);
|
||||
static Size _bt_parallel_estimate_shared(Relation heap, Snapshot snapshot);
|
||||
static double _bt_parallel_heapscan(BTBuildState *buildstate,
|
||||
bool *brokenhotchain);
|
||||
bool *brokenhotchain);
|
||||
static void _bt_leader_participate_as_worker(BTBuildState *buildstate);
|
||||
static void _bt_parallel_scan_and_sort(BTSpool *btspool, BTSpool *btspool2,
|
||||
BTShared *btshared, Sharedsort *sharedsort,
|
||||
Sharedsort *sharedsort2, int sortmem,
|
||||
bool progress);
|
||||
BTShared *btshared, Sharedsort *sharedsort,
|
||||
Sharedsort *sharedsort2, int sortmem,
|
||||
bool progress);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -65,25 +65,25 @@ typedef struct
|
||||
} FindSplitData;
|
||||
|
||||
static void _bt_recsplitloc(FindSplitData *state,
|
||||
OffsetNumber firstoldonright, bool newitemonleft,
|
||||
int olddataitemstoleft, Size firstoldonrightsz);
|
||||
OffsetNumber firstoldonright, bool newitemonleft,
|
||||
int olddataitemstoleft, Size firstoldonrightsz);
|
||||
static void _bt_deltasortsplits(FindSplitData *state, double fillfactormult,
|
||||
bool usemult);
|
||||
bool usemult);
|
||||
static int _bt_splitcmp(const void *arg1, const void *arg2);
|
||||
static bool _bt_afternewitemoff(FindSplitData *state, OffsetNumber maxoff,
|
||||
int leaffillfactor, bool *usemult);
|
||||
int leaffillfactor, bool *usemult);
|
||||
static bool _bt_adjacenthtid(ItemPointer lowhtid, ItemPointer highhtid);
|
||||
static OffsetNumber _bt_bestsplitloc(FindSplitData *state, int perfectpenalty,
|
||||
bool *newitemonleft);
|
||||
static int _bt_strategy(FindSplitData *state, SplitPoint *leftpage,
|
||||
SplitPoint *rightpage, FindSplitStrat *strategy);
|
||||
bool *newitemonleft);
|
||||
static int _bt_strategy(FindSplitData *state, SplitPoint *leftpage,
|
||||
SplitPoint *rightpage, FindSplitStrat *strategy);
|
||||
static void _bt_interval_edges(FindSplitData *state,
|
||||
SplitPoint **leftinterval, SplitPoint **rightinterval);
|
||||
SplitPoint **leftinterval, SplitPoint **rightinterval);
|
||||
static inline int _bt_split_penalty(FindSplitData *state, SplitPoint *split);
|
||||
static inline IndexTuple _bt_split_lastleft(FindSplitData *state,
|
||||
SplitPoint *split);
|
||||
SplitPoint *split);
|
||||
static inline IndexTuple _bt_split_firstright(FindSplitData *state,
|
||||
SplitPoint *split);
|
||||
SplitPoint *split);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -37,22 +37,22 @@ typedef struct BTSortArrayContext
|
||||
} BTSortArrayContext;
|
||||
|
||||
static Datum _bt_find_extreme_element(IndexScanDesc scan, ScanKey skey,
|
||||
StrategyNumber strat,
|
||||
Datum *elems, int nelems);
|
||||
static int _bt_sort_array_elements(IndexScanDesc scan, ScanKey skey,
|
||||
bool reverse,
|
||||
Datum *elems, int nelems);
|
||||
StrategyNumber strat,
|
||||
Datum *elems, int nelems);
|
||||
static int _bt_sort_array_elements(IndexScanDesc scan, ScanKey skey,
|
||||
bool reverse,
|
||||
Datum *elems, int nelems);
|
||||
static int _bt_compare_array_elements(const void *a, const void *b, void *arg);
|
||||
static bool _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op,
|
||||
ScanKey leftarg, ScanKey rightarg,
|
||||
bool *result);
|
||||
ScanKey leftarg, ScanKey rightarg,
|
||||
bool *result);
|
||||
static bool _bt_fix_scankey_strategy(ScanKey skey, int16 *indoption);
|
||||
static void _bt_mark_scankey_required(ScanKey skey);
|
||||
static bool _bt_check_rowcompare(ScanKey skey,
|
||||
IndexTuple tuple, int tupnatts, TupleDesc tupdesc,
|
||||
ScanDirection dir, bool *continuescan);
|
||||
static int _bt_keep_natts(Relation rel, IndexTuple lastleft,
|
||||
IndexTuple firstright, BTScanInsert itup_key);
|
||||
IndexTuple tuple, int tupnatts, TupleDesc tupdesc,
|
||||
ScanDirection dir, bool *continuescan);
|
||||
static int _bt_keep_natts(Relation rel, IndexTuple lastleft,
|
||||
IndexTuple firstright, BTScanInsert itup_key);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -43,19 +43,19 @@ typedef struct
|
||||
|
||||
|
||||
static void bernoulli_samplescangetsamplesize(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
static void bernoulli_initsamplescan(SampleScanState *node,
|
||||
int eflags);
|
||||
int eflags);
|
||||
static void bernoulli_beginsamplescan(SampleScanState *node,
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
static OffsetNumber bernoulli_nextsampletuple(SampleScanState *node,
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -45,20 +45,20 @@ typedef struct
|
||||
|
||||
|
||||
static void system_samplescangetsamplesize(PlannerInfo *root,
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
RelOptInfo *baserel,
|
||||
List *paramexprs,
|
||||
BlockNumber *pages,
|
||||
double *tuples);
|
||||
static void system_initsamplescan(SampleScanState *node,
|
||||
int eflags);
|
||||
int eflags);
|
||||
static void system_beginsamplescan(SampleScanState *node,
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
Datum *params,
|
||||
int nparams,
|
||||
uint32 seed);
|
||||
static BlockNumber system_nextsampleblock(SampleScanState *node, BlockNumber nblocks);
|
||||
static OffsetNumber system_nextsampletuple(SampleScanState *node,
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
BlockNumber blockno,
|
||||
OffsetNumber maxoffset);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -92,20 +92,20 @@ static int ZeroCLOGPage(int pageno, bool writeXlog);
|
||||
static bool CLOGPagePrecedes(int page1, int page2);
|
||||
static void WriteZeroPageXlogRec(int pageno);
|
||||
static void WriteTruncateXlogRec(int pageno, TransactionId oldestXact,
|
||||
Oid oldestXidDb);
|
||||
Oid oldestXidDb);
|
||||
static void TransactionIdSetPageStatus(TransactionId xid, int nsubxids,
|
||||
TransactionId *subxids, XidStatus status,
|
||||
XLogRecPtr lsn, int pageno,
|
||||
bool all_xact_same_page);
|
||||
TransactionId *subxids, XidStatus status,
|
||||
XLogRecPtr lsn, int pageno,
|
||||
bool all_xact_same_page);
|
||||
static void TransactionIdSetStatusBit(TransactionId xid, XidStatus status,
|
||||
XLogRecPtr lsn, int slotno);
|
||||
XLogRecPtr lsn, int slotno);
|
||||
static void set_status_by_pages(int nsubxids, TransactionId *subxids,
|
||||
XidStatus status, XLogRecPtr lsn);
|
||||
XidStatus status, XLogRecPtr lsn);
|
||||
static bool TransactionGroupUpdateXidStatus(TransactionId xid,
|
||||
XidStatus status, XLogRecPtr lsn, int pageno);
|
||||
XidStatus status, XLogRecPtr lsn, int pageno);
|
||||
static void TransactionIdSetPageStatusInternal(TransactionId xid, int nsubxids,
|
||||
TransactionId *subxids, XidStatus status,
|
||||
XLogRecPtr lsn, int pageno);
|
||||
TransactionId *subxids, XidStatus status,
|
||||
XLogRecPtr lsn, int pageno);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -103,10 +103,10 @@ CommitTimestampShared *commitTsShared;
|
||||
bool track_commit_timestamp;
|
||||
|
||||
static void SetXidCommitTsInPage(TransactionId xid, int nsubxids,
|
||||
TransactionId *subxids, TimestampTz ts,
|
||||
RepOriginId nodeid, int pageno);
|
||||
TransactionId *subxids, TimestampTz ts,
|
||||
RepOriginId nodeid, int pageno);
|
||||
static void TransactionIdSetCommitTs(TransactionId xid, TimestampTz ts,
|
||||
RepOriginId nodeid, int slotno);
|
||||
RepOriginId nodeid, int slotno);
|
||||
static void error_commit_ts_disabled(void);
|
||||
static int ZeroCommitTsPage(int pageno, bool writeXlog);
|
||||
static bool CommitTsPagePrecedes(int page1, int page2);
|
||||
@ -115,8 +115,8 @@ static void DeactivateCommitTs(void);
|
||||
static void WriteZeroPageXlogRec(int pageno);
|
||||
static void WriteTruncateXlogRec(int pageno, TransactionId oldestXid);
|
||||
static void WriteSetTimestampXlogRec(TransactionId mainxid, int nsubxids,
|
||||
TransactionId *subxids, TimestampTz timestamp,
|
||||
RepOriginId nodeid);
|
||||
TransactionId *subxids, TimestampTz timestamp,
|
||||
RepOriginId nodeid);
|
||||
|
||||
/*
|
||||
* TransactionTreeSetCommitTsData
|
||||
|
@ -69,11 +69,11 @@ struct GenericXLogState
|
||||
};
|
||||
|
||||
static void writeFragment(PageData *pageData, OffsetNumber offset,
|
||||
OffsetNumber len, const char *data);
|
||||
OffsetNumber len, const char *data);
|
||||
static void computeRegionDelta(PageData *pageData,
|
||||
const char *curpage, const char *targetpage,
|
||||
int targetStart, int targetEnd,
|
||||
int validStart, int validEnd);
|
||||
const char *curpage, const char *targetpage,
|
||||
int targetStart, int targetEnd,
|
||||
int validStart, int validEnd);
|
||||
static void computeDelta(PageData *pageData, Page curpage, Page targetpage);
|
||||
static void applyPageRedo(Page page, const char *delta, Size deltaSize);
|
||||
|
||||
|
@ -340,7 +340,7 @@ static MemoryContext MXactContext = NULL;
|
||||
/* internal MultiXactId management */
|
||||
static void MultiXactIdSetOldestVisible(void);
|
||||
static void RecordNewMultiXact(MultiXactId multi, MultiXactOffset offset,
|
||||
int nmembers, MultiXactMember *members);
|
||||
int nmembers, MultiXactMember *members);
|
||||
static MultiXactId GetNewMultiXactId(int nmembers, MultiXactOffset *offset);
|
||||
|
||||
/* MultiXact cache management */
|
||||
@ -348,7 +348,7 @@ static int mxactMemberComparator(const void *arg1, const void *arg2);
|
||||
static MultiXactId mXactCacheGetBySet(int nmembers, MultiXactMember *members);
|
||||
static int mXactCacheGetById(MultiXactId multi, MultiXactMember **members);
|
||||
static void mXactCachePut(MultiXactId multi, int nmembers,
|
||||
MultiXactMember *members);
|
||||
MultiXactMember *members);
|
||||
|
||||
static char *mxstatus_to_string(MultiXactStatus status);
|
||||
|
||||
@ -358,17 +358,17 @@ static int ZeroMultiXactMemberPage(int pageno, bool writeXlog);
|
||||
static bool MultiXactOffsetPagePrecedes(int page1, int page2);
|
||||
static bool MultiXactMemberPagePrecedes(int page1, int page2);
|
||||
static bool MultiXactOffsetPrecedes(MultiXactOffset offset1,
|
||||
MultiXactOffset offset2);
|
||||
MultiXactOffset offset2);
|
||||
static void ExtendMultiXactOffset(MultiXactId multi);
|
||||
static void ExtendMultiXactMember(MultiXactOffset offset, int nmembers);
|
||||
static bool MultiXactOffsetWouldWrap(MultiXactOffset boundary,
|
||||
MultiXactOffset start, uint32 distance);
|
||||
MultiXactOffset start, uint32 distance);
|
||||
static bool SetOffsetVacuumLimit(bool is_startup);
|
||||
static bool find_multixact_start(MultiXactId multi, MultiXactOffset *result);
|
||||
static void WriteMZeroPageXlogRec(int pageno, uint8 info);
|
||||
static void WriteMTruncateXlogRec(Oid oldestMultiDB,
|
||||
MultiXactId startOff, MultiXactId endOff,
|
||||
MultiXactOffset startMemb, MultiXactOffset endMemb);
|
||||
MultiXactId startOff, MultiXactId endOff,
|
||||
MultiXactOffset startMemb, MultiXactOffset endMemb);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -129,12 +129,12 @@ static void SimpleLruWaitIO(SlruCtl ctl, int slotno);
|
||||
static void SlruInternalWritePage(SlruCtl ctl, int slotno, SlruFlush fdata);
|
||||
static bool SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno);
|
||||
static bool SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno,
|
||||
SlruFlush fdata);
|
||||
SlruFlush fdata);
|
||||
static void SlruReportIOError(SlruCtl ctl, int pageno, TransactionId xid);
|
||||
static int SlruSelectLRUPage(SlruCtl ctl, int pageno);
|
||||
|
||||
static bool SlruScanDirCbDeleteCutoff(SlruCtl ctl, char *filename,
|
||||
int segpage, void *data);
|
||||
int segpage, void *data);
|
||||
static void SlruInternalDeleteSegment(SlruCtl ctl, char *filename);
|
||||
|
||||
/*
|
||||
|
@ -202,31 +202,31 @@ static GlobalTransaction MyLockedGxact = NULL;
|
||||
static bool twophaseExitRegistered = false;
|
||||
|
||||
static void RecordTransactionCommitPrepared(TransactionId xid,
|
||||
int nchildren,
|
||||
TransactionId *children,
|
||||
int nrels,
|
||||
RelFileNode *rels,
|
||||
int ninvalmsgs,
|
||||
SharedInvalidationMessage *invalmsgs,
|
||||
bool initfileinval,
|
||||
const char *gid);
|
||||
int nchildren,
|
||||
TransactionId *children,
|
||||
int nrels,
|
||||
RelFileNode *rels,
|
||||
int ninvalmsgs,
|
||||
SharedInvalidationMessage *invalmsgs,
|
||||
bool initfileinval,
|
||||
const char *gid);
|
||||
static void RecordTransactionAbortPrepared(TransactionId xid,
|
||||
int nchildren,
|
||||
TransactionId *children,
|
||||
int nrels,
|
||||
RelFileNode *rels,
|
||||
const char *gid);
|
||||
int nchildren,
|
||||
TransactionId *children,
|
||||
int nrels,
|
||||
RelFileNode *rels,
|
||||
const char *gid);
|
||||
static void ProcessRecords(char *bufptr, TransactionId xid,
|
||||
const TwoPhaseCallback callbacks[]);
|
||||
const TwoPhaseCallback callbacks[]);
|
||||
static void RemoveGXact(GlobalTransaction gxact);
|
||||
|
||||
static void XlogReadTwoPhaseData(XLogRecPtr lsn, char **buf, int *len);
|
||||
static char *ProcessTwoPhaseBuffer(TransactionId xid,
|
||||
XLogRecPtr prepare_start_lsn,
|
||||
bool fromdisk, bool setParent, bool setNextXid);
|
||||
XLogRecPtr prepare_start_lsn,
|
||||
bool fromdisk, bool setParent, bool setNextXid);
|
||||
static void MarkAsPreparingGuts(GlobalTransaction gxact, TransactionId xid,
|
||||
const char *gid, TimestampTz prepared_at, Oid owner,
|
||||
Oid databaseid);
|
||||
const char *gid, TimestampTz prepared_at, Oid owner,
|
||||
Oid databaseid);
|
||||
static void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning);
|
||||
static void RecreateTwoPhaseFile(TransactionId xid, void *content, int len);
|
||||
|
||||
|
@ -312,11 +312,11 @@ static void AtStart_Memory(void);
|
||||
static void AtStart_ResourceOwner(void);
|
||||
static void CallXactCallbacks(XactEvent event);
|
||||
static void CallSubXactCallbacks(SubXactEvent event,
|
||||
SubTransactionId mySubid,
|
||||
SubTransactionId parentSubid);
|
||||
SubTransactionId mySubid,
|
||||
SubTransactionId parentSubid);
|
||||
static void CleanupTransaction(void);
|
||||
static void CheckTransactionBlock(bool isTopLevel, bool throwError,
|
||||
const char *stmtType);
|
||||
const char *stmtType);
|
||||
static void CommitTransaction(void);
|
||||
static TransactionId RecordTransactionAbort(bool isSubXact);
|
||||
static void StartTransaction(void);
|
||||
|
@ -869,7 +869,7 @@ static void SetCurrentChunkStartTime(TimestampTz xtime);
|
||||
static void CheckRequiredParameterValues(void);
|
||||
static void XLogReportParameters(void);
|
||||
static void checkTimeLineSwitch(XLogRecPtr lsn, TimeLineID newTLI,
|
||||
TimeLineID prevTLI);
|
||||
TimeLineID prevTLI);
|
||||
static void LocalSetXLogInsertAllowed(void);
|
||||
static void CreateEndOfRecoveryRecord(void);
|
||||
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
|
||||
@ -880,16 +880,16 @@ static void AdvanceXLInsertBuffer(XLogRecPtr upto, bool opportunistic);
|
||||
static bool XLogCheckpointNeeded(XLogSegNo new_segno);
|
||||
static void XLogWrite(XLogwrtRqst WriteRqst, bool flexible);
|
||||
static bool InstallXLogFileSegment(XLogSegNo *segno, char *tmppath,
|
||||
bool find_free, XLogSegNo max_segno,
|
||||
bool use_lock);
|
||||
static int XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
|
||||
int source, bool notfoundOk);
|
||||
bool find_free, XLogSegNo max_segno,
|
||||
bool use_lock);
|
||||
static int XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
|
||||
int source, bool notfoundOk);
|
||||
static int XLogFileReadAnyTLI(XLogSegNo segno, int emode, int source);
|
||||
static int XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
|
||||
int reqLen, XLogRecPtr targetRecPtr, char *readBuf,
|
||||
TimeLineID *readTLI);
|
||||
static int XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
|
||||
int reqLen, XLogRecPtr targetRecPtr, char *readBuf,
|
||||
TimeLineID *readTLI);
|
||||
static bool WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
|
||||
bool fetching_ckpt, XLogRecPtr tliRecPtr);
|
||||
bool fetching_ckpt, XLogRecPtr tliRecPtr);
|
||||
static int emode_for_corrupt_record(int emode, XLogRecPtr RecPtr);
|
||||
static void XLogFileClose(void);
|
||||
static void PreallocXlogFiles(XLogRecPtr endptr);
|
||||
@ -901,10 +901,10 @@ static void ValidateXLOGDirectoryStructure(void);
|
||||
static void CleanupBackupHistory(void);
|
||||
static void UpdateMinRecoveryPoint(XLogRecPtr lsn, bool force);
|
||||
static XLogRecord *ReadRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr,
|
||||
int emode, bool fetching_ckpt);
|
||||
int emode, bool fetching_ckpt);
|
||||
static void CheckRecoveryConsistency(void);
|
||||
static XLogRecord *ReadCheckpointRecord(XLogReaderState *xlogreader,
|
||||
XLogRecPtr RecPtr, int whichChkpti, bool report);
|
||||
XLogRecPtr RecPtr, int whichChkpti, bool report);
|
||||
static bool rescanLatestTimeLine(void);
|
||||
static void WriteControlFile(void);
|
||||
static void ReadControlFile(void);
|
||||
@ -918,19 +918,19 @@ static void xlog_outdesc(StringInfo buf, XLogReaderState *record);
|
||||
static void pg_start_backup_callback(int code, Datum arg);
|
||||
static void pg_stop_backup_callback(int code, Datum arg);
|
||||
static bool read_backup_label(XLogRecPtr *checkPointLoc,
|
||||
bool *backupEndRequired, bool *backupFromStandby);
|
||||
bool *backupEndRequired, bool *backupFromStandby);
|
||||
static bool read_tablespace_map(List **tablespaces);
|
||||
|
||||
static void rm_redo_error_callback(void *arg);
|
||||
static int get_sync_bit(int method);
|
||||
|
||||
static void CopyXLogRecordToWAL(int write_len, bool isLogSwitch,
|
||||
XLogRecData *rdata,
|
||||
XLogRecPtr StartPos, XLogRecPtr EndPos);
|
||||
XLogRecData *rdata,
|
||||
XLogRecPtr StartPos, XLogRecPtr EndPos);
|
||||
static void ReserveXLogInsertLocation(int size, XLogRecPtr *StartPos,
|
||||
XLogRecPtr *EndPos, XLogRecPtr *PrevPtr);
|
||||
XLogRecPtr *EndPos, XLogRecPtr *PrevPtr);
|
||||
static bool ReserveXLogSwitch(XLogRecPtr *StartPos, XLogRecPtr *EndPos,
|
||||
XLogRecPtr *PrevPtr);
|
||||
XLogRecPtr *PrevPtr);
|
||||
static XLogRecPtr WaitXLogInsertionsToFinish(XLogRecPtr upto);
|
||||
static char *GetXLogBuffer(XLogRecPtr ptr);
|
||||
static XLogRecPtr XLogBytePosToRecPtr(uint64 bytepos);
|
||||
|
@ -107,10 +107,10 @@ static bool begininsert_called = false;
|
||||
static MemoryContext xloginsert_cxt;
|
||||
|
||||
static XLogRecData *XLogRecordAssemble(RmgrId rmid, uint8 info,
|
||||
XLogRecPtr RedoRecPtr, bool doPageWrites,
|
||||
XLogRecPtr *fpw_lsn);
|
||||
XLogRecPtr RedoRecPtr, bool doPageWrites,
|
||||
XLogRecPtr *fpw_lsn);
|
||||
static bool XLogCompressBackupBlock(char *page, uint16 hole_offset,
|
||||
uint16 hole_length, char *dest, uint16 *dlen);
|
||||
uint16 hole_length, char *dest, uint16 *dlen);
|
||||
|
||||
/*
|
||||
* Begin constructing a WAL record. This must be called before the
|
||||
|
@ -32,11 +32,11 @@
|
||||
static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
|
||||
|
||||
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
|
||||
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
|
||||
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
|
||||
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
|
||||
XLogRecPtr recptr);
|
||||
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
|
||||
int reqLen);
|
||||
XLogRecPtr recptr);
|
||||
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
|
||||
int reqLen);
|
||||
static void report_invalid_record(XLogReaderState *state, const char *fmt,...) pg_attribute_printf(2, 3);
|
||||
|
||||
static void ResetDecoder(XLogReaderState *state);
|
||||
|
Reference in New Issue
Block a user