Add a bit more locking to vac_update_relstats and vac_update_dbstats to make them comparable to what UpdateStats does in the same situation. I'm not certain two instances of vac_update_relstats could run in parallel for the same relation, but parallel invocations of vac_update_dbstats do seem possible.
Add a bit more locking to vac_update_relstats and vac_update_dbstats
to make them comparable to what UpdateStats does in the same situation.
I'm not certain two instances of vac_update_relstats could run in
parallel for the same relation, but parallel invocations of vac_update_dbstats
do seem possible.

Chibin/gpdb,xuegang/gpdb,atris/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,Quikling/gpdb,CraigHarris/gpdb,50wu/gpdb,greenplum-db/gpdb,adam8157/gpdb,Chibin/gpdb,zaksoup/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,janebeckman/gpdb,zaksoup/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,Postgres-XL/Postgres-XL,xuegang/gpdb,chrishajas/gpdb,lintzc/gpdb,chrishajas/gpdb,pavanvd/postgres-xl,tangp3/gpdb,0x0FFF/gpdb,Chibin/gpdb,postmind-net/postgres-xl,adam8157/gpdb,Quikling/gpdb,lintzc/gpdb,lintzc/gpdb,Postgres-XL/Postgres-XL,royc1/gpdb,postmind-net/postgres-xl,Chibin/gpdb,lisakowen/gpdb,randomtask1155/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,xuegang/gpdb,kmjungersen/PostgresXL,atris/gpdb,xuegang/gpdb,yuanzhao/gpdb,randomtask1155/gpdb,xinzweb/gpdb,cjcjameson/gpdb,Quikling/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,atris/gpdb,yuanzhao/gpdb,randomtask1155/gpdb,ahachete/gpdb,rvs/gpdb,edespino/gpdb,lisakowen/gpdb,atris/gpdb,kmjungersen/PostgresXL,cjcjameson/gpdb,ashwinstar/gpdb,rvs/gpdb,rubikloud/gpdb,0x0FFF/gpdb,tpostgres-projects/tPostgres,tpostgres-projects/tPostgres,atris/gpdb,rubikloud/gpdb,janebeckman/gpdb,Quikling/gpdb,CraigHarris/gpdb,foyzur/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,royc1/gpdb,Chibin/gpdb,ovr/postgres-xl,Chibin/gpdb,greenplum-db/gpdb,ahachete/gpdb,foyzur/gpdb,zaksoup/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,edespino/gpdb,kaknikhil/gpdb,edespino/gpdb,xuegang/gpdb,randomtask1155/gpdb,janebeckman/gpdb,CraigHarris/gpdb,rvs/gpdb,lisakowen/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,atris/gpdb,oberstet/postgres-xl,ahachete/gpdb,adam8157/gpdb,postmind-net/postgres-xl,cjcjameson/gpdb,tangp3/gpdb,greenplum-db/gpdb,Quikling/gpdb,greenplum-db/gpdb,foyzur/gpdb,zeroae/postgres-xl,janebeckman/gpdb,zaksoup/gpdb,adam8157/gpdb,rubikloud/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,ashwinstar/gpdb,zeroae/postgres-xl,royc1/gpdb,techdragon/Postgres-XL,tangp3/gpdb,foyzur/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,50wu/gpdb,janebeckman/gpdb,lintzc/gpdb,ahachete/gpdb,ashwinstar/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,lpetrov-pivotal/gpdb,chrishajas/gpdb,rvs/gpdb,Chibin/gpdb,techdragon/Postgres-XL,kmjungersen/PostgresXL,CraigHarris/gpdb,rvs/gpdb,CraigHarris/gpdb,randomtask1155/gpdb,lpetrov-pivotal/gpdb,kmjungersen/PostgresXL,oberstet/postgres-xl,foyzur/gpdb,lisakowen/gpdb,tangp3/gpdb,kaknikhil/gpdb,xuegang/gpdb,adam8157/gpdb,xinzweb/gpdb,rubikloud/gpdb,Quikling/gpdb,lintzc/gpdb,edespino/gpdb,xinzweb/gpdb,zaksoup/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,yazun/postgres-xl,zaksoup/gpdb,yazun/postgres-xl,yazun/postgres-xl,50wu/gpdb,oberstet/postgres-xl,arcivanov/postgres-xl,techdragon/Postgres-XL,lisakowen/gpdb,lintzc/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,zaksoup/gpdb,lisakowen/gpdb,lintzc/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,greenplum-db/gpdb,oberstet/postgres-xl,chrishajas/gpdb,Chibin/gpdb,ahachete/gpdb,rubikloud/gpdb,xinzweb/gpdb,pavanvd/postgres-xl,arcivanov/postgres-xl,rubikloud/gpdb,techdragon/Postgres-XL,rvs/gpdb,Chibin/gpdb,rvs/gpdb,ashwinstar/gpdb,50wu/gpdb,Quikling/gpdb,lpetrov-pivotal/gpdb,lisakowen/gpdb,foyzur/gpdb,jmcatamney/gpdb,50wu/gpdb,xuegang/gpdb,ahachete/gpdb,xuegang/gpdb,royc1/gpdb,rvs/gpdb,CraigHarris/gpdb,ashwinstar/gpdb,rubikloud/gpdb,CraigHarris/gpdb,adam8157/gpdb,ovr/postgres-xl,lintzc/gpdb,Chibin/gpdb,Quikling/gpdb,randomtask1155/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,edespino/gpdb,0x0FFF/gpdb,arcivanov/postgres-xl,rvs/gpdb,snaga/postgres-xl,royc1/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,tangp3/gpdb,50wu/gpdb,xinzweb/gpdb,cjcjameson/gpdb,Quikling/gpdb,pavanvd/postgres-xl,adam8157/gpdb,lintzc/gpdb,chrishajas/gpdb,xinzweb/gpdb,ovr/postgres-xl,Quikling/gpdb,kmjungersen/PostgresXL,tpostgres-projects/tPostgres,jmcatamney/gpdb,janebeckman/gpdb,CraigHarris/gpdb,yazun/postgres-xl,zaksoup/gpdb,ahachete/gpdb,0x0FFF/gpdb,rubikloud/gpdb,snaga/postgres-xl,jmcatamney/gpdb,janebeckman/gpdb,lpetrov-pivotal/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,rvs/gpdb,ovr/postgres-xl,arcivanov/postgres-xl,royc1/gpdb,chrishajas/gpdb,atris/gpdb,edespino/gpdb,kaknikhil/gpdb,xinzweb/gpdb,janebeckman/gpdb,janebeckman/gpdb,50wu/gpdb,arcivanov/postgres-xl,ahachete/gpdb,kaknikhil/gpdb,Postgres-XL/Postgres-XL,kaknikhil/gpdb,snaga/postgres-xl,edespino/gpdb,lisakowen/gpdb,yuanzhao/gpdb,tangp3/gpdb,pavanvd/postgres-xl,janebeckman/gpdb,lpetrov-pivotal/gpdb,pavanvd/postgres-xl,tangp3/gpdb,ovr/postgres-xl,chrishajas/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,yazun/postgres-xl,chrishajas/gpdb,ashwinstar/gpdb,50wu/gpdb,yuanzhao/gpdb,postmind-net/postgres-xl,snaga/postgres-xl,royc1/gpdb,zeroae/postgres-xl,xuegang/gpdb,Postgres-XL/Postgres-XL,0x0FFF/gpdb,royc1/gpdb,xinzweb/gpdb,randomtask1155/gpdb,snaga/postgres-xl,foyzur/gpdb,edespino/gpdb,edespino/gpdb,tangp3/gpdb,tpostgres-projects/tPostgres,foyzur/gpdb,jmcatamney/gpdb