PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
xloginsert.h File Reference
#include "access/rmgr.h"
#include "access/xlogdefs.h"
#include "storage/block.h"
#include "storage/buf.h"
#include "storage/relfilelocator.h"
#include "utils/relcache.h"
Include dependency graph for xloginsert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XLR_NORMAL_MAX_BLOCK_ID   4
 
#define XLR_NORMAL_RDATAS   20
 
#define REGBUF_FORCE_IMAGE   0x01 /* force a full-page image */
 
#define REGBUF_NO_IMAGE   0x02 /* don't take a full-page image */
 
#define REGBUF_WILL_INIT
 
#define REGBUF_STANDARD
 
#define REGBUF_KEEP_DATA
 
#define REGBUF_NO_CHANGE   0x20 /* intentionally register clean buffer */
 

Functions

void XLogBeginInsert (void)
 
void XLogSetRecordFlags (uint8 flags)
 
XLogRecPtr XLogInsert (RmgrId rmid, uint8 info)
 
void XLogEnsureRecordSpace (int max_block_id, int ndatas)
 
void XLogRegisterData (const char *data, uint32 len)
 
void XLogRegisterBuffer (uint8 block_id, Buffer buffer, uint8 flags)
 
void XLogRegisterBlock (uint8 block_id, RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blknum, const char *page, uint8 flags)
 
void XLogRegisterBufData (uint8 block_id, const char *data, uint32 len)
 
void XLogResetInsertion (void)
 
bool XLogCheckBufferNeedsBackup (Buffer buffer)
 
XLogRecPtr log_newpage (RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blkno, char *page, bool page_std)
 
void log_newpages (RelFileLocator *rlocator, ForkNumber forknum, int num_pages, BlockNumber *blknos, char **pages, bool page_std)
 
XLogRecPtr log_newpage_buffer (Buffer buffer, bool page_std)
 
void log_newpage_range (Relation rel, ForkNumber forknum, BlockNumber startblk, BlockNumber endblk, bool page_std)
 
XLogRecPtr XLogSaveBufferForHint (Buffer buffer, bool buffer_std)
 
void InitXLogInsert (void)
 

Macro Definition Documentation

◆ REGBUF_FORCE_IMAGE

#define REGBUF_FORCE_IMAGE   0x01 /* force a full-page image */

Definition at line 31 of file xloginsert.h.

◆ REGBUF_KEEP_DATA

#define REGBUF_KEEP_DATA
Value:
0x10 /* include data even if a full-page image
* is taken */

Definition at line 35 of file xloginsert.h.

◆ REGBUF_NO_CHANGE

#define REGBUF_NO_CHANGE   0x20 /* intentionally register clean buffer */

Definition at line 36 of file xloginsert.h.

◆ REGBUF_NO_IMAGE

#define REGBUF_NO_IMAGE   0x02 /* don't take a full-page image */

Definition at line 32 of file xloginsert.h.

◆ REGBUF_STANDARD

#define REGBUF_STANDARD
Value:
0x08 /* page follows "standard" page layout,
* (data between pd_lower and pd_upper
* will be skipped) */

Definition at line 34 of file xloginsert.h.

◆ REGBUF_WILL_INIT

#define REGBUF_WILL_INIT
Value:
(0x04 | 0x02) /* page will be re-initialized at
* replay (implies NO_IMAGE) */

Definition at line 33 of file xloginsert.h.

◆ XLR_NORMAL_MAX_BLOCK_ID

#define XLR_NORMAL_MAX_BLOCK_ID   4

Definition at line 27 of file xloginsert.h.

◆ XLR_NORMAL_RDATAS

#define XLR_NORMAL_RDATAS   20

Definition at line 28 of file xloginsert.h.

Function Documentation

◆ InitXLogInsert()

void InitXLogInsert ( void  )

Definition at line 1348 of file xloginsert.c.

1349 {
1350 #ifdef USE_ASSERT_CHECKING
1351 
1352  /*
1353  * Check that any records assembled can be decoded. This is capped based
1354  * on what XLogReader would require at its maximum bound. The XLOG_BLCKSZ
1355  * addend covers the larger allocate_recordbuf() demand. This code path
1356  * is called once per backend, more than enough for this check.
1357  */
1358  size_t max_required =
1360 
1361  Assert(AllocSizeIsValid(max_required));
1362 #endif
1363 
1364  /* Initialize the working areas */
1365  if (xloginsert_cxt == NULL)
1366  {
1368  "WAL record construction",
1370  }
1371 
1372  if (registered_buffers == NULL)
1373  {
1376  sizeof(registered_buffer) * (XLR_NORMAL_MAX_BLOCK_ID + 1));
1378  }
1379  if (rdatas == NULL)
1380  {
1382  sizeof(XLogRecData) * XLR_NORMAL_RDATAS);
1384  }
1385 
1386  /*
1387  * Allocate a buffer to hold the header information for a WAL record.
1388  */
1389  if (hdr_scratch == NULL)
1392 }
#define Assert(condition)
Definition: c.h:837
MemoryContext TopMemoryContext
Definition: mcxt.c:149
void * MemoryContextAllocZero(MemoryContext context, Size size)
Definition: mcxt.c:1215
void * MemoryContextAlloc(MemoryContext context, Size size)
Definition: mcxt.c:1181
#define AllocSetContextCreate
Definition: memutils.h:129
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:160
#define AllocSizeIsValid(size)
Definition: memutils.h:42
static int max_registered_buffers
Definition: xloginsert.c:90
static MemoryContext xloginsert_cxt
Definition: xloginsert.c:135
static char * hdr_scratch
Definition: xloginsert.c:114
static XLogRecData * rdatas
Definition: xloginsert.c:128
static registered_buffer * registered_buffers
Definition: xloginsert.c:89
static int max_rdatas
Definition: xloginsert.c:130
#define HEADER_SCRATCH_SIZE
Definition: xloginsert.c:119
#define XLR_NORMAL_MAX_BLOCK_ID
Definition: xloginsert.h:27
#define XLR_NORMAL_RDATAS
Definition: xloginsert.h:28
size_t DecodeXLogRecordRequiredSpace(size_t xl_tot_len)
Definition: xlogreader.c:1629
#define XLogRecordMaxSize
Definition: xlogrecord.h:74

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AllocSizeIsValid, Assert, DecodeXLogRecordRequiredSpace(), hdr_scratch, HEADER_SCRATCH_SIZE, max_rdatas, max_registered_buffers, MemoryContextAlloc(), MemoryContextAllocZero(), rdatas, registered_buffers, TopMemoryContext, xloginsert_cxt, XLogRecordMaxSize, XLR_NORMAL_MAX_BLOCK_ID, and XLR_NORMAL_RDATAS.

