diff options
Diffstat (limited to 'src/backend/replication/logical/origin.c')
-rw-r--r-- | src/backend/replication/logical/origin.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c index 7e2307f5f22..8c8833b71d0 100644 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -604,29 +604,10 @@ CheckPointReplicationOrigin(void) tmppath))); } - /* fsync the temporary file */ - if (pg_fsync(tmpfd) != 0) - { - CloseTransientFile(tmpfd); - ereport(PANIC, - (errcode_for_file_access(), - errmsg("could not fsync file \"%s\": %m", - tmppath))); - } - CloseTransientFile(tmpfd); - /* rename to permanent file, fsync file and directory */ - if (rename(tmppath, path) != 0) - { - ereport(PANIC, - (errcode_for_file_access(), - errmsg("could not rename file \"%s\" to \"%s\": %m", - tmppath, path))); - } - - fsync_fname(path, false); - fsync_fname("pg_logical", true); + /* fsync, rename to permanent file, fsync file and directory */ + durable_rename(tmppath, path, PANIC); } /* |