Reset evaluation plan tuple table next free slot counter to 0 after ExecEndNode. It must be done! Or we'll be out of free tuple slots very soon, though slots are freed by ExecEndNode and ready for reusing.
Reset evaluation plan tuple table next free slot counter to 0
after ExecEndNode. It must be done! Or we'll be out of free
tuple slots very soon, though slots are freed by ExecEndNode
and ready for reusing.

We didn't see this problem before because of

int         nSlots = ExecCountSlotsNode(plan);
TupleTable  tupleTable = ExecCreateTupleTable(nSlots + 10);
    /* why add ten? - jolly */

code in InitPlan - i.e. extra 10 slots. Simple select uses
3 slots and so it was possible to re-use evaluation plan
3 additional times and didn't get

elog(NOTICE, "Plan requires more slots than are available");
elog(ERROR, "send mail to your local executor guru to fix this");

Changes are obvious and shouldn't be problems with them.
Though, I added Assert(epqstate->es_tupleTable->next == 0)
before EvalPlanQual():ExecInitNode and we'll notice if
something is still wrong. Is it better to change Assert
to elog(ERROR) ?

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