Skip to content

Commit

Permalink
Flush logical messages with snapshots and replication origin (#383)
Browse files Browse the repository at this point in the history
Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
  • Loading branch information
knizhnik and Konstantin Knizhnik authored Feb 21, 2024
1 parent ca2def9 commit 0baccce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/replication/logical/origin.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ CheckPointReplicationOrigin(void)
chkp_size += sizeof(crc);

/* NEON specific: persist snapshot in storage using logical message */
LogLogicalMessage("neon-file:pg_logical/replorigin_checkpoint", buf, chkp_size, false);
XLogFlush(LogLogicalMessage("neon-file:pg_logical/replorigin_checkpoint", buf, chkp_size, false));
}
pfree(buf);

Expand Down
4 changes: 2 additions & 2 deletions src/backend/replication/logical/snapbuild.c
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn)

/* NEON specific: persist snapshot in storage using logical message */
snprintf(prefix, sizeof(prefix), "neon-file:%s", path);
LogLogicalMessage(prefix, (char*)ondisk, needed_length, false);
XLogFlush(LogLogicalMessage(prefix, (char*)ondisk, needed_length, false));

errno = 0;
pgstat_report_wait_start(WAIT_EVENT_SNAPBUILD_WRITE);
Expand Down Expand Up @@ -2106,7 +2106,7 @@ CheckPointSnapBuild(void)

/* NEON specific: delete file from storage using logical message */
snprintf(prefix, sizeof(prefix), "neon-file:%s", path);
LogLogicalMessage(prefix, NULL, 0, false);
XLogFlush(LogLogicalMessage(prefix, NULL, 0, false));

/*
* It's not particularly harmful, though strange, if we can't
Expand Down

0 comments on commit 0baccce

Please sign in to comment.