Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9010156

Browse files
committed
Fix thinko introduced by 82a5649 in slot.c
When saving a replication slot, failing to close the temporary path used to save the slot information is considered as a failure and reported as such. However the code forgot to leave immediately as other failure paths do. Noticed while looking up at this area of the code for another patch.
1 parent 47ac203 commit 9010156

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/replication/slot.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,10 +1316,13 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
13161316
pgstat_report_wait_end();
13171317

13181318
if (CloseTransientFile(fd))
1319+
{
13191320
ereport(elevel,
13201321
(errcode_for_file_access(),
13211322
errmsg("could not close file \"%s\": %m",
13221323
tmppath)));
1324+
return;
1325+
}
13231326

13241327
/* rename to permanent file, fsync file and directory */
13251328
if (rename(tmppath, path) != 0)

0 commit comments

Comments
 (0)