mirror of https://github.com/citusdata/citus.git
Merge pull request #3604 from citusdata/prevent_worker_mx_create_dist_f
Prevent create_distributed_function() from the workerspull/3605/head^2
commit
f7f0fff304
|
@ -148,6 +148,7 @@ create_distributed_function(PG_FUNCTION_ARGS)
|
|||
colocateWithTableName = text_to_cstring(colocateWithText);
|
||||
}
|
||||
|
||||
EnsureCoordinator();
|
||||
EnsureFunctionOwner(funcOid);
|
||||
|
||||
ObjectAddressSet(functionAddress, ProcedureRelationId, funcOid);
|
||||
|
|
|
@ -692,6 +692,14 @@ DEBUG: pushing down the function call
|
|||
28
|
||||
(1 row)
|
||||
|
||||
\c - - - :worker_1_port
|
||||
SET search_path TO multi_mx_function_call_delegation, public;
|
||||
-- create_distributed_function is disallowed from worker nodes
|
||||
select create_distributed_function('mx_call_func(int,int)');
|
||||
ERROR: operation is not allowed on this node
|
||||
HINT: Connect to the coordinator and run it again.
|
||||
\c - - - :master_port
|
||||
SET search_path TO multi_mx_function_call_delegation, public;
|
||||
RESET client_min_messages;
|
||||
\set VERBOSITY terse
|
||||
DROP SCHEMA multi_mx_function_call_delegation CASCADE;
|
||||
|
|
|
@ -83,6 +83,7 @@ select create_distributed_function('mx_call_func_bigint(bigint,bigint)');
|
|||
select create_distributed_function('mx_call_func_custom_types(mx_call_enum,mx_call_enum)');
|
||||
select create_distributed_function('squares(int)');
|
||||
|
||||
|
||||
-- We still don't route them to the workers, because they aren't
|
||||
-- colocated with any distributed tables.
|
||||
SET client_min_messages TO DEBUG1;
|
||||
|
@ -259,6 +260,14 @@ EXECUTE call_plan(2, 0);
|
|||
EXECUTE call_plan(2, 0);
|
||||
EXECUTE call_plan(2, 0);
|
||||
|
||||
\c - - - :worker_1_port
|
||||
SET search_path TO multi_mx_function_call_delegation, public;
|
||||
-- create_distributed_function is disallowed from worker nodes
|
||||
select create_distributed_function('mx_call_func(int,int)');
|
||||
|
||||
\c - - - :master_port
|
||||
SET search_path TO multi_mx_function_call_delegation, public;
|
||||
|
||||
RESET client_min_messages;
|
||||
\set VERBOSITY terse
|
||||
DROP SCHEMA multi_mx_function_call_delegation CASCADE;
|
||||
|
|
Loading…
Reference in New Issue