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: NPaul Guo <paulguo@gmail.com>
Showing
想要评论请 注册 或 登录