Fix flaky test: refresh matview should use 2pc commit. (#10028)
Fix flaky test: refresh matview should use 2pc commit. (#10028)

* Fix flake test: refresh matview should use 2pc commit.

We have a refresh matview with unique index check test case
CREATE TABLE mvtest_foo(a, b) AS VALUES(1, 10);
CREATE MATERIALIZED VIEW mvtest_mv AS SELECT * FROM mvtest_foo distributed by(a);
CREATE UNIQUE INDEX ON mvtest_mv(a);
INSERT INTO mvtest_foo SELECT * FROM mvtest_foo;
REFRESH MATERIALIZED VIEW mvtest_mv;

Only one segment contains tuples and will failed the unique index
check. Without 2pc, other segemnts will just commit transaction
successfully. Since one segment errors out, QD will send cancel
signal to all the segments, and if these segments have not finished
the commit process, it will report the warning:
DETAIL: The transaction has already changed locally,
it has to be replicated to standby.

Reviewed-by: Paul Guo <5eeb21dad1e8468758bca14acd60e8629b8a7f4b@gmail.com>
jmcatamney/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,50wu/gpdb,lisakowen/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,lisakowen/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,lisakowen/gpdb,adam8157/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,xinzweb/gpdb,50wu/gpdb,adam8157/gpdb,50wu/gpdb,jmcatamney/gpdb,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,50wu/gpdb,jmcatamney/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,adam8157/gpdb,adam8157/gpdb,greenplum-db/gpdb,adam8157/gpdb,greenplum-db/gpdb,lisakowen/gpdb,jmcatamney/gpdb,lisakowen/gpdb