Fix checkpoint signalling
Checkpointer uses its MyLatch to wake up when a checkpoint request is received. But before commit c6550776 the latch was not used for anything else, so the code could just go to sleep after each loop without rechecking the sleeping condition. That commit added a separate ResetLatch in its code path[1], which can cause a checkpoint to go unnoticed for potentially a long time. Fix by skipping sleep if any checkpoint flags are set. Also add a test to verify this; authored by Kyotaro Horiguchi. [1] CreateCheckPoint -> InvalidateObsoleteReplicationSlots -> ConditionVariableTimeSleep Report and diagnosis by Kyotaro Horiguchi. Co-authored-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/20200408.141956.891237856186513376.horikyota.ntt@gmail.com
Showing
Please register or sign in to comment