From d7f09f72dafc7c57255a6b19d15eff0cdbd1cef4 Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Thu, 15 Feb 2024 15:53:56 +0300 Subject: [PATCH] and one more --- .../expected/failure_create_database.out | 29 +++++++++++++++++++ .../regress/sql/failure_create_database.sql | 8 +++++ 2 files changed, 37 insertions(+) diff --git a/src/test/regress/expected/failure_create_database.out b/src/test/regress/expected/failure_create_database.out index a853ebe28..c761267d6 100644 --- a/src/test/regress/expected/failure_create_database.out +++ b/src/test/regress/expected/failure_create_database.out @@ -240,4 +240,33 @@ SELECT * FROM public.check_database_on_all_nodes($$db1$$) ORDER BY node_type, re worker node (remote) | {"database_properties": null, "pg_dist_object_record_for_db_exists": false, "stale_pg_dist_object_record_for_a_db_exists": false} (2 rows) +SELECT citus.mitmproxy('conn.onParse(query="^WITH distributed_object_data").kill()'); + mitmproxy +--------------------------------------------------------------------- + +(1 row) + +CREATE DATABASE db1; +ERROR: connection not open +CONTEXT: while executing command on localhost:xxxxx +SELECT citus.mitmproxy('conn.allow()'); + mitmproxy +--------------------------------------------------------------------- + +(1 row) + +CALL citus_cleanup_orphaned_resources(); +SELECT bool_and(result::boolean) AS no_temp_databases_on_any_nodes FROM run_command_on_all_nodes($$SELECT COUNT(*)=0 FROM pg_database WHERE datname LIKE 'citus_temp_database_%'$$); + no_temp_databases_on_any_nodes +--------------------------------------------------------------------- + t +(1 row) + +SELECT * FROM public.check_database_on_all_nodes($$db1$$) ORDER BY node_type, result; + node_type | result +--------------------------------------------------------------------- + worker node (remote) | {"database_properties": null, "pg_dist_object_record_for_db_exists": false, "stale_pg_dist_object_record_for_a_db_exists": false} + worker node (remote) | {"database_properties": null, "pg_dist_object_record_for_db_exists": false, "stale_pg_dist_object_record_for_a_db_exists": false} +(2 rows) + RESET client_min_messages; diff --git a/src/test/regress/sql/failure_create_database.sql b/src/test/regress/sql/failure_create_database.sql index 72b5e1caf..0f47a82af 100644 --- a/src/test/regress/sql/failure_create_database.sql +++ b/src/test/regress/sql/failure_create_database.sql @@ -68,4 +68,12 @@ CALL citus_cleanup_orphaned_resources(); SELECT bool_and(result::boolean) AS no_temp_databases_on_any_nodes FROM run_command_on_all_nodes($$SELECT COUNT(*)=0 FROM pg_database WHERE datname LIKE 'citus_temp_database_%'$$); SELECT * FROM public.check_database_on_all_nodes($$db1$$) ORDER BY node_type, result; +SELECT citus.mitmproxy('conn.onParse(query="^WITH distributed_object_data").kill()'); +CREATE DATABASE db1; +SELECT citus.mitmproxy('conn.allow()'); + +CALL citus_cleanup_orphaned_resources(); +SELECT bool_and(result::boolean) AS no_temp_databases_on_any_nodes FROM run_command_on_all_nodes($$SELECT COUNT(*)=0 FROM pg_database WHERE datname LIKE 'citus_temp_database_%'$$); +SELECT * FROM public.check_database_on_all_nodes($$db1$$) ORDER BY node_type, result; + RESET client_min_messages;