Set the process latch when processing recovery conflict interrupts.
Set the process latch when processing recovery conflict interrupts.

Because RecoveryConflictInterrupt() didn't set the process latch
anything using the latter to wait for events didn't get notified about
recovery conflicts. Most latch users are never the target of recovery
conflicts, which explains the lack of reports about this until
now.
Since 9.3 two possible affected users exist though: The sql callable
pg_sleep() now uses latches to wait and background workers are
expected to use latches in their main loop. Both would currently wait
until the end of WaitLatch's timeout.

Fix by adding a SetLatch() to RecoveryConflictInterrupt(). It'd also
be possible to fix the issue by having each latch user set
set_latch_on_sigusr1. That seems failure prone and though, as most of
these callsites won't often receive recovery conflicts and thus will
likely only be tested against normal query cancels et al. It'd also be
unnecessarily verbose.

Backpatch to 9.1 where latches were introduced. Arguably 9.3 would be
sufficient, because that's where pg_sleep() was converted to waiting
on the latch and background workers got introduced; but there could be
user level code making use of the latch pre 9.3.

zeroae/postgres-xl,ashwinstar/gpdb,50wu/gpdb,adam8157/gpdb,ovr/postgres-xl,yazun/postgres-xl,greenplum-db/gpdb,ashwinstar/gpdb,adam8157/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,xinzweb/gpdb,jmcatamney/gpdb,xinzweb/gpdb,yazun/postgres-xl,greenplum-db/gpdb,ashwinstar/gpdb,yazun/postgres-xl,Postgres-XL/Postgres-XL,zeroae/postgres-xl,lisakowen/gpdb,yazun/postgres-xl,techdragon/Postgres-XL,ovr/postgres-xl,zeroae/postgres-xl,lisakowen/gpdb,xinzweb/gpdb,adam8157/gpdb,oberstet/postgres-xl,xinzweb/gpdb,50wu/gpdb,zeroae/postgres-xl,adam8157/gpdb,jmcatamney/gpdb,ovr/postgres-xl,ashwinstar/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,pavanvd/postgres-xl,ashwinstar/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,greenplum-db/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,oberstet/postgres-xl,ovr/postgres-xl,ashwinstar/gpdb,50wu/gpdb,jmcatamney/gpdb,adam8157/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,yazun/postgres-xl,jmcatamney/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,50wu/gpdb,lisakowen/gpdb,50wu/gpdb,ovr/postgres-xl,greenplum-db/gpdb,zeroae/postgres-xl,techdragon/Postgres-XL,oberstet/postgres-xl,greenplum-db/gpdb,techdragon/Postgres-XL,adam8157/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,jmcatamney/gpdb,lisakowen/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,xinzweb/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,lisakowen/gpdb,adam8157/gpdb,adam8157/gpdb,50wu/gpdb,techdragon/Postgres-XL,Postgres-XL/Postgres-XL,xinzweb/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,greenplum-db/gpdb