diff options
author | Noah Misch <noah@leadboat.com> | 2021-06-28 18:34:56 -0700 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2021-06-28 18:34:56 -0700 |
commit | 421484f79c0b80209fa766eb00dbc2453a753273 (patch) | |
tree | 9ac302e015f93be23552b6444bbc73ba4dd9bca8 /src/backend/replication/walreceiver.c | |
parent | 85656bc3050f0846f53de95768b0f9f9df410560 (diff) |
Remove XLogFileInit() ability to unlink a pre-existing file.
Only initdb used it. initdb refuses to operate on a non-empty directory
and generally does not cope with pre-existing files of other kinds.
Hence, use the opportunity to simplify.
Discussion: https://postgr.es/m/20210202151416.GB3304930@rfd.leadboat.com
Diffstat (limited to 'src/backend/replication/walreceiver.c')
-rw-r--r-- | src/backend/replication/walreceiver.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index b00066ed2a7..eadff8f908f 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -885,7 +885,7 @@ XLogWalRcvWrite(char *buf, Size nbytes, XLogRecPtr recptr) if (recvFile < 0 || !XLByteInSeg(recptr, recvSegNo, wal_segment_size)) { - bool use_existent; + bool added; /* * fsync() and close current file before we switch to next one. We @@ -923,8 +923,7 @@ XLogWalRcvWrite(char *buf, Size nbytes, XLogRecPtr recptr) /* Create/use new log file */ XLByteToSeg(recptr, recvSegNo, wal_segment_size); - use_existent = true; - recvFile = XLogFileInit(recvSegNo, &use_existent); + recvFile = XLogFileInit(recvSegNo, &added); recvFileTLI = ThisTimeLineID; } |