Skip to content

Commit 0695fa6

Browse files
Satyanarayana Narlapuramhackorum
authored andcommitted
Fix checkpointer PANIC due to missing fsync cancel in mdunlinkfork()
Add missing register_forget_request() in the 'else' branch of mdunlinkfork(), before register_unlink_segment(), matching what the 'if' branch already does.
1 parent b597835 commit 0695fa6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • src/backend/storage/smgr

src/backend/storage/smgr/md.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ mdunlinkfork(RelFileLocatorBackend rlocator, ForkNumber forknum, bool isRedo)
418418
/* Prevent other backends' fds from holding on to the disk space */
419419
ret = do_truncate(path.str);
420420

421+
/* Forget any pending sync requests for the first segment */
422+
save_errno = errno;
423+
register_forget_request(rlocator, forknum, 0 /* first seg */ );
424+
errno = save_errno;
425+
421426
/* Register request to unlink first segment later */
422427
save_errno = errno;
423428
register_unlink_tombstone(rlocator);

0 commit comments

Comments
 (0)