Skip to content

Commit

Permalink
Set last written page lsn for created relation (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
knizhnik authored and tristan957 committed Nov 8, 2023
1 parent 116e8f9 commit 512867e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/catalog/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ void
log_smgrcreate(const RelFileNode *rnode, ForkNumber forkNum)
{
xl_smgr_create xlrec;
XLogRecPtr lsn;

/*
* Make an XLOG entry reporting the file creation.
Expand All @@ -184,7 +185,8 @@ log_smgrcreate(const RelFileNode *rnode, ForkNumber forkNum)

XLogBeginInsert();
XLogRegisterData((char *) &xlrec, sizeof(xlrec));
XLogInsert(RM_SMGR_ID, XLOG_SMGR_CREATE | XLR_SPECIAL_REL_UPDATE);
lsn = XLogInsert(RM_SMGR_ID, XLOG_SMGR_CREATE | XLR_SPECIAL_REL_UPDATE);
SetLastWrittenLSNForRelation(lsn, *rnode, forkNum);
}

/*
Expand Down

0 comments on commit 512867e

Please sign in to comment.