Referenced by BaseInit().

◆ log_newpage()

XLogRecPtr log_newpage ( RelFileLocator rlocator,
ForkNumber  forknum,
BlockNumber  blkno,
char *  page,
bool  page_std 
)

Definition at line 1143 of file xloginsert.c.

1145 {
1146  int flags;
1147  XLogRecPtr recptr;
1148 
1149  flags = REGBUF_FORCE_IMAGE;
1150  if (page_std)
1151  flags |= REGBUF_STANDARD;
1152 
1153  XLogBeginInsert();
1154  XLogRegisterBlock(0, rlocator, forknum, blkno, page, flags);
1155  recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI);
1156 
1157  /*
1158  * The page may be uninitialized. If so, we can't set the LSN because that
1159  * would corrupt the page.
1160  */
1161  if (!PageIsNew(page))
1162  {
1163  PageSetLSN(page, recptr);
1164  }
1165 
1166  return recptr;
1167 }
static bool PageIsNew(Page page)
Definition: bufpage.h:233
static void PageSetLSN(Page page, XLogRecPtr lsn)
Definition: bufpage.h:391
#define XLOG_FPI
Definition: pg_control.h:79
uint64 XLogRecPtr
Definition: xlogdefs.h:21
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
Definition: xloginsert.c:474
void XLogRegisterBlock(uint8 block_id, RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blknum, const char *page, uint8 flags)
Definition: xloginsert.c:309
void XLogBeginInsert(void)
Definition: xloginsert.c:149
#define REGBUF_STANDARD
Definition: xloginsert.h:34
#define REGBUF_FORCE_IMAGE
Definition: xloginsert.h:31

References PageIsNew(), PageSetLSN(), REGBUF_FORCE_IMAGE, REGBUF_STANDARD, XLOG_FPI, XLogBeginInsert(), XLogInsert(), and XLogRegisterBlock().

Referenced by _hash_alloc_buckets(), _hash_init(), and log_newpage_buffer().

◆ log_newpage_buffer()

XLogRecPtr log_newpage_buffer ( Buffer  buffer,
bool  page_std 
)

Definition at line 1237 of file xloginsert.c.

1238 {
1239  Page page = BufferGetPage(buffer);
1240  RelFileLocator rlocator;
1241  ForkNumber forknum;
1242  BlockNumber blkno;
1243 
1244  /* Shared buffers should be modified in a critical section. */
1245  Assert(CritSectionCount > 0);
1246 
1247  BufferGetTag(buffer, &rlocator, &forknum, &blkno);
1248 
1249  return log_newpage(&rlocator, forknum, blkno, page, page_std);
1250 }
uint32 BlockNumber
Definition: block.h:31
void BufferGetTag(Buffer buffer, RelFileLocator *rlocator, ForkNumber *forknum, BlockNumber *blknum)
Definition: bufmgr.c:3745
static Page BufferGetPage(Buffer buffer)
Definition: bufmgr.h:400
Pointer Page
Definition: bufpage.h:81
volatile uint32 CritSectionCount
Definition: globals.c:44
ForkNumber
Definition: relpath.h:56
XLogRecPtr log_newpage(RelFileLocator *rlocator, ForkNumber forknum, BlockNumber blkno, Page page, bool page_std)
Definition: xloginsert.c:1143

References Assert, BufferGetPage(), BufferGetTag(), CritSectionCount, and log_newpage().

Referenced by brin_initialize_empty_new_buffer(), brinbuildempty(), FreeSpaceMapPrepareTruncateRel(), ginbuildempty(), gistbuildempty(), heap_force_common(), lazy_scan_new_or_empty(), RelationCopyStorageUsingBuffer(), and visibilitymap_prepare_truncate().

◆ log_newpage_range()

void log_newpage_range ( Relation  rel,
ForkNumber  forknum,
BlockNumber  startblk,
BlockNumber  endblk,
bool  page_std 
)

Definition at line 1270 of file xloginsert.c.

1273 {
1274  int flags;
1275  BlockNumber blkno;
1276 
1277  flags = REGBUF_FORCE_IMAGE;
1278  if (page_std)
1279  flags |= REGBUF_STANDARD;
1280 
1281  /*
1282  * Iterate over all the pages in the range. They are collected into
1283  * batches of XLR_MAX_BLOCK_ID pages, and a single WAL-record is written
1284  * for each batch.
1285  */
1287 
1288  blkno = startblk;
1289  while (blkno < endblk)
1290  {
1291  Buffer bufpack[XLR_MAX_BLOCK_ID];
1292  XLogRecPtr recptr;
1293  int nbufs;
1294  int i;
1295 
1297 
1298  /* Collect a batch of blocks. */
1299  nbufs = 0;
1300  while (nbufs < XLR_MAX_BLOCK_ID && blkno < endblk)
1301  {
1302  Buffer buf = ReadBufferExtended(rel, forknum, blkno,
1303  RBM_NORMAL, NULL);
1304 
1306 
1307  /*
1308  * Completely empty pages are not WAL-logged. Writing a WAL record
1309  * would change the LSN, and we don't want that. We want the page
1310  * to stay empty.
1311  */
1312  if (!PageIsNew(BufferGetPage(buf)))
1313  bufpack[nbufs++] = buf;
1314  else
1316  blkno++;
1317  }
1318 
1319  /* Nothing more to do if all remaining blocks were empty. */
1320  if (nbufs == 0)
1321  break;
1322 
1323  /* Write WAL record for this batch. */
1324  XLogBeginInsert();
1325 
1327  for (i = 0; i < nbufs; i++)
1328  {
1329  MarkBufferDirty(bufpack[i]);
1330  XLogRegisterBuffer(i, bufpack[i], flags);
1331  }
1332 
1333  recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI);
1334 
1335  for (i = 0; i < nbufs; i++)
1336  {
1337  PageSetLSN(BufferGetPage(bufpack[i]), recptr);
1338  UnlockReleaseBuffer(bufpack[i]);
1339  }
1340  END_CRIT_SECTION();
1341  }
1342 }
int Buffer
Definition: buf.h:23
void UnlockReleaseBuffer(Buffer buffer)
Definition: bufmgr.c:4941
void MarkBufferDirty(Buffer buffer)
Definition: bufmgr.c:2532
void LockBuffer(Buffer buffer, int mode)
Definition: bufmgr.c:5158
Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy)
Definition: bufmgr.c:793
#define BUFFER_LOCK_EXCLUSIVE
Definition: bufmgr.h:191
@ RBM_NORMAL
Definition: bufmgr.h:45
int i
Definition: isn.c:72
#define START_CRIT_SECTION()
Definition: miscadmin.h:149
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:122
#define END_CRIT_SECTION()
Definition: miscadmin.h:151
static char * buf
Definition: pg_test_fsync.c:72
void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
Definition: xloginsert.c:242
void XLogEnsureRecordSpace(int max_block_id, int ndatas)
Definition: xloginsert.c:175
#define XLR_MAX_BLOCK_ID
Definition: xlogrecord.h:239

