Only allow autovacuum to be auto-canceled by a directly blocked process.
Only allow autovacuum to be auto-canceled by a directly blocked process.

In the original coding of the autovacuum cancel feature, commit
acac68b2bcae818bc8803b8cb8cbb17eee8d5e2b, an autovacuum process was
considered a target for cancellation if it was found to hard-block any
process examined in the deadlock search.  This patch tightens the test so
that the autovacuum must directly hard-block the current process.  This
should make the behavior more predictable in general, and in particular
it ensures that an autovacuum will not be canceled with less than
deadlock_timeout grace period.  In the old coding, it was possible for an
autovacuum to be canceled almost instantly, given unfortunate timing of two
or more other processes' lock attempts.

This also justifies the logging methodology in the recent commit
d7318d43d891bd63e82dcfc27948113ed7b1db80; without this restriction, that
patch isn't providing enough information to see the connection of the
canceling process to the autovacuum.  Like that one, patch all the way
back.

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