提交 ecce73e4 编写于 作者: H Heikki Linnakangas

Also dispatch "SET CONSTRAINTS ALL IMMEDIATE" to segments.

I overlooked that these errors were thrown at wrong place, after COMMIT,
because of the difference in the error message.
上级 cb53595f
......@@ -4245,14 +4245,14 @@ AfterTriggerSetState(ConstraintsSetStmt *stmt)
else
{
/* no snapshot needed */
if (Gp_role == GP_ROLE_DISPATCH)
{
CdbDispatchUtilityStatement((Node *) stmt,
DF_CANCEL_ON_ERROR|
DF_NEED_TWO_PHASE,
NIL,
NULL);
}
}
if (Gp_role == GP_ROLE_DISPATCH)
{
CdbDispatchUtilityStatement((Node *) stmt,
DF_CANCEL_ON_ERROR|
DF_NEED_TWO_PHASE,
NIL,
NULL);
}
}
......
......@@ -497,19 +497,17 @@ ERROR: The distributed transaction 'Prepare' broadcast failed to one or more se
BEGIN;
SET CONSTRAINTS ALL IMMEDIATE;
INSERT INTO unique_tbl VALUES (3, 'Three'); -- should fail
ERROR: duplicate key value violates unique constraint "unique_tbl_i_key"
DETAIL: Key (i)=(3) already exists.
COMMIT;
WARNING: the distributed transaction 'Abort [Prepared]' broadcast failed to one or more segments for gid = 1517942707-0000000738. Retrying ... try 0
NOTICE: Releasing segworker groups to retry broadcast.
ERROR: The distributed transaction 'Prepare' broadcast failed to one or more segments for gid = 1517942707-0000000738. (cdbtm.c:692)
-- forced check when SET CONSTRAINTS is called
BEGIN;
SET CONSTRAINTS ALL DEFERRED;
INSERT INTO unique_tbl VALUES (3, 'Three'); -- should succeed for now
SET CONSTRAINTS ALL IMMEDIATE; -- should fail
ERROR: duplicate key value violates unique constraint "unique_tbl_i_key"
DETAIL: Key (i)=(3) already exists.
COMMIT;
WARNING: the distributed transaction 'Abort [Prepared]' broadcast failed to one or more segments for gid = 1517942707-0000000739. Retrying ... try 0
NOTICE: Releasing segworker groups to retry broadcast.
ERROR: The distributed transaction 'Prepare' broadcast failed to one or more segments for gid = 1517942707-0000000739. (cdbtm.c:692)
-- test a HOT update that invalidates the conflicting tuple.
-- the trigger should still fire and catch the violation
BEGIN;
......
......@@ -497,19 +497,17 @@ ERROR: The distributed transaction 'Prepare' broadcast failed to one or more se
BEGIN;
SET CONSTRAINTS ALL IMMEDIATE;
INSERT INTO unique_tbl VALUES (3, 'Three'); -- should fail
ERROR: duplicate key value violates unique constraint "unique_tbl_i_key"
DETAIL: Key (i)=(3) already exists.
COMMIT;
WARNING: the distributed transaction 'Abort [Prepared]' broadcast failed to one or more segments for gid = 1517942707-0000000738. Retrying ... try 0
NOTICE: Releasing segworker groups to retry broadcast.
ERROR: The distributed transaction 'Prepare' broadcast failed to one or more segments for gid = 1517942707-0000000738. (cdbtm.c:692)
-- forced check when SET CONSTRAINTS is called
BEGIN;
SET CONSTRAINTS ALL DEFERRED;
INSERT INTO unique_tbl VALUES (3, 'Three'); -- should succeed for now
SET CONSTRAINTS ALL IMMEDIATE; -- should fail
ERROR: duplicate key value violates unique constraint "unique_tbl_i_key"
DETAIL: Key (i)=(3) already exists.
COMMIT;
WARNING: the distributed transaction 'Abort [Prepared]' broadcast failed to one or more segments for gid = 1517942707-0000000739. Retrying ... try 0
NOTICE: Releasing segworker groups to retry broadcast.
ERROR: The distributed transaction 'Prepare' broadcast failed to one or more segments for gid = 1517942707-0000000739. (cdbtm.c:692)
-- test a HOT update that invalidates the conflicting tuple.
-- the trigger should still fire and catch the violation
BEGIN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册