Fix bug that can cause walsender not to terminating at shutdown.
authorAndres Freund
Thu, 24 Aug 2017 22:21:32 +0000 (15:21 -0700)
committerAndres Freund
Thu, 24 Aug 2017 22:21:32 +0000 (15:21 -0700)
When backpatching c6c333436 I (Andres Freund) mis-resolved a conflict
in the 9.4 branch. Unfortunately that leads to walsenders waiting
forever when shutting down with connected standbys, unless immediate
mode is used, or the standbys are forced to disconnect by other means.

Author: Marco Nenciarini
Reported-By: Abhijit Gharami, Marco Nenciarini
Discussion:
http://postgr.es/m/1434ad79-ab0d-d6a9-4ea2-1afb1c06adaf@2ndquadrant.it
http://postgr.es/m/CAA5_DuD0O1XyM8OnOzhRepyPU-t8nZKLzs1pT2JpzP0NS+vVNA@mail.gmail.com
Backpatch: 9.4 only

src/backend/replication/walsender.c

index a0601b37074e8f3ccee0c2e5b648c23233bae9e3..b24f9a1e95bbd19d83d6c74c7f71a93dd3b2e909 100644 (file)
@@ -2658,6 +2658,7 @@ WalSndLastCycleHandler(SIGNAL_ARGS)
 {
    int         save_errno = errno;
 
+   got_SIGUSR2 = true;
    if (MyWalSnd)
        SetLatch(&MyWalSnd->latch);