References buf, BUFFER_LOCK_EXCLUSIVE, BufferGetPage(), CHECK_FOR_INTERRUPTS, END_CRIT_SECTION, i, LockBuffer(), MarkBufferDirty(), PageIsNew(), PageSetLSN(), RBM_NORMAL, ReadBufferExtended(), REGBUF_FORCE_IMAGE, REGBUF_STANDARD, START_CRIT_SECTION, UnlockReleaseBuffer(), XLOG_FPI, XLogBeginInsert(), XLogEnsureRecordSpace(), XLogInsert(), XLogRegisterBuffer(), and XLR_MAX_BLOCK_ID.

Referenced by ginbuild(), gistbuild(), smgrDoPendingSyncs(), and spgbuild().

◆ log_newpages()

void log_newpages ( RelFileLocator rlocator,
ForkNumber  forknum,
int  num_pages,
BlockNumber blknos,
char **  pages,
bool  page_std 
)

Definition at line 1175 of file xloginsert.c.

1177 {
1178  int flags;
1179  XLogRecPtr recptr;
1180  int i;
1181  int j;
1182 
1183  flags = REGBUF_FORCE_IMAGE;
1184  if (page_std)
1185  flags |= REGBUF_STANDARD;
1186 
1187  /*
1188  * Iterate over all the pages. They are collected into batches of
1189  * XLR_MAX_BLOCK_ID pages, and a single WAL-record is written for each
1190  * batch.
1191  */
1193 
1194  i = 0;
1195  while (i < num_pages)
1196  {
1197  int batch_start = i;
1198  int nbatch;
1199 
1200  XLogBeginInsert();
1201 
1202  nbatch = 0;
1203  while (nbatch < XLR_MAX_BLOCK_ID && i < num_pages)
1204  {
1205  XLogRegisterBlock(nbatch, rlocator, forknum, blknos[i], pages[i], flags);
1206  i++;
1207  nbatch++;
1208  }
1209 
1210  recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI);
1211 
1212  for (j = batch_start; j < i; j++)
1213  {
1214  /*
1215  * The page may be uninitialized. If so, we can't set the LSN
1216  * because that would corrupt the page.
1217  */
1218  if (!PageIsNew(pages[j]))
1219  {
1220  PageSetLSN(pages[j], recptr);
1221  }
1222  }
1223  }
1224 }
int j
Definition: isn.c:73

References i, j, PageIsNew(), PageSetLSN(), REGBUF_FORCE_IMAGE, REGBUF_STANDARD, XLOG_FPI, XLogBeginInsert(), XLogEnsureRecordSpace(), XLogInsert(), XLogRegisterBlock(), and XLR_MAX_BLOCK_ID.

Referenced by smgr_bulk_flush().

◆ XLogBeginInsert()

void XLogBeginInsert ( void  )

Definition at line 149 of file xloginsert.c.

150 {
153  Assert(mainrdata_len == 0);
154 
155  /* cross-check on whether we should be here or not */
156  if (!XLogInsertAllowed())
157  elog(ERROR, "cannot make new WAL entries during recovery");
158 
159  if (begininsert_called)
160  elog(ERROR, "XLogBeginInsert was already called");
161 
162  begininsert_called = true;
163 }
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:225
bool XLogInsertAllowed(void)
Definition: xlog.c:6389
static XLogRecData * mainrdata_head
Definition: xloginsert.c:98
static uint64 mainrdata_len
Definition: xloginsert.c:100
static bool begininsert_called
Definition: xloginsert.c:132
static int max_registered_block_id
Definition: xloginsert.c:91
static XLogRecData * mainrdata_last
Definition: xloginsert.c:99

References Assert, begininsert_called, elog, ERROR, mainrdata_head, mainrdata_last, mainrdata_len, max_registered_block_id, and XLogInsertAllowed().

