Ensure that seqscans check for interrupts at least once per page.
Ensure that seqscans check for interrupts at least once per page.

If a seqscan encounters many consecutive pages containing only dead tuples,
it can remain in the loop in heapgettup for a long time, and there was no
CHECK_FOR_INTERRUPTS anywhere in that loop.  This meant there were
real-world situations where a query would be effectively uncancelable for
long stretches.  Add a check placed to occur once per page, which should be
enough to provide reasonable response time without adding any measurable
overhead.

Report and patch by Merlin Moncure (though I tweaked it a bit).
Back-patch to all supported branches.

lisakowen/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,Chibin/gpdb,ashwinstar/gpdb,50wu/gpdb,lintzc/gpdb,0x0FFF/gpdb,Chibin/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,lisakowen/gpdb,greenplum-db/gpdb,Chibin/gpdb,xuegang/gpdb,lisakowen/gpdb,Chibin/gpdb,CraigHarris/gpdb,Chibin/gpdb,jmcatamney/gpdb,chrishajas/gpdb,zaksoup/gpdb,50wu/gpdb,yuanzhao/gpdb,Quikling/gpdb,jmcatamney/gpdb,xuegang/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,xinzweb/gpdb,50wu/gpdb,janebeckman/gpdb,0x0FFF/gpdb,Quikling/gpdb,0x0FFF/gpdb,lisakowen/gpdb,xinzweb/gpdb,yuanzhao/gpdb,zaksoup/gpdb,chrishajas/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,lintzc/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,ahachete/gpdb,xuegang/gpdb,royc1/gpdb,cjcjameson/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,royc1/gpdb,rvs/gpdb,lintzc/gpdb,lintzc/gpdb,chrishajas/gpdb,cjcjameson/gpdb,janebeckman/gpdb,ahachete/gpdb,jmcatamney/gpdb,rvs/gpdb,xinzweb/gpdb,cjcjameson/gpdb,xinzweb/gpdb,janebeckman/gpdb,Chibin/gpdb,rvs/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,ahachete/gpdb,royc1/gpdb,ahachete/gpdb,Chibin/gpdb,50wu/gpdb,ashwinstar/gpdb,cjcjameson/gpdb,janebeckman/gpdb,edespino/gpdb,zaksoup/gpdb,Quikling/gpdb,janebeckman/gpdb,yuanzhao/gpdb,edespino/gpdb,lintzc/gpdb,kaknikhil/gpdb,adam8157/gpdb,ahachete/gpdb,Chibin/gpdb,yuanzhao/gpdb,Quikling/gpdb,ashwinstar/gpdb,Quikling/gpdb,xinzweb/gpdb,janebeckman/gpdb,janebeckman/gpdb,royc1/gpdb,xuegang/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,xuegang/gpdb,kaknikhil/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,50wu/gpdb,Chibin/gpdb,greenplum-db/gpdb,ahachete/gpdb,50wu/gpdb,xuegang/gpdb,edespino/gpdb,Quikling/gpdb,chrishajas/gpdb,xuegang/gpdb,cjcjameson/gpdb,adam8157/gpdb,ahachete/gpdb,edespino/gpdb,royc1/gpdb,zaksoup/gpdb,kaknikhil/gpdb,Quikling/gpdb,edespino/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,zaksoup/gpdb,yuanzhao/gpdb,xuegang/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,adam8157/gpdb,edespino/gpdb,adam8157/gpdb,royc1/gpdb,kaknikhil/gpdb,rvs/gpdb,xuegang/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,rvs/gpdb,0x0FFF/gpdb,50wu/gpdb,adam8157/gpdb,edespino/gpdb,lintzc/gpdb,Quikling/gpdb,edespino/gpdb,chrishajas/gpdb,edespino/gpdb,CraigHarris/gpdb,lintzc/gpdb,zaksoup/gpdb,CraigHarris/gpdb,janebeckman/gpdb,jmcatamney/gpdb,lisakowen/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,lintzc/gpdb,xinzweb/gpdb,lisakowen/gpdb,yuanzhao/gpdb,lisakowen/gpdb,royc1/gpdb,zaksoup/gpdb,0x0FFF/gpdb,Chibin/gpdb,0x0FFF/gpdb,lintzc/gpdb,kaknikhil/gpdb,chrishajas/gpdb,chrishajas/gpdb,jmcatamney/gpdb,zaksoup/gpdb,CraigHarris/gpdb,chrishajas/gpdb,CraigHarris/gpdb,janebeckman/gpdb,ahachete/gpdb,ashwinstar/gpdb,royc1/gpdb,CraigHarris/gpdb,rvs/gpdb,rvs/gpdb,adam8157/gpdb,edespino/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,janebeckman/gpdb,rvs/gpdb,CraigHarris/gpdb,rvs/gpdb,Quikling/gpdb,xinzweb/gpdb,Quikling/gpdb,yuanzhao/gpdb,rvs/gpdb