diff --git a/src/test/regress/expected/isolation_multiuser_locking.out b/src/test/regress/expected/isolation_multiuser_locking.out index a667b5dfb..30f474b84 100644 --- a/src/test/regress/expected/isolation_multiuser_locking.out +++ b/src/test/regress/expected/isolation_multiuser_locking.out @@ -2,295 +2,337 @@ Parsed test spec with 2 sessions starting permutation: s1-begin s2-begin s2-reindex s1-insert s2-commit s1-commit step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s2-reindex: - REINDEX TABLE test_table; + REINDEX TABLE test_table; ERROR: must be owner of table test_table step s1-insert: - UPDATE test_table SET column2 = 1; + UPDATE test_table SET column2 = 1; step s2-commit: - COMMIT; + COMMIT; step s1-commit: - COMMIT; + COMMIT; starting permutation: s1-grant s1-begin s2-begin s2-reindex s1-insert s2-insert s2-commit s1-commit step s1-grant: - 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'); - GRANT ALL ON test_table TO test_user_2; + 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'); + 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 --------------------------------------------------------------------- t (1 row) +run_command_on_workers +--------------------------------------------------------------------- +(localhost,57637,t,SET) +(localhost,57638,t,SET) +(2 rows) + step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s2-reindex: - REINDEX TABLE test_table; + REINDEX TABLE test_table; ERROR: must be owner of table test_table step s1-insert: - UPDATE test_table SET column2 = 1; + UPDATE test_table SET column2 = 1; step s2-insert: - UPDATE test_table SET column2 = 2; + UPDATE test_table SET column2 = 2; ERROR: current transaction is aborted, commands ignored until end of transaction block step s2-commit: - COMMIT; + COMMIT; step s1-commit: - COMMIT; + COMMIT; starting permutation: s1-grant s1-begin s2-begin s1-reindex s2-insert s1-insert s1-commit s2-commit step s1-grant: - 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'); - GRANT ALL ON test_table TO test_user_2; + 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'); + 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 --------------------------------------------------------------------- t (1 row) +run_command_on_workers +--------------------------------------------------------------------- +(localhost,57637,t,SET) +(localhost,57638,t,SET) +(2 rows) + step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s1-reindex: - REINDEX TABLE test_table; + REINDEX TABLE test_table; step s2-insert: - UPDATE test_table SET column2 = 2; + UPDATE test_table SET column2 = 2; step s1-insert: - UPDATE test_table SET column2 = 1; + UPDATE test_table SET column2 = 1; step s1-commit: - COMMIT; + COMMIT; step s2-insert: <... completed> step s2-commit: - COMMIT; + COMMIT; starting permutation: s1-begin s2-begin s2-index s1-insert s2-commit s1-commit s2-drop-index step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s2-index: - CREATE INDEX test_index ON test_table(column1); + CREATE INDEX test_index ON test_table(column1); ERROR: must be owner of table test_table step s1-insert: - UPDATE test_table SET column2 = 1; + UPDATE test_table SET column2 = 1; step s2-commit: - COMMIT; + COMMIT; step s1-commit: - COMMIT; + COMMIT; step s2-drop-index: - DROP INDEX IF EXISTS test_index; + DROP INDEX IF EXISTS test_index; starting permutation: s1-grant s1-begin s2-begin s2-insert s1-index s2-insert s2-commit s1-commit s1-drop-index step s1-grant: - 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'); - GRANT ALL ON test_table TO test_user_2; + 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'); + 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 --------------------------------------------------------------------- t (1 row) +run_command_on_workers +--------------------------------------------------------------------- +(localhost,57637,t,SET) +(localhost,57638,t,SET) +(2 rows) + step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s2-insert: - UPDATE test_table SET column2 = 2; + UPDATE test_table SET column2 = 2; step s1-index: - CREATE INDEX test_index ON test_table(column1); + CREATE INDEX test_index ON test_table(column1); step s2-insert: - UPDATE test_table SET column2 = 2; + UPDATE test_table SET column2 = 2; step s2-commit: - COMMIT; + COMMIT; step s1-index: <... completed> step s1-commit: - COMMIT; + COMMIT; step s1-drop-index: - DROP INDEX IF EXISTS test_index; + DROP INDEX IF EXISTS test_index; starting permutation: s1-grant s1-begin s2-begin s1-index s2-index s1-insert s1-commit s2-commit s1-drop-index s2-drop-index step s1-grant: - 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'); - GRANT ALL ON test_table TO test_user_2; + 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'); + 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 --------------------------------------------------------------------- t (1 row) +run_command_on_workers +--------------------------------------------------------------------- +(localhost,57637,t,SET) +(localhost,57638,t,SET) +(2 rows) + step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s1-index: - CREATE INDEX test_index ON test_table(column1); + CREATE INDEX test_index ON test_table(column1); step s2-index: - CREATE INDEX test_index ON test_table(column1); + CREATE INDEX test_index ON test_table(column1); ERROR: must be owner of table test_table step s1-insert: - UPDATE test_table SET column2 = 1; + UPDATE test_table SET column2 = 1; step s1-commit: - COMMIT; + COMMIT; step s2-commit: - COMMIT; + COMMIT; step s1-drop-index: - DROP INDEX IF EXISTS test_index; + DROP INDEX IF EXISTS test_index; step s2-drop-index: - DROP INDEX IF EXISTS test_index; + DROP INDEX IF EXISTS test_index; starting permutation: s1-begin s2-begin s2-truncate s1-insert s2-commit s1-commit step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s2-truncate: - TRUNCATE test_table; + TRUNCATE test_table; ERROR: permission denied for table test_table step s1-insert: - UPDATE test_table SET column2 = 1; + UPDATE test_table SET column2 = 1; step s2-commit: - COMMIT; + COMMIT; step s1-commit: - COMMIT; + COMMIT; starting permutation: s1-grant s1-begin s2-begin s1-truncate s2-insert s1-insert s1-commit s2-commit step s1-grant: - 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'); - GRANT ALL ON test_table TO test_user_2; + 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'); + 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 --------------------------------------------------------------------- t (1 row) +run_command_on_workers +--------------------------------------------------------------------- +(localhost,57637,t,SET) +(localhost,57638,t,SET) +(2 rows) + step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s1-truncate: - TRUNCATE test_table; + TRUNCATE test_table; step s2-insert: - UPDATE test_table SET column2 = 2; + UPDATE test_table SET column2 = 2; step s1-insert: - UPDATE test_table SET column2 = 1; + UPDATE test_table SET column2 = 1; step s1-commit: - COMMIT; + COMMIT; step s2-insert: <... completed> step s2-commit: - COMMIT; + COMMIT; starting permutation: s1-grant s1-begin s2-begin s1-truncate s2-truncate s1-commit s2-commit step s1-grant: - 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'); - GRANT ALL ON test_table TO test_user_2; + 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'); + 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 --------------------------------------------------------------------- t (1 row) +run_command_on_workers +--------------------------------------------------------------------- +(localhost,57637,t,SET) +(localhost,57638,t,SET) +(2 rows) + step s1-begin: - BEGIN; - SET ROLE test_user_1; + BEGIN; + SET ROLE test_user_1; step s2-begin: - BEGIN; - SET ROLE test_user_2; + BEGIN; + SET ROLE test_user_2; step s1-truncate: - TRUNCATE test_table; + TRUNCATE test_table; step s2-truncate: - TRUNCATE test_table; + TRUNCATE test_table; step s1-commit: - COMMIT; + COMMIT; step s2-truncate: <... completed> step s2-commit: - COMMIT; + COMMIT; diff --git a/src/test/regress/expected/isolation_replicate_reference_tables_to_coordinator.out b/src/test/regress/expected/isolation_replicate_reference_tables_to_coordinator.out index d28a6b714..c012ef156 100644 --- a/src/test/regress/expected/isolation_replicate_reference_tables_to_coordinator.out +++ b/src/test/regress/expected/isolation_replicate_reference_tables_to_coordinator.out @@ -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 --------------------------------------------------------------------- -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_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 | 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 | 57637|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression (2 rows) step s2-end: diff --git a/src/test/regress/isolation_schedule b/src/test/regress/isolation_schedule index a2583034a..6108d3542 100644 --- a/src/test/regress/isolation_schedule +++ b/src/test/regress/isolation_schedule @@ -89,6 +89,7 @@ test: isolation_ref_update_delete_upsert_vs_all_on_mx test: isolation_dis2ref_foreign_keys_on_mx test: isolation_metadata_sync_deadlock test: isolation_replicated_dist_on_mx +test: isolation_multiuser_locking # MXless tests test: isolation_check_mx @@ -96,4 +97,3 @@ test: isolation_replicate_reference_tables_to_coordinator test: isolation_turn_mx_off test: isolation_reference_copy_vs_all test: isolation_ref2ref_foreign_keys -test: isolation_multiuser_locking diff --git a/src/test/regress/spec/isolation_multiuser_locking.spec b/src/test/regress/spec/isolation_multiuser_locking.spec index 3c5193e96..8303e9459 100644 --- a/src/test/regress/spec/isolation_multiuser_locking.spec +++ b/src/test/regress/spec/isolation_multiuser_locking.spec @@ -1,5 +1,8 @@ setup { + SELECT citus_internal.replace_isolation_tester_func(); + SELECT citus_internal.refresh_isolation_tester_prepared_statement(); + SET citus.shard_replication_factor TO 1; CREATE USER test_user_1; @@ -16,6 +19,8 @@ setup teardown { + SELECT citus_internal.restore_isolation_tester_func(); + BEGIN; DROP TABLE IF EXISTS test_table; DROP USER test_user_1, test_user_2; @@ -31,6 +36,7 @@ step "s1-grant" 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'); 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"