resgroup: workaround a race condition on slot reuse.
resgroup: workaround a race condition on slot reuse.

A slot maybe reused on QE while its still using by another QE which
might causes runtime error. This issue exists for a long time in theory,
but the fail rate is enlarged with a current commit 8005f559.

To workaround the issue we change the free slot pool from a stack into a
queue, slots are allocated from the head and freed to the tail, so a
slot will not be reused immediately after being freed.

In worst case all the in-use slots are not freed in time on QEs, so we
also doubled the slot pool size to have enough free slots for new
queries even in such a worst case.

In any sense this is not a fix, just a quick workaround, we will keep
working on this race condition issue. Once a root fix is ready this
workaround will be replaced.
Chibin/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,edespino/gpdb,Chibin/gpdb,50wu/gpdb,adam8157/gpdb,xinzweb/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,adam8157/gpdb,jmcatamney/gpdb,lisakowen/gpdb,adam8157/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,edespino/gpdb,Chibin/gpdb,lisakowen/gpdb,adam8157/gpdb,yuanzhao/gpdb,Chibin/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ashwinstar/gpdb,lisakowen/gpdb,Chibin/gpdb,50wu/gpdb,lisakowen/gpdb,ashwinstar/gpdb,edespino/gpdb,yuanzhao/gpdb,lisakowen/gpdb,Chibin/gpdb,edespino/gpdb,adam8157/gpdb,lisakowen/gpdb,yuanzhao/gpdb,edespino/gpdb,yuanzhao/gpdb,edespino/gpdb,greenplum-db/gpdb,xinzweb/gpdb,edespino/gpdb,Chibin/gpdb,xinzweb/gpdb,ashwinstar/gpdb,50wu/gpdb,Chibin/gpdb,jmcatamney/gpdb,Chibin/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,lisakowen/gpdb,greenplum-db/gpdb,lisakowen/gpdb,50wu/gpdb,xinzweb/gpdb,Chibin/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,xinzweb/gpdb,adam8157/gpdb,yuanzhao/gpdb,edespino/gpdb,edespino/gpdb,50wu/gpdb,edespino/gpdb,yuanzhao/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,ashwinstar/gpdb,adam8157/gpdb,ashwinstar/gpdb