From 2fec02c3017f649e74469cbf55d7cecf2c970b6a Mon Sep 17 00:00:00 2001 From: gindibay Date: Sun, 26 Nov 2023 19:26:26 +0300 Subject: [PATCH] Fixes test flakyness --- src/test/regress/expected/reassign_owned.out | 216 +------------------ src/test/regress/sql/reassign_owned.sql | 16 +- 2 files changed, 18 insertions(+), 214 deletions(-) diff --git a/src/test/regress/expected/reassign_owned.out b/src/test/regress/expected/reassign_owned.out index 63a7928b4..3c6a0ee09 100644 --- a/src/test/regress/expected/reassign_owned.out +++ b/src/test/regress/expected/reassign_owned.out @@ -68,10 +68,11 @@ SELECT result from run_command_on_all_nodes( schemaname, tablename, tableowner -FROM + FROM pg_tables -WHERE + WHERE tablename in ('test_table', 'test_table2') + ORDER BY tablename ) q2 $$ ) ORDER BY result; @@ -120,220 +121,23 @@ SELECT result from run_command_on_all_nodes( schemaname, tablename, tableowner -FROM - pg_tables -WHERE - tablename in ('test_table3', 'test_table4') + FROM + pg_tables + WHERE + tablename in ('test_table3', 'test_table4') + ORDER BY tablename ) q2 $$ ) ORDER BY result; result --------------------------------------------------------------------- [{"tablename": "test_table3", "schemaname": "public", "tableowner": "local_target_role1"}, {"tablename": "test_table4", "schemaname": "public", "tableowner": "local_target_role1"}] - [{"tablename": "test_table4", "schemaname": "public", "tableowner": "local_target_role1"}, {"tablename": "test_table3", "schemaname": "public", "tableowner": "local_target_role1"}] - [{"tablename": "test_table4", "schemaname": "public", "tableowner": "local_target_role1"}, {"tablename": "test_table3", "schemaname": "public", "tableowner": "local_target_role1"}] + [{"tablename": "test_table3", "schemaname": "public", "tableowner": "local_target_role1"}, {"tablename": "test_table4", "schemaname": "public", "tableowner": "local_target_role1"}] + [{"tablename": "test_table3", "schemaname": "public", "tableowner": "local_target_role1"}, {"tablename": "test_table4", "schemaname": "public", "tableowner": "local_target_role1"}] (3 rows) --clear resources -SET citus.log_remote_commands = true; DROP OWNED BY distributed_source_role1, "distributed_source_role-\!",distributed_target_role1,local_target_role1; -NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx'); -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx'); -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table2') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table2') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table2_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table3') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table3') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table3_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table4') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT worker_drop_distributed_table('public.test_table4') -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing DROP TABLE IF EXISTS public.test_table4_xxxxx CASCADE -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name, drop_shards_metadata_only := false)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(1390004) -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_partition_metadata(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SELECT pg_catalog.citus_internal_delete_colocation_metadata(1390004) -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -CONTEXT: SQL statement "SELECT master_remove_partition_metadata(v_obj.objid, v_obj.schema_name, v_obj.object_name)" -PL/pgSQL function citus_drop_trigger() line XX at PERFORM -NOTICE: issuing SET citus.enable_ddl_propagation TO 'off' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing SET citus.enable_ddl_propagation TO 'off' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing DROP OWNED BY distributed_source_role1, "distributed_source_role-\!", distributed_target_role1, local_target_role1 RESTRICT -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing DROP OWNED BY distributed_source_role1, "distributed_source_role-\!", distributed_target_role1, local_target_role1 RESTRICT -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing SET citus.enable_ddl_propagation TO 'on' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing SET citus.enable_ddl_propagation TO 'on' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing PREPARE TRANSACTION 'citus_xx_xx_xx_xx' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing PREPARE TRANSACTION 'citus_xx_xx_xx_xx' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing COMMIT PREPARED 'citus_xx_xx_xx_xx' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -NOTICE: issuing COMMIT PREPARED 'citus_xx_xx_xx_xx' -DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx -reset citus.log_remote_commands; SELECT result from run_command_on_all_nodes( $$ SELECT jsonb_agg(to_jsonb(q2.*)) FROM ( diff --git a/src/test/regress/sql/reassign_owned.sql b/src/test/regress/sql/reassign_owned.sql index 328a74459..235ae2c12 100644 --- a/src/test/regress/sql/reassign_owned.sql +++ b/src/test/regress/sql/reassign_owned.sql @@ -53,10 +53,11 @@ SELECT result from run_command_on_all_nodes( schemaname, tablename, tableowner -FROM + FROM pg_tables -WHERE + WHERE tablename in ('test_table', 'test_table2') + ORDER BY tablename ) q2 $$ ) ORDER BY result; @@ -88,18 +89,17 @@ SELECT result from run_command_on_all_nodes( schemaname, tablename, tableowner -FROM - pg_tables -WHERE - tablename in ('test_table3', 'test_table4') + FROM + pg_tables + WHERE + tablename in ('test_table3', 'test_table4') + ORDER BY tablename ) q2 $$ ) ORDER BY result; --clear resources -SET citus.log_remote_commands = true; DROP OWNED BY distributed_source_role1, "distributed_source_role-\!",distributed_target_role1,local_target_role1; -reset citus.log_remote_commands; SELECT result from run_command_on_all_nodes( $$