Fix cdb_sequence_nextval_qe if connection is terminated (#8941)
Fix cdb_sequence_nextval_qe if connection is terminated (#8941)

Fix an assert failure in cdb_sequence_nextval_qe().
When QE wants to wait a message from QD to allocate the next value,
it might receive a message with type 'X', which QD notifies QE to terminate.
Message with type 'X' is valid. So, cdb_sequence_nextval_qe should
handle it correctly.
No test for this commit. Because we need to register a fault injector in
cdb_sequence_nextval_qe() to suspend the execution of the QE process,
and later we want to resume the execution of cdb_sequence_nextval_qe()
by reset the registered fault inject. It works in normal cases. But we
need to kill the postmaster of the blocked QE process between suspending
the QE and resuming the QE. Resuming of the blocked QE failed because of
the postmaster of the QE is dead.

Co-authored-by: Paul Guo <e78f8a884cebd97fb3b249dc32d233761d2e480a@pivotal.io>
Reviewed-by: Ning Yu <1ef20c7bf83cc456c790d6afa040b63811531869@pivotal.io>

50wu/gpdb,lisakowen/gpdb,50wu/gpdb,lisakowen/gpdb,lisakowen/gpdb,lisakowen/gpdb,adam8157/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,lisakowen/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,adam8157/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,xinzweb/gpdb,xinzweb/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,xinzweb/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,xinzweb/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,50wu/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,adam8157/gpdb,jmcatamney/gpdb,adam8157/gpdb,xinzweb/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ashwinstar/gpdb,greenplum-db/gpdb