Referenced by _bt_allocbuf(), _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_getroot(), _bt_insertonpg(), _bt_mark_page_halfdead(), _bt_newlevel(), _bt_set_cleanup_info(), _bt_split(), _bt_unlink_halfdead_page(), _hash_addovflpage(), _hash_doinsert(), _hash_expandtable(), _hash_freeovflpage(), _hash_init(), _hash_splitbucket(), _hash_squeezebucket(), _hash_vacuum_one_page(), addLeafTuple(), AssignTransactionId(), brin_doinsert(), brin_doupdate(), brinbuild(), brinRevmapDesummarizeRange(), CreateCheckPoint(), CreateDatabaseUsingFileCopy(), CreateDirAndVersionFile(), CreateEndOfRecoveryRecord(), CreateOverwriteContrecordRecord(), createPostingTree(), CreateTableSpace(), do_pg_backup_stop(), do_setval(), doPickSplit(), DropTableSpace(), EndPrepare(), ExecuteTruncateGuts(), fill_seq_fork_with_data(), GenericXLogFinish(), ginDeletePage(), ginHeapTupleFastInsert(), ginPlaceToPage(), ginUpdateStats(), ginVacuumPostingTreeLeaf(), gistXLogAssignLSN(), gistXLogDelete(), gistXLogPageDelete(), gistXLogPageReuse(), gistXLogSplit(), gistXLogUpdate(), hashbucketcleanup(), hashbulkdelete(), heap_abort_speculative(), heap_delete(), heap_finish_speculative(), heap_inplace_update_and_unlock(), heap_insert(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_multi_insert(), heap_update(), log_heap_new_cid(), log_heap_prune_and_freeze(), log_heap_update(), log_heap_visible(), log_newpage(), log_newpage_range(), log_newpages(), log_smgrcreate(), log_split_page(), LogAccessExclusiveLocks(), LogCurrentRunningXacts(), logical_heap_rewrite_flush_mappings(), LogLogicalInvalidations(), LogLogicalMessage(), LogStandbyInvalidations(), movedb(), moveLeafs(), MultiXactIdCreateFromMembers(), nextval_internal(), pg_truncate_visibility_map(), RelationTruncate(), remove_dbtablespaces(), replorigin_advance(), replorigin_state_clear(), RequestXLogSwitch(), revmap_physical_extend(), shiftList(), spgAddNodeAction(), spgSplitNodeAction(), test_custom_rmgrs_insert_wal_record(), UpdateFullPageWrites(), vacuumLeafPage(), vacuumLeafRoot(), vacuumRedirectAndPlaceholder(), write_relmap_file(), writeListPage(), WriteMTruncateXlogRec(), WriteMZeroPageXlogRec(), WriteTruncateXlogRec(), WriteZeroPageXlogRec(), XactLogAbortRecord(), XactLogCommitRecord(), XLogPutNextOid(), XLogReportParameters(), XLogRestorePoint(), XLogSaveBufferForHint(), and xlogVacuumPage().

◆ XLogCheckBufferNeedsBackup()

bool XLogCheckBufferNeedsBackup ( Buffer  buffer)

Definition at line 1027 of file xloginsert.c.

1028 {
1030  bool doPageWrites;
1031  Page page;
1032 
1034 
1035  page = BufferGetPage(buffer);
1036 
1037  if (doPageWrites && PageGetLSN(page) <= RedoRecPtr)
1038  return true; /* buffer requires backup */
1039 
1040  return false; /* buffer does not need to be backed up */
1041 }
static XLogRecPtr PageGetLSN(const char *page)
Definition: bufpage.h:386
void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p)
Definition: xlog.c:6467
static XLogRecPtr RedoRecPtr
Definition: xlog.c:273
static bool doPageWrites
Definition: xlog.c:286

References BufferGetPage(), doPageWrites, GetFullPageWriteInfo(), PageGetLSN(), and RedoRecPtr.

Referenced by heap_page_prune_and_freeze(), and log_heap_update().

◆ XLogEnsureRecordSpace()

void XLogEnsureRecordSpace ( int  max_block_id,
int  ndatas 
)

Definition at line 175 of file xloginsert.c.

176 {
177  int nbuffers;
178 
179  /*
180  * This must be called before entering a critical section, because
181  * allocating memory inside a critical section can fail. repalloc() will
182  * check the same, but better to check it here too so that we fail
183  * consistently even if the arrays happen to be large enough already.
184  */
185  Assert(CritSectionCount == 0);
186 
187  /* the minimum values can't be decreased */
188  if (max_block_id < XLR_NORMAL_MAX_BLOCK_ID)
189  max_block_id = XLR_NORMAL_MAX_BLOCK_ID;
190  if (ndatas < XLR_NORMAL_RDATAS)
191  ndatas = XLR_NORMAL_RDATAS;
192 
193  if (max_block_id > XLR_MAX_BLOCK_ID)
194  elog(ERROR, "maximum number of WAL record block references exceeded");
195  nbuffers = max_block_id + 1;
196 
197  if (nbuffers > max_registered_buffers)
198  {
200  repalloc(registered_buffers, sizeof(registered_buffer) * nbuffers);
201 
202  /*
203  * At least the padding bytes in the structs must be zeroed, because
204  * they are included in WAL data, but initialize it all for tidiness.
205  */
207  (nbuffers - max_registered_buffers) * sizeof(registered_buffer));
208  max_registered_buffers = nbuffers;
209  }
210 
211  if (ndatas > max_rdatas)
212  {
213  rdatas = (XLogRecData *) repalloc(rdatas, sizeof(XLogRecData) * ndatas);
214  max_rdatas = ndatas;
215  }
216 }
#define MemSet(start, val, len)
Definition: c.h:999
void * repalloc(void *pointer, Size size)
Definition: mcxt.c:1541

References Assert, CritSectionCount, elog, ERROR, max_rdatas, max_registered_buffers, MemSet, rdatas, registered_buffers, repalloc(), XLR_MAX_BLOCK_ID, XLR_NORMAL_MAX_BLOCK_ID, and XLR_NORMAL_RDATAS.

Referenced by _hash_freeovflpage(), _hash_squeezebucket(), EndPrepare(), gistplacetopage(), log_newpage_range(), log_newpages(), and shiftList().

◆ XLogInsert()

XLogRecPtr XLogInsert ( RmgrId  rmid,
uint8  info 
)

Definition at line 474 of file xloginsert.c.

475 {
476  XLogRecPtr EndPos;
477 
478  /* XLogBeginInsert() must have been called. */
479  if (!begininsert_called)
480  elog(ERROR, "XLogBeginInsert was not called");
481 
482  /*
483  * The caller can set rmgr bits, XLR_SPECIAL_REL_UPDATE and
484  * XLR_CHECK_CONSISTENCY; the rest are reserved for use by me.
485  */
486  if ((info & ~(XLR_RMGR_INFO_MASK |
488  XLR_CHECK_CONSISTENCY)) != 0)
489  elog(PANIC, "invalid xlog info mask %02X", info);
490 
491  TRACE_POSTGRESQL_WAL_INSERT(rmid, info);
492 
493  /*
494  * In bootstrap mode, we don't actually log anything but XLOG resources;
495  * return a phony record pointer.
496  */
497  if (IsBootstrapProcessingMode() && rmid != RM_XLOG_ID)
498  {
500  EndPos = SizeOfXLogLongPHD; /* start of 1st chkpt record */
501  return EndPos;
502  }
503 
504  do
505  {
507  bool doPageWrites;
508  bool topxid_included = false;
509  XLogRecPtr fpw_lsn;
510  XLogRecData *rdt;
511  int num_fpi = 0;
512 
513  /*
514  * Get values needed to decide whether to do full-page writes. Since
515  * we don't yet have an insertion lock, these could change under us,
516  * but XLogInsertRecord will recheck them once it has a lock.
517  */
519 
520  rdt = XLogRecordAssemble(rmid, info, RedoRecPtr, doPageWrites,
521  &fpw_lsn, &num_fpi, &topxid_included);
522 
523  EndPos = XLogInsertRecord(rdt, fpw_lsn, curinsert_flags, num_fpi,
524  topxid_included);
525  } while (EndPos == InvalidXLogRecPtr);
526 
528 
529  return EndPos;
530 }
#define PANIC
Definition: elog.h:42
#define IsBootstrapProcessingMode()
Definition: miscadmin.h:454
XLogRecPtr XLogInsertRecord(XLogRecData *rdata, XLogRecPtr fpw_lsn, uint8 flags, int num_fpi, bool topxid_included)
Definition: xlog.c:748
#define SizeOfXLogLongPHD
Definition: xlog_internal.h:69
#define InvalidXLogRecPtr
Definition: xlogdefs.h:28
static uint8 curinsert_flags
Definition: xloginsert.c:103
void XLogResetInsertion(void)
Definition: xloginsert.c:222
static XLogRecData * XLogRecordAssemble(RmgrId rmid, uint8 info, XLogRecPtr RedoRecPtr, bool doPageWrites, XLogRecPtr *fpw_lsn, int *num_fpi, bool *topxid_included)
Definition: xloginsert.c:548
#define XLR_RMGR_INFO_MASK
Definition: xlogrecord.h:63
#define XLR_SPECIAL_REL_UPDATE
Definition: xlogrecord.h:82
#define XLR_CHECK_CONSISTENCY
Definition: xlogrecord.h:91

References begininsert_called, curinsert_flags, doPageWrites, elog, ERROR, GetFullPageWriteInfo(), InvalidXLogRecPtr, IsBootstrapProcessingMode, PANIC, RedoRecPtr, SizeOfXLogLongPHD, XLogInsertRecord(), XLogRecordAssemble(), XLogResetInsertion(), XLR_CHECK_CONSISTENCY, XLR_RMGR_INFO_MASK, and XLR_SPECIAL_REL_UPDATE.

Referenced by _bt_allocbuf(), _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_getroot(), _bt_insertonpg(), _bt_mark_page_halfdead(), _bt_newlevel(), _bt_set_cleanup_info(), _bt_split(), _bt_unlink_halfdead_page(), _hash_addovflpage(), _hash_doinsert(), _hash_expandtable(), _hash_freeovflpage(), _hash_init(), _hash_splitbucket(), _hash_squeezebucket(), _hash_vacuum_one_page(), addLeafTuple(), AssignTransactionId(), brin_doinsert(), brin_doupdate(), brinbuild(), brinRevmapDesummarizeRange(), CreateCheckPoint(), CreateDatabaseUsingFileCopy(), CreateDirAndVersionFile(), CreateEndOfRecoveryRecord(), CreateOverwriteContrecordRecord(), createPostingTree(), CreateTableSpace(), do_pg_backup_stop(), do_setval(), doPickSplit(), DropTableSpace(), EndPrepare(), ExecuteTruncateGuts(), fill_seq_fork_with_data(), GenericXLogFinish(), ginDeletePage(), ginHeapTupleFastInsert(), ginPlaceToPage(), ginUpdateStats(), ginVacuumPostingTreeLeaf(), gistXLogAssignLSN(), gistXLogDelete(), gistXLogPageDelete(), gistXLogPageReuse(), gistXLogSplit(), gistXLogUpdate(), hashbucketcleanup(), hashbulkdelete(), heap_abort_speculative(), heap_delete(), heap_finish_speculative(), heap_inplace_update_and_unlock(), heap_insert(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_multi_insert(), heap_update(), log_heap_new_cid(), log_heap_prune_and_freeze(), log_heap_update(), log_heap_visible(), log_newpage(), log_newpage_range(), log_newpages(), log_smgrcreate(), log_split_page(), LogAccessExclusiveLocks(), LogCurrentRunningXacts(), logical_heap_rewrite_flush_mappings(), LogLogicalInvalidations(), LogLogicalMessage(), LogStandbyInvalidations(), movedb(), moveLeafs(), MultiXactIdCreateFromMembers(), nextval_internal(), pg_truncate_visibility_map(), RelationTruncate(), remove_dbtablespaces(), replorigin_advance(), replorigin_state_clear(), RequestXLogSwitch(), revmap_physical_extend(), shiftList(), spgAddNodeAction(), spgSplitNodeAction(), test_custom_rmgrs_insert_wal_record(), UpdateFullPageWrites(), vacuumLeafPage(), vacuumLeafRoot(), vacuumRedirectAndPlaceholder(), write_relmap_file(), writeListPage(), WriteMTruncateXlogRec(), WriteMZeroPageXlogRec(), WriteTruncateXlogRec(), WriteZeroPageXlogRec(), XactLogAbortRecord(), XactLogCommitRecord(), XLogPutNextOid(), XLogReportParameters(), XLogRestorePoint(), XLogSaveBufferForHint(), and xlogVacuumPage().

◆ XLogRegisterBlock()

void XLogRegisterBlock ( uint8  block_id,
RelFileLocator rlocator,
ForkNumber  forknum,
BlockNumber  blknum,
const char *  page,
uint8  flags 
)

Definition at line 309 of file xloginsert.c.

311 {
312  registered_buffer *regbuf;
313 
315 
316  if (block_id >= max_registered_block_id)
317  max_registered_block_id = block_id + 1;
318 
319  if (block_id >= max_registered_buffers)
320  elog(ERROR, "too many registered buffers");
321 
322  regbuf = &registered_buffers[block_id];
323 
324  regbuf->rlocator = *rlocator;
325  regbuf->forkno = forknum;
326  regbuf->block = blknum;
327  regbuf->page = page;
328  regbuf->flags = flags;
329  regbuf->rdata_tail = (XLogRecData *) &regbuf->rdata_head;
330  regbuf->rdata_len = 0;
331 
332  /*
333  * Check that this page hasn't already been registered with some other
334  * block_id.
335  */
336 #ifdef USE_ASSERT_CHECKING
337  {
338  int i;
339 
340  for (i = 0; i < max_registered_block_id; i++)
341  {
342  registered_buffer *regbuf_old = &registered_buffers[i];
343 
344  if (i == block_id || !regbuf_old->in_use)
345  continue;
346 
347  Assert(!RelFileLocatorEquals(regbuf_old->rlocator, regbuf->rlocator) ||
348  regbuf_old->forkno != regbuf->forkno ||
349  regbuf_old->block != regbuf->block);
350  }
351  }
352 #endif
353 
354  regbuf->in_use = true;
355 }
for(;;)
#define RelFileLocatorEquals(locator1, locator2)
const char * page
Definition: xloginsert.c:75
XLogRecData * rdata_tail
Definition: xloginsert.c:79
BlockNumber block
Definition: xloginsert.c:74
XLogRecData * rdata_head
Definition: xloginsert.c:77
ForkNumber forkno
Definition: xloginsert.c:73
RelFileLocator rlocator
Definition: xloginsert.c:72

References Assert, begininsert_called, registered_buffer::block, elog, ERROR, registered_buffer::flags, for(), registered_buffer::forkno, i, registered_buffer::in_use, max_registered_block_id, max_registered_buffers, registered_buffer::page, registered_buffer::rdata_head, registered_buffer::rdata_len, registered_buffer::rdata_tail, registered_buffers, RelFileLocatorEquals, and registered_buffer::rlocator.

Referenced by heap_inplace_update_and_unlock(), log_newpage(), log_newpages(), and XLogSaveBufferForHint().

◆ XLogRegisterBufData()

void XLogRegisterBufData ( uint8  block_id,
const char *  data,
uint32  len 
)

Definition at line 405 of file xloginsert.c.

406 {
407  registered_buffer *regbuf;
408  XLogRecData *rdata;
409 
411 
412  /* find the registered buffer struct */
413  regbuf = &registered_buffers[block_id];
414  if (!regbuf->in_use)
415  elog(ERROR, "no block with id %d registered with WAL insertion",
416  block_id);
417 
418  /*
419  * Check against max_rdatas and ensure we do not register more data per
420  * buffer than can be handled by the physical data format; i.e. that
421  * regbuf->rdata_len does not grow beyond what
422  * XLogRecordBlockHeader->data_length can hold.
423  */
424  if (num_rdatas >= max_rdatas)
425  ereport(ERROR,
426  (errmsg_internal("too much WAL data"),
427  errdetail_internal("%d out of %d data segments are already in use.",
429  if (regbuf->rdata_len + len > UINT16_MAX || len > UINT16_MAX)
430  ereport(ERROR,
431  (errmsg_internal("too much WAL data"),
432  errdetail_internal("Registering more than maximum %u bytes allowed to block %u: current %u bytes, adding %u bytes.",
433  UINT16_MAX, block_id, regbuf->rdata_len, len)));
434 
435  rdata = &rdatas[num_rdatas++];
436 
437  rdata->data = data;
438  rdata->len = len;
439 
440  regbuf->rdata_tail->next = rdata;
441  regbuf->rdata_tail = rdata;
442  regbuf->rdata_len += len;
443 }
int errmsg_internal(const char *fmt,...)
Definition: elog.c:1157
int errdetail_internal(const char *fmt,...)
Definition: elog.c:1230
#define ereport(elevel,...)
Definition: elog.h:149
const void size_t len
const void * data
const char * data
struct XLogRecData * next
static int num_rdatas
Definition: xloginsert.c:129

References Assert, begininsert_called, XLogRecData::data, data, elog, ereport, errdetail_internal(), errmsg_internal(), ERROR, registered_buffer::in_use, XLogRecData::len, len, max_rdatas, XLogRecData::next, num_rdatas, registered_buffer::rdata_len, registered_buffer::rdata_tail, rdatas, and registered_buffers.

Referenced by _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_getroot(), _bt_insertonpg(), _bt_newlevel(), _bt_set_cleanup_info(), _bt_split(), _bt_unlink_halfdead_page(), _hash_addovflpage(), _hash_doinsert(), _hash_expandtable(), _hash_freeovflpage(), _hash_squeezebucket(), brin_doinsert(), brin_doupdate(), dataExecPlaceToPageInternal(), dataExecPlaceToPageLeaf(), entryExecPlaceToPage(), GenericXLogFinish(), ginHeapTupleFastInsert(), ginVacuumPostingTreeLeaf(), gistXLogSplit(), gistXLogUpdate(), hashbucketcleanup(), heap_inplace_update_and_unlock(), heap_insert(), heap_multi_insert(), log_heap_prune_and_freeze(), log_heap_update(), and writeListPage().

◆ XLogRegisterBuffer()

void XLogRegisterBuffer ( uint8  block_id,
Buffer  buffer,
uint8  flags 
)

Definition at line 242 of file xloginsert.c.

243 {
244  registered_buffer *regbuf;
245 
246  /* NO_IMAGE doesn't make sense with FORCE_IMAGE */
247  Assert(!((flags & REGBUF_FORCE_IMAGE) && (flags & (REGBUF_NO_IMAGE))));
249 
250  /*
251  * Ordinarily, buffer should be exclusive-locked and marked dirty before
252  * we get here, otherwise we could end up violating one of the rules in
253  * access/transam/README.
254  *
255  * Some callers intentionally register a clean page and never update that
256  * page's LSN; in that case they can pass the flag REGBUF_NO_CHANGE to
257  * bypass these checks.
258  */
259 #ifdef USE_ASSERT_CHECKING
260  if (!(flags & REGBUF_NO_CHANGE))
261  Assert(BufferIsExclusiveLocked(buffer) && BufferIsDirty(buffer));
262 #endif
263 
264  if (block_id >= max_registered_block_id)
265  {
266  if (block_id >= max_registered_buffers)
267  elog(ERROR, "too many registered buffers");
268  max_registered_block_id = block_id + 1;
269  }
270 
271  regbuf = &registered_buffers[block_id];
272 
273  BufferGetTag(buffer, &regbuf->rlocator, &regbuf->forkno, &regbuf->block);
274  regbuf->page = BufferGetPage(buffer);
275  regbuf->flags = flags;
276  regbuf->rdata_tail = (XLogRecData *) &regbuf->rdata_head;
277  regbuf->rdata_len = 0;
278 
279  /*
280  * Check that this page hasn't already been registered with some other
281  * block_id.
282  */
283 #ifdef USE_ASSERT_CHECKING
284  {
285  int i;
286 
287  for (i = 0; i < max_registered_block_id; i++)
288  {
289  registered_buffer *regbuf_old = &registered_buffers[i];
290 
291  if (i == block_id || !regbuf_old->in_use)
292  continue;
293 
294  Assert(!RelFileLocatorEquals(regbuf_old->rlocator, regbuf->rlocator) ||
295  regbuf_old->forkno != regbuf->forkno ||
296  regbuf_old->block != regbuf->block);
297  }
298  }
299 #endif
300 
301  regbuf->in_use = true;
302 }
bool BufferIsExclusiveLocked(Buffer buffer)
Definition: bufmgr.c:2471
bool BufferIsDirty(Buffer buffer)
Definition: bufmgr.c:2500
#define REGBUF_NO_CHANGE
Definition: xloginsert.h:36
#define REGBUF_NO_IMAGE
Definition: xloginsert.h:32

References Assert, begininsert_called, registered_buffer::block, BufferGetPage(), BufferGetTag(), BufferIsDirty(), BufferIsExclusiveLocked(), elog, ERROR, registered_buffer::flags, for(), registered_buffer::forkno, i, registered_buffer::in_use, max_registered_block_id, max_registered_buffers, registered_buffer::page, registered_buffer::rdata_head, registered_buffer::rdata_len, registered_buffer::rdata_tail, REGBUF_FORCE_IMAGE, REGBUF_NO_CHANGE, REGBUF_NO_IMAGE, registered_buffers, RelFileLocatorEquals, and registered_buffer::rlocator.

Referenced by _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_getroot(), _bt_insertonpg(), _bt_mark_page_halfdead(), _bt_newlevel(), _bt_set_cleanup_info(), _bt_split(), _bt_unlink_halfdead_page(), _hash_addovflpage(), _hash_doinsert(), _hash_expandtable(), _hash_freeovflpage(), _hash_init(), _hash_splitbucket(), _hash_squeezebucket(), _hash_vacuum_one_page(), addLeafTuple(), brin_doinsert(), brin_doupdate(), brinbuild(), brinRevmapDesummarizeRange(), createPostingTree(), dataExecPlaceToPageInternal(), dataExecPlaceToPageLeaf(), do_setval(), doPickSplit(), entryExecPlaceToPage(), fill_seq_fork_with_data(), GenericXLogFinish(), ginDeletePage(), ginHeapTupleFastInsert(), ginPlaceToPage(), ginUpdateStats(), ginVacuumPostingTreeLeaf(), gistXLogDelete(), gistXLogPageDelete(), gistXLogSplit(), gistXLogUpdate(), hashbucketcleanup(), hashbulkdelete(), heap_abort_speculative(), heap_delete(), heap_finish_speculative(), heap_insert(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_multi_insert(), heap_update(), log_heap_prune_and_freeze(), log_heap_update(), log_heap_visible(), log_newpage_range(), log_split_page(), moveLeafs(), nextval_internal(), revmap_physical_extend(), shiftList(), spgAddNodeAction(), spgSplitNodeAction(), vacuumLeafPage(), vacuumLeafRoot(), vacuumRedirectAndPlaceholder(), writeListPage(), and xlogVacuumPage().

◆ XLogRegisterData()

void XLogRegisterData ( const char *  data,
uint32  len 
)

Definition at line 364 of file xloginsert.c.

365 {
366  XLogRecData *rdata;
367 
369 
370  if (num_rdatas >= max_rdatas)
371  ereport(ERROR,
372  (errmsg_internal("too much WAL data"),
373  errdetail_internal("%d out of %d data segments are already in use.",
375  rdata = &rdatas[num_rdatas++];
376 
377  rdata->data = data;
378  rdata->len = len;
379 
380  /*
381  * we use the mainrdata_last pointer to track the end of the chain, so no
382  * need to clear 'next' here.
383  */
384 
385  mainrdata_last->next = rdata;
386  mainrdata_last = rdata;
387 
388  mainrdata_len += len;
389 }

References Assert, begininsert_called, XLogRecData::data, data, ereport, errdetail_internal(), errmsg_internal(), ERROR, XLogRecData::len, len, mainrdata_last, mainrdata_len, max_rdatas, XLogRecData::next, num_rdatas, and rdatas.

Referenced by _bt_allocbuf(), _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_getroot(), _bt_insertonpg(), _bt_mark_page_halfdead(), _bt_newlevel(), _bt_split(), _bt_unlink_halfdead_page(), _hash_addovflpage(), _hash_doinsert(), _hash_expandtable(), _hash_freeovflpage(), _hash_init(), _hash_splitbucket(), _hash_squeezebucket(), _hash_vacuum_one_page(), addLeafTuple(), AssignTransactionId(), brin_doinsert(), brin_doupdate(), brinbuild(), brinRevmapDesummarizeRange(), CreateCheckPoint(), CreateDatabaseUsingFileCopy(), CreateDirAndVersionFile(), CreateEndOfRecoveryRecord(), CreateOverwriteContrecordRecord(), createPostingTree(), CreateTableSpace(), do_pg_backup_stop(), do_setval(), doPickSplit(), DropTableSpace(), EndPrepare(), ExecuteTruncateGuts(), fill_seq_fork_with_data(), ginDeletePage(), ginHeapTupleFastInsert(), ginPlaceToPage(), ginUpdateStats(), gistXLogAssignLSN(), gistXLogDelete(), gistXLogPageDelete(), gistXLogPageReuse(), gistXLogSplit(), gistXLogUpdate(), hashbucketcleanup(), hashbulkdelete(), heap_abort_speculative(), heap_delete(), heap_finish_speculative(), heap_inplace_update_and_unlock(), heap_insert(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_multi_insert(), heap_update(), log_heap_new_cid(), log_heap_prune_and_freeze(), log_heap_update(), log_heap_visible(), log_smgrcreate(), LogAccessExclusiveLocks(), LogCurrentRunningXacts(), logical_heap_rewrite_flush_mappings(), LogLogicalInvalidations(), LogLogicalMessage(), LogStandbyInvalidations(), movedb(), moveLeafs(), MultiXactIdCreateFromMembers(), nextval_internal(), pg_truncate_visibility_map(), RelationTruncate(), remove_dbtablespaces(), replorigin_advance(), replorigin_state_clear(), revmap_physical_extend(), shiftList(), spgAddNodeAction(), spgSplitNodeAction(), test_custom_rmgrs_insert_wal_record(), UpdateFullPageWrites(), vacuumLeafPage(), vacuumLeafRoot(), vacuumRedirectAndPlaceholder(), write_relmap_file(), writeListPage(), WriteMTruncateXlogRec(), WriteMZeroPageXlogRec(), WriteTruncateXlogRec(), WriteZeroPageXlogRec(), XactLogAbortRecord(), XactLogCommitRecord(), XLogPutNextOid(), XLogReportParameters(), and XLogRestorePoint().

◆ XLogResetInsertion()

void XLogResetInsertion ( void  )

Definition at line 222 of file xloginsert.c.

223 {
224  int i;
225 
226  for (i = 0; i < max_registered_block_id; i++)
227  registered_buffers[i].in_use = false;
228 
229  num_rdatas = 0;
231  mainrdata_len = 0;
233  curinsert_flags = 0;
234  begininsert_called = false;
235 }

References begininsert_called, curinsert_flags, i, mainrdata_head, mainrdata_last, mainrdata_len, max_registered_block_id, num_rdatas, and registered_buffers.

Referenced by AbortSubTransaction(), AbortTransaction(), and XLogInsert().

◆ XLogSaveBufferForHint()

XLogRecPtr XLogSaveBufferForHint ( Buffer  buffer,
bool  buffer_std 
)

Definition at line 1065 of file xloginsert.c.

1066 {
1067  XLogRecPtr recptr = InvalidXLogRecPtr;
1068  XLogRecPtr lsn;
1070 
1071  /*
1072  * Ensure no checkpoint can change our view of RedoRecPtr.
1073  */
1075 
1076  /*
1077  * Update RedoRecPtr so that we can make the right decision
1078  */
1080 
1081  /*
1082  * We assume page LSN is first data on *every* page that can be passed to
1083  * XLogInsert, whether it has the standard page layout or not. Since we're
1084  * only holding a share-lock on the page, we must take the buffer header
1085  * lock when we look at the LSN.
1086  */
1087  lsn = BufferGetLSNAtomic(buffer);
1088 
1089  if (lsn <= RedoRecPtr)
1090  {
1091  int flags = 0;
1092  PGAlignedBlock copied_buffer;
1093  char *origdata = (char *) BufferGetBlock(buffer);
1094  RelFileLocator rlocator;
1095  ForkNumber forkno;
1096  BlockNumber blkno;
1097 
1098  /*
1099  * Copy buffer so we don't have to worry about concurrent hint bit or
1100  * lsn updates. We assume pd_lower/upper cannot be changed without an
1101  * exclusive lock, so the contents bkp are not racy.
1102  */
1103  if (buffer_std)
1104  {
1105  /* Assume we can omit data between pd_lower and pd_upper */
1106  Page page = BufferGetPage(buffer);
1107  uint16 lower = ((PageHeader) page)->pd_lower;
1108  uint16 upper = ((PageHeader) page)->pd_upper;
1109 
1110  memcpy(copied_buffer.data, origdata, lower);
1111  memcpy(copied_buffer.data + upper, origdata + upper, BLCKSZ - upper);
1112  }
1113  else
1114  memcpy(copied_buffer.data, origdata, BLCKSZ);
1115 
1116  XLogBeginInsert();
1117 
1118  if (buffer_std)
1119  flags |= REGBUF_STANDARD;
1120 
1121  BufferGetTag(buffer, &rlocator, &forkno, &blkno);
1122  XLogRegisterBlock(0, &rlocator, forkno, blkno, copied_buffer.data, flags);
1123 
1124  recptr = XLogInsert(RM_XLOG_ID, XLOG_FPI_FOR_HINT);
1125  }
1126 
1127  return recptr;
1128 }
XLogRecPtr BufferGetLSNAtomic(Buffer buffer)
Definition: bufmgr.c:3985
static Block BufferGetBlock(Buffer buffer)
Definition: bufmgr.h:367
PageHeaderData * PageHeader
Definition: bufpage.h:173
unsigned short uint16
Definition: c.h:491
Datum lower(PG_FUNCTION_ARGS)
Definition: oracle_compat.c:49
Datum upper(PG_FUNCTION_ARGS)
Definition: oracle_compat.c:80
#define XLOG_FPI_FOR_HINT
Definition: pg_control.h:78
#define DELAY_CHKPT_START
Definition: proc.h:119
PGPROC * MyProc
Definition: proc.c:66
int delayChkptFlags
Definition: proc.h:240
char data[BLCKSZ]
Definition: c.h:1098
XLogRecPtr GetRedoRecPtr(void)
Definition: xlog.c:6437

References Assert, BufferGetBlock(), BufferGetLSNAtomic(), BufferGetPage(), BufferGetTag(), PGAlignedBlock::data, DELAY_CHKPT_START, PGPROC::delayChkptFlags, GetRedoRecPtr(), InvalidXLogRecPtr, lower(), MyProc, RedoRecPtr, REGBUF_STANDARD, upper(), XLOG_FPI_FOR_HINT, XLogBeginInsert(), XLogInsert(), and XLogRegisterBlock().

Referenced by MarkBufferDirtyHint().

◆ XLogSetRecordFlags()