]> granicus.if.org Git - postgresql/commitdiff
Wake up interested backends when a checkpoint fails.
authorThomas Munro <tmunro@postgresql.org>
Fri, 5 Apr 2019 20:31:48 +0000 (09:31 +1300)
committerThomas Munro <tmunro@postgresql.org>
Fri, 5 Apr 2019 20:31:48 +0000 (09:31 +1300)
Commit c6c9474a switched to condition variables instead of sleep
loops to notify backends of checkpoint start and stop, but forgot
to broadcast in case of checkpoint failure.

Author: Thomas Munro
Discussion: https://postgr.es/m/CA%2BhUKGJKbCd%2B_K%2BSEBsbHxVT60SG0ivWHHAdvL0bLTUt2xpA2w%40mail.gmail.com

src/backend/postmaster/checkpointer.c

index d303ce367945ef57d19f73de2781a6106018ea3c..a1e04239ad0bfec5f12eefcb47f1789afa549a34 100644 (file)
@@ -279,6 +279,8 @@ CheckpointerMain(void)
                        CheckpointerShmem->ckpt_done = CheckpointerShmem->ckpt_started;
                        SpinLockRelease(&CheckpointerShmem->ckpt_lck);
 
+                       ConditionVariableBroadcast(&CheckpointerShmem->done_cv);
+
                        ckpt_active = false;
                }