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

Commit 1fabec7

Browse files
committed
fsync pg_logical/mappings in CheckPointLogicalRewriteHeap().
While individual logical rewrite files were synced to disk, the directory was not. On some filesystems that could lead to loosing directory entries after a crash. Reported-By: Tom Lane <tgl@sss.pgh.pa.us> Author: Nathan Bossart <bossartn@amazon.com> Discussion: https://postgr.es/m/867F2E29-2782-4869-970E-B984C6D35A8F@amazon.com Backpatch: 10-
1 parent 6c07f9e commit 1fabec7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/access/heap/rewriteheap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,4 +1282,7 @@ CheckPointLogicalRewriteHeap(void)
12821282
}
12831283
}
12841284
FreeDir(mappings_dir);
1285+
1286+
/* persist directory entries to disk */
1287+
fsync_fname("pg_logical/mappings", true);
12851288
}

0 commit comments

Comments
 (0)