mirror of https://github.com/citusdata/citus.git
Merge remote-tracking branch 'origin' into users/saawasek/non_blocking_split_integrated
commit
56333ec328
|
@ -439,9 +439,18 @@ PreprocessAlterTableStmtAttachPartition(AlterTableStmt *alterTableStatement,
|
||||||
Oid parentRelationId = AlterTableLookupRelation(alterTableStatement,
|
Oid parentRelationId = AlterTableLookupRelation(alterTableStatement,
|
||||||
lockmode);
|
lockmode);
|
||||||
PartitionCmd *partitionCommand = (PartitionCmd *) alterTableCommand->def;
|
PartitionCmd *partitionCommand = (PartitionCmd *) alterTableCommand->def;
|
||||||
bool partitionMissingOk = false;
|
bool partitionMissingOk = true;
|
||||||
Oid partitionRelationId = RangeVarGetRelid(partitionCommand->name, lockmode,
|
Oid partitionRelationId = RangeVarGetRelid(partitionCommand->name, lockmode,
|
||||||
partitionMissingOk);
|
partitionMissingOk);
|
||||||
|
if (!OidIsValid(partitionRelationId))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* We can stop propagation here instead of logging error. Pg will complain
|
||||||
|
* in standard_utility, so we are safe to stop here. We pass missing_ok
|
||||||
|
* as true to not diverge from pg output.
|
||||||
|
*/
|
||||||
|
return NIL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsCitusTable(parentRelationId))
|
if (!IsCitusTable(parentRelationId))
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@ NOTICE: schema "distributed_triggers" does not exist, skipping
|
||||||
CREATE SCHEMA distributed_triggers;
|
CREATE SCHEMA distributed_triggers;
|
||||||
SET search_path TO 'distributed_triggers';
|
SET search_path TO 'distributed_triggers';
|
||||||
SET citus.shard_replication_factor = 1;
|
SET citus.shard_replication_factor = 1;
|
||||||
SET citus.shard_count = 32;
|
|
||||||
SET citus.next_shard_id TO 800000;
|
SET citus.next_shard_id TO 800000;
|
||||||
--
|
--
|
||||||
-- Test citus.enable_unsafe_triggers
|
-- Test citus.enable_unsafe_triggers
|
||||||
|
@ -211,8 +210,8 @@ SELECT tgrelid::regclass::text, tgname FROM pg_trigger WHERE tgname like 'record
|
||||||
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'record_change_trigger%';$$);
|
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'record_change_trigger%';$$);
|
||||||
run_command_on_workers
|
run_command_on_workers
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,t,17)
|
(localhost,57637,t,3)
|
||||||
(localhost,57638,t,17)
|
(localhost,57638,t,3)
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
ALTER TRIGGER "record_change_trigger" ON "distributed_triggers"."data" RENAME TO "new_record_change_trigger";
|
ALTER TRIGGER "record_change_trigger" ON "distributed_triggers"."data" RENAME TO "new_record_change_trigger";
|
||||||
|
@ -237,8 +236,8 @@ SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname lik
|
||||||
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'new_record_change_trigger%';$$);
|
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'new_record_change_trigger%';$$);
|
||||||
run_command_on_workers
|
run_command_on_workers
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,t,17)
|
(localhost,57637,t,3)
|
||||||
(localhost,57638,t,17)
|
(localhost,57638,t,3)
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
--This should fail
|
--This should fail
|
||||||
|
@ -505,7 +504,7 @@ $rec_audit$ LANGUAGE plpgsql;
|
||||||
CREATE TRIGGER record_emp_trig
|
CREATE TRIGGER record_emp_trig
|
||||||
AFTER INSERT OR UPDATE OR DELETE ON emptest
|
AFTER INSERT OR UPDATE OR DELETE ON emptest
|
||||||
FOR EACH STATEMENT EXECUTE FUNCTION distributed_triggers.record_emp();
|
FOR EACH STATEMENT EXECUTE FUNCTION distributed_triggers.record_emp();
|
||||||
INSERT INTO emptest VALUES ('test5', 1);
|
INSERT INTO emptest VALUES ('test6', 1);
|
||||||
ERROR: cannot execute a distributed query from a query on a shard
|
ERROR: cannot execute a distributed query from a query on a shard
|
||||||
DETAIL: Executing a distributed query in a function call that may be pushed to a remote node can lead to incorrect results.
|
DETAIL: Executing a distributed query in a function call that may be pushed to a remote node can lead to incorrect results.
|
||||||
HINT: Avoid nesting of distributed queries or use alter user current_user set citus.allow_nested_distributed_execution to on to allow it with possible incorrectness.
|
HINT: Avoid nesting of distributed queries or use alter user current_user set citus.allow_nested_distributed_execution to on to allow it with possible incorrectness.
|
||||||
|
@ -776,48 +775,6 @@ NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
|
||||||
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
NOTICE: Moving shard xxxxx from localhost:xxxxx to localhost:xxxxx ...
|
||||||
master_drain_node
|
master_drain_node
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
@ -862,7 +819,7 @@ SELECT tgrelid::regclass::text, tgname FROM pg_trigger WHERE tgname like 'insert
|
||||||
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'insert_99_trigger%'$$);
|
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'insert_99_trigger%'$$);
|
||||||
run_command_on_workers
|
run_command_on_workers
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,t,33)
|
(localhost,57637,t,5)
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
INSERT INTO distributed_table VALUES (99);
|
INSERT INTO distributed_table VALUES (99);
|
||||||
|
@ -898,7 +855,7 @@ SELECT tgrelid::regclass::text, tgname FROM pg_trigger WHERE tgname like 'insert
|
||||||
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'insert_99_trigger%'$$);
|
SELECT run_command_on_workers($$SELECT count(*) FROM pg_trigger WHERE tgname like 'insert_99_trigger%'$$);
|
||||||
run_command_on_workers
|
run_command_on_workers
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,t,33)
|
(localhost,57637,t,5)
|
||||||
(localhost,57638,t,1)
|
(localhost,57638,t,1)
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ DROP SCHEMA IF EXISTS distributed_triggers CASCADE;
|
||||||
CREATE SCHEMA distributed_triggers;
|
CREATE SCHEMA distributed_triggers;
|
||||||
SET search_path TO 'distributed_triggers';
|
SET search_path TO 'distributed_triggers';
|
||||||
SET citus.shard_replication_factor = 1;
|
SET citus.shard_replication_factor = 1;
|
||||||
SET citus.shard_count = 32;
|
|
||||||
SET citus.next_shard_id TO 800000;
|
SET citus.next_shard_id TO 800000;
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -302,7 +301,7 @@ CREATE TRIGGER record_emp_trig
|
||||||
AFTER INSERT OR UPDATE OR DELETE ON emptest
|
AFTER INSERT OR UPDATE OR DELETE ON emptest
|
||||||
FOR EACH STATEMENT EXECUTE FUNCTION distributed_triggers.record_emp();
|
FOR EACH STATEMENT EXECUTE FUNCTION distributed_triggers.record_emp();
|
||||||
|
|
||||||
INSERT INTO emptest VALUES ('test5', 1);
|
INSERT INTO emptest VALUES ('test6', 1);
|
||||||
DELETE FROM emptest;
|
DELETE FROM emptest;
|
||||||
SELECT * FROM emptest;
|
SELECT * FROM emptest;
|
||||||
SELECT operation_type FROM record_op;
|
SELECT operation_type FROM record_op;
|
||||||
|
|
Loading…
Reference in New Issue