Check for interrupts inside the nbtree page deletion code.
Check for interrupts inside the nbtree page deletion code.

When deleting pages the nbtree code has to walk through siblings of a
tree node. When those sibling links are corrupted that can lead to
endless loops - which are currently not interruptible.  This is
especially problematic if autovacuum is repeatedly blocked on such
indexes, as it can be hard to get out of that situation without
resorting to single user mode.

Thus add interrupt checks to appropriate places in such
loops. Unfortunately in one of the cases it's it's not easy to do so.

Between 9.3 and 9.4 the page deletion (and page split) code changed
significantly. Before it was significantly less robust against
interruptions. Therefore don't backpatch to 9.3.

Author: Andres Freund
Discussion: 53afc612f263a245ccafe8a10c3fd1f9c6b6924c@alap3.anarazel.de
Backpatch: 9.4-

50wu/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,xinzweb/gpdb,adam8157/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,lisakowen/gpdb,greenplum-db/gpdb,adam8157/gpdb,xinzweb/gpdb,lisakowen/gpdb,greenplum-db/gpdb,adam8157/gpdb,lisakowen/gpdb,50wu/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,xinzweb/gpdb,lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,xinzweb/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,adam8157/gpdb,lisakowen/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,adam8157/gpdb,xinzweb/gpdb,ashwinstar/gpdb