103 elog(
ERROR,
"failed to add item to index page in %u/%u/%u",
144 if (nuncompressed > 0)
152 Assert(npacked == nuncompressed);
172 for (actionno = 0; actionno <
data->nactions; actionno++)
205 while (segno < a_segno)
215 memcpy(writePtr, (
Pointer) oldseg, segsize);
240 Assert(npacked == nnewitems);
247 if (segptr != segmentend)
263 if (!tailCopy && segptr != segmentend)
265 int tailSize = segmentend - segptr;
268 memcpy(tailCopy, segptr, tailSize);
271 segmentend = segptr + tailSize;
284 memcpy(writePtr, newseg, newsegsize);
285 writePtr += newsegsize;
291 memcpy(writePtr, newseg, newsegsize);
292 writePtr += newsegsize;
298 elog(
ERROR,
"unexpected GIN leaf action: %u", a_action);
305 if (segptr != segmentend && tailCopy)
307 int restSize = segmentend - segptr;
310 memcpy(writePtr, segptr, restSize);
311 writePtr += restSize;
419 elog(
ERROR,
"GIN split record did not contain a full-page image of left page");
422 elog(
ERROR,
"GIN split record did not contain a full-page image of right page");
427 elog(
ERROR,
"GIN split record did not contain a full-page image of root page");
446 elog(
ERROR,
"replay of gin entry tree page vacuum did not restore the page");
550 if (
data->ntuples > 0)
573 for (
i = 0;
i <
data->ntuples;
i++)
579 elog(
ERROR,
"failed to add item to index page");
581 tuples = (
IndexTuple) (((
char *) tuples) + tupsize);
585 Assert(payload + totaltupsize == (
char *) tuples);
654 for (
i = 0;
i <
data->ntuples;
i++)
661 elog(
ERROR,
"failed to add item to index page");
663 tuples = (
IndexTuple) (((
char *) tuples) + tupsize);
666 Assert((
char *) tuples == payload + totaltupsize);
708 for (
i = 0;
i <
data->ndeleted;
i++)
768 elog(
PANIC,
"gin_redo: unknown op code %u", info);
778 "GIN recovery temporary context",
struct BlockIdData BlockIdData
#define InvalidBlockNumber
static BlockNumber BlockIdGetBlockNumber(const BlockIdData *blockId)
void mask_page_content(Page page)
void mask_page_lsn_and_checksum(Page page)
void mask_unused_space(Page page)
void mask_page_hint_bits(Page page)
BlockNumber BufferGetBlockNumber(Buffer buffer)
void BufferGetTag(Buffer buffer, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *blknum)
void UnlockReleaseBuffer(Buffer buffer)
void MarkBufferDirty(Buffer buffer)
static Page BufferGetPage(Buffer buffer)
static bool BufferIsValid(Buffer bufnum)
void PageIndexTupleDelete(Page page, OffsetNumber offnum)
PageHeaderData * PageHeader
static bool PageIsEmpty(Page page)
static Item PageGetItem(Page page, ItemId itemId)
#define SizeOfPageHeaderData
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
static void PageSetLSN(Page page, XLogRecPtr lsn)
static char * PageGetSpecialPointer(Page page)
static OffsetNumber PageGetMaxOffsetNumber(Page page)
#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap)
#define Assert(condition)
#define GIN_METAPAGE_BLKNO
#define GinPageGetOpaque(page)
#define SizeOfGinPostingList(plist)
#define GinPageSetDeleteXid(page, xid)
#define GinDataLeafPageGetPostingListSize(page)
#define GinSetDownlink(itup, blkno)
#define GinDataPageSetDataSize(page, size)
#define GinPageSetCompressed(page)
#define GinNextPostingListSegment(cur)
#define GinPageIsData(page)
#define GIN_INCOMPLETE_SPLIT
#define GinPageGetMeta(p)
#define GinDataPageGetPostingItem(page, i)
#define GinDataPageGetData(page)
#define PostingItemSetBlockNumber(pointer, blockNumber)
#define GinPageIsCompressed(page)
#define GinPageSetDeleted(page)
#define GinPageIsLeaf(page)
#define GinPageSetFullRow(page)
#define GinDataLeafPageGetPostingList(page)
void GinPageDeletePostingItem(Page page, OffsetNumber offset)
void GinDataPageAddPostingItem(Page page, PostingItem *data, OffsetNumber offset)
GinPostingList * ginCompressPostingList(const ItemPointer ipd, int nipd, int maxsize, int *nwritten)
ItemPointer ginPostingListDecode(GinPostingList *plist, int *ndecoded_out)
ItemPointer ginMergeItemPointers(ItemPointerData *a, uint32 na, ItemPointerData *b, uint32 nb, int *nmerged)
void GinInitBuffer(Buffer b, uint32 f)
void GinInitMetabuffer(Buffer b)
static void ginRedoInsertEntry(Buffer buffer, bool isLeaf, BlockNumber rightblkno, void *rdata)
static void ginRedoInsert(XLogReaderState *record)
static void ginRedoSplit(XLogReaderState *record)
void gin_redo(XLogReaderState *record)
void gin_mask(char *pagedata, BlockNumber blkno)
static void ginRedoClearIncompleteSplit(XLogReaderState *record, uint8 block_id)
void gin_xlog_startup(void)
static void ginRedoDeletePage(XLogReaderState *record)
static void ginRedoVacuumDataLeafPage(XLogReaderState *record)
static void ginRedoDeleteListPages(XLogReaderState *record)
static void ginRedoUpdateMetapage(XLogReaderState *record)
static void ginRedoInsertData(Buffer buffer, bool isLeaf, BlockNumber rightblkno, void *rdata)
void gin_xlog_cleanup(void)
static void ginRedoInsertListPage(XLogReaderState *record)
static MemoryContext opCtx
static void ginRedoCreatePTree(XLogReaderState *record)
static void ginRedoRecompress(Page page, ginxlogRecompressDataLeaf *data)
static void ginRedoVacuumPage(XLogReaderState *record)
#define GIN_INSERT_ISDATA
#define GIN_INSERT_ISLEAF
#define XLOG_GIN_UPDATE_META_PAGE
#define GIN_SEGMENT_ADDITEMS
#define GIN_SEGMENT_DELETE
#define XLOG_GIN_CREATE_PTREE
#define XLOG_GIN_VACUUM_PAGE
#define XLOG_GIN_DELETE_PAGE
#define XLOG_GIN_INSERT_LISTPAGE
#define XLOG_GIN_VACUUM_DATA_LEAF_PAGE
struct ginxlogCreatePostingTree ginxlogCreatePostingTree
#define GIN_SEGMENT_INSERT
#define XLOG_GIN_DELETE_LISTPAGE
#define GIN_SEGMENT_REPLACE
ItemPointerData * ItemPointer
struct ItemPointerData ItemPointerData
IndexTupleData * IndexTuple
#define IndexTupleSize(itup)
void MemoryContextReset(MemoryContext context)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define InvalidOffsetNumber
#define OffsetNumberNext(offsetNumber)
#define FirstOffsetNumber
MemoryContextSwitchTo(old_ctx)
ginxlogRecompressDataLeaf data
char * XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len)
#define XLogRecGetInfo(decoder)
#define XLogRecGetData(decoder)
XLogRedoAction XLogReadBufferForRedo(XLogReaderState *record, uint8 block_id, Buffer *buf)
Buffer XLogInitBufferForRedo(XLogReaderState *record, uint8 block_id)