Move isolation_multiuser_locking to MX tests

pull/5678/head
Onder Kalaci 2022-02-03 11:17:11 +01:00
parent bcb00e3318
commit 923bb194a4
4 changed files with 150 additions and 102 deletions

View File

@ -28,12 +28,19 @@ step s1-grant:
SET ROLE test_user_1; SET ROLE test_user_1;
SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2'); SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2');
GRANT ALL ON test_table TO test_user_2; GRANT ALL ON test_table TO test_user_2;
SELECT run_command_on_workers($$SET citus.enable_metadata_sync TO off; GRANT ALL ON test_table TO test_user_2;$$);
bool_and bool_and
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
run_command_on_workers
---------------------------------------------------------------------
(localhost,57637,t,SET)
(localhost,57638,t,SET)
(2 rows)
step s1-begin: step s1-begin:
BEGIN; BEGIN;
SET ROLE test_user_1; SET ROLE test_user_1;
@ -65,12 +72,19 @@ step s1-grant:
SET ROLE test_user_1; SET ROLE test_user_1;
SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2'); SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2');
GRANT ALL ON test_table TO test_user_2; GRANT ALL ON test_table TO test_user_2;
SELECT run_command_on_workers($$SET citus.enable_metadata_sync TO off; GRANT ALL ON test_table TO test_user_2;$$);
bool_and bool_and
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
run_command_on_workers
---------------------------------------------------------------------
(localhost,57637,t,SET)
(localhost,57638,t,SET)
(2 rows)
step s1-begin: step s1-begin:
BEGIN; BEGIN;
SET ROLE test_user_1; SET ROLE test_user_1;
@ -127,12 +141,19 @@ step s1-grant:
SET ROLE test_user_1; SET ROLE test_user_1;
SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2'); SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2');
GRANT ALL ON test_table TO test_user_2; GRANT ALL ON test_table TO test_user_2;
SELECT run_command_on_workers($$SET citus.enable_metadata_sync TO off; GRANT ALL ON test_table TO test_user_2;$$);
bool_and bool_and
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
run_command_on_workers
---------------------------------------------------------------------
(localhost,57637,t,SET)
(localhost,57638,t,SET)
(2 rows)
step s1-begin: step s1-begin:
BEGIN; BEGIN;
SET ROLE test_user_1; SET ROLE test_user_1;
@ -166,12 +187,19 @@ step s1-grant:
SET ROLE test_user_1; SET ROLE test_user_1;
SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2'); SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2');
GRANT ALL ON test_table TO test_user_2; GRANT ALL ON test_table TO test_user_2;
SELECT run_command_on_workers($$SET citus.enable_metadata_sync TO off; GRANT ALL ON test_table TO test_user_2;$$);
bool_and bool_and
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
run_command_on_workers
---------------------------------------------------------------------
(localhost,57637,t,SET)
(localhost,57638,t,SET)
(2 rows)
step s1-begin: step s1-begin:
BEGIN; BEGIN;
SET ROLE test_user_1; SET ROLE test_user_1;
@ -231,12 +259,19 @@ step s1-grant:
SET ROLE test_user_1; SET ROLE test_user_1;
SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2'); SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2');
GRANT ALL ON test_table TO test_user_2; GRANT ALL ON test_table TO test_user_2;
SELECT run_command_on_workers($$SET citus.enable_metadata_sync TO off; GRANT ALL ON test_table TO test_user_2;$$);
bool_and bool_and
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
run_command_on_workers
---------------------------------------------------------------------
(localhost,57637,t,SET)
(localhost,57638,t,SET)
(2 rows)
step s1-begin: step s1-begin:
BEGIN; BEGIN;
SET ROLE test_user_1; SET ROLE test_user_1;
@ -267,12 +302,19 @@ step s1-grant:
SET ROLE test_user_1; SET ROLE test_user_1;
SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2'); SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2');
GRANT ALL ON test_table TO test_user_2; GRANT ALL ON test_table TO test_user_2;
SELECT run_command_on_workers($$SET citus.enable_metadata_sync TO off; GRANT ALL ON test_table TO test_user_2;$$);
bool_and bool_and
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
run_command_on_workers
---------------------------------------------------------------------
(localhost,57637,t,SET)
(localhost,57638,t,SET)
(2 rows)
step s1-begin: step s1-begin:
BEGIN; BEGIN;
SET ROLE test_user_1; SET ROLE test_user_1;

View File

@ -103,8 +103,8 @@ step s2-view-worker:
query |query_hostname |query_hostport|distributed_query_host_name|distributed_query_host_port|state |wait_event_type|wait_event|usename |datname query |query_hostname |query_hostport|distributed_query_host_name|distributed_query_host_port|state |wait_event_type|wait_event|usename |datname
--------------------------------------------------------------------- ---------------------------------------------------------------------
UPDATE public.ref_table_1500767 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57638|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression UPDATE public.ref_table_1500803 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57638|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
UPDATE public.ref_table_1500767 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57637|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression UPDATE public.ref_table_1500803 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57637|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
(2 rows) (2 rows)
step s2-end: step s2-end:

View File

@ -89,6 +89,7 @@ test: isolation_ref_update_delete_upsert_vs_all_on_mx
test: isolation_dis2ref_foreign_keys_on_mx test: isolation_dis2ref_foreign_keys_on_mx
test: isolation_metadata_sync_deadlock test: isolation_metadata_sync_deadlock
test: isolation_replicated_dist_on_mx test: isolation_replicated_dist_on_mx
test: isolation_multiuser_locking
# MXless tests # MXless tests
test: isolation_check_mx test: isolation_check_mx
@ -96,4 +97,3 @@ test: isolation_replicate_reference_tables_to_coordinator
test: isolation_turn_mx_off test: isolation_turn_mx_off
test: isolation_reference_copy_vs_all test: isolation_reference_copy_vs_all
test: isolation_ref2ref_foreign_keys test: isolation_ref2ref_foreign_keys
test: isolation_multiuser_locking

View File

@ -1,5 +1,8 @@
setup setup
{ {
SELECT citus_internal.replace_isolation_tester_func();
SELECT citus_internal.refresh_isolation_tester_prepared_statement();
SET citus.shard_replication_factor TO 1; SET citus.shard_replication_factor TO 1;
CREATE USER test_user_1; CREATE USER test_user_1;
@ -16,6 +19,8 @@ setup
teardown teardown
{ {
SELECT citus_internal.restore_isolation_tester_func();
BEGIN; BEGIN;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
DROP USER test_user_1, test_user_2; DROP USER test_user_1, test_user_2;
@ -31,6 +36,7 @@ step "s1-grant"
SET ROLE test_user_1; SET ROLE test_user_1;
SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2'); SELECT bool_and(success) FROM run_command_on_placements('test_table', 'GRANT ALL ON TABLE %s TO test_user_2');
GRANT ALL ON test_table TO test_user_2; GRANT ALL ON test_table TO test_user_2;
SELECT run_command_on_workers($$SET citus.enable_metadata_sync TO off; GRANT ALL ON test_table TO test_user_2;$$);
} }
step "s1-begin" step "s1-begin"