From 2789d45e9a5ee4713193cf7ea51ae0d71284af9f Mon Sep 17 00:00:00 2001 From: Burak Velioglu Date: Thu, 13 Jan 2022 16:41:33 +0300 Subject: [PATCH] Fix failure test --- .../expected/failure_mx_metadata_sync.out | 71 +++---------------- .../regress/sql/failure_mx_metadata_sync.sql | 20 ++---- 2 files changed, 16 insertions(+), 75 deletions(-) diff --git a/src/test/regress/expected/failure_mx_metadata_sync.out b/src/test/regress/expected/failure_mx_metadata_sync.out index f3856410a..93582eee5 100644 --- a/src/test/regress/expected/failure_mx_metadata_sync.out +++ b/src/test/regress/expected/failure_mx_metadata_sync.out @@ -42,7 +42,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^UPDATE pg_dist_local_group SET grou (1 row) -SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); +SELECT citus_activate_node('localhost', :worker_2_proxy_port); ERROR: canceling statement due to user request SELECT citus.mitmproxy('conn.onQuery(query="^UPDATE pg_dist_local_group SET groupid").kill()'); mitmproxy @@ -50,7 +50,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^UPDATE pg_dist_local_group SET grou (1 row) -SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); +SELECT citus_activate_node('localhost', :worker_2_proxy_port); ERROR: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. @@ -62,7 +62,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^SELECT worker_drop_distributed_tabl (1 row) -SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); +SELECT citus_activate_node('localhost', :worker_2_proxy_port); ERROR: canceling statement due to user request SELECT citus.mitmproxy('conn.onQuery(query="^SELECT worker_drop_distributed_table").kill()'); mitmproxy @@ -70,7 +70,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^SELECT worker_drop_distributed_tabl (1 row) -SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); +SELECT citus_activate_node('localhost', :worker_2_proxy_port); ERROR: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. @@ -122,17 +122,17 @@ SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port; f (1 row) --- Verify we can sync metadata after unsuccessful attempts +-- Verify we can activate node after unsuccessful attempts SELECT citus.mitmproxy('conn.allow()'); mitmproxy --------------------------------------------------------------------- (1 row) -SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); - start_metadata_sync_to_node +SELECT citus_activate_node('localhost', :worker_2_proxy_port); + citus_activate_node --------------------------------------------------------------------- - + 4 (1 row) SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port; @@ -224,59 +224,6 @@ CONTEXT: while executing command on localhost:xxxxx (1 row) --- Failure to drop all tables in pg_dist_partition -SELECT citus.mitmproxy('conn.onQuery(query="^SELECT worker_drop_distributed_table").cancel(' || :pid || ')'); - mitmproxy ---------------------------------------------------------------------- - -(1 row) - -SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); -NOTICE: dropping metadata on the node (localhost,9060) -ERROR: canceling statement due to user request -SELECT citus.mitmproxy('conn.onQuery(query="^SELECT worker_drop_distributed_table").kill()'); - mitmproxy ---------------------------------------------------------------------- - -(1 row) - -SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); -NOTICE: dropping metadata on the node (localhost,9060) -WARNING: server closed the connection unexpectedly - This probably means the server terminated abnormally - before or while processing the request. -CONTEXT: while executing command on localhost:xxxxx -WARNING: server closed the connection unexpectedly - This probably means the server terminated abnormally - before or while processing the request. -connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: server closed the connection unexpectedly - This probably means the server terminated abnormally - before or while processing the request. -connection not open -connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: server closed the connection unexpectedly - This probably means the server terminated abnormally - before or while processing the request. -connection not open -connection not open -connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: server closed the connection unexpectedly - This probably means the server terminated abnormally - before or while processing the request. -connection not open -connection not open -connection not open -connection not open -CONTEXT: while executing command on localhost:xxxxx - stop_metadata_sync_to_node ---------------------------------------------------------------------- - -(1 row) - -- Failure to truncate pg_dist_node in the worker SELECT citus.mitmproxy('conn.onQuery(query="^TRUNCATE pg_dist_node CASCADE").cancel(' || :pid || ')'); mitmproxy @@ -344,7 +291,7 @@ SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port; f (1 row) --- Verify we can drop metadata after unsuccessful attempts +-- Verify we can stop metadata sync after unsuccessful attempts SELECT citus.mitmproxy('conn.allow()'); mitmproxy --------------------------------------------------------------------- diff --git a/src/test/regress/sql/failure_mx_metadata_sync.sql b/src/test/regress/sql/failure_mx_metadata_sync.sql index 16fcb8dad..fc9bc1f4f 100644 --- a/src/test/regress/sql/failure_mx_metadata_sync.sql +++ b/src/test/regress/sql/failure_mx_metadata_sync.sql @@ -32,20 +32,20 @@ SELECT citus_activate_node('localhost', :worker_2_proxy_port); -- Failure to truncate pg_dist_node in the worker SELECT citus.mitmproxy('conn.onQuery(query="^TRUNCATE pg_dist_node CASCADE").cancel(' || :pid || ')'); -SELECT citus_activate_node('localhost', :worker_2_proxy_port); +SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); SELECT citus.mitmproxy('conn.onQuery(query="^TRUNCATE pg_dist_node CASCADE").kill()'); -SELECT citus_activate_node('localhost', :worker_2_proxy_port); +SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); -- Failure to populate pg_dist_node in the worker SELECT citus.mitmproxy('conn.onQuery(query="^INSERT INTO pg_dist_node").cancel(' || :pid || ')'); -SELECT citus_activate_node('localhost', :worker_2_proxy_port); +SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); SELECT citus.mitmproxy('conn.onQuery(query="^INSERT INTO pg_dist_node").kill()'); -SELECT citus_activate_node('localhost', :worker_2_proxy_port); +SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); -- Verify that coordinator knows worker does not have valid metadata SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port; --- Verify we can sync metadata after unsuccessful attempts +-- Verify we can activate node after unsuccessful attempts SELECT citus.mitmproxy('conn.allow()'); SELECT citus_activate_node('localhost', :worker_2_proxy_port); SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port; @@ -70,12 +70,6 @@ SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); SELECT citus.mitmproxy('conn.onQuery(query="^UPDATE pg_dist_local_group SET groupid").kill()'); SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); --- Failure to drop all tables in pg_dist_partition -SELECT citus.mitmproxy('conn.onQuery(query="^SELECT worker_drop_distributed_table").cancel(' || :pid || ')'); -SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); -SELECT citus.mitmproxy('conn.onQuery(query="^SELECT worker_drop_distributed_table").kill()'); -SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); - -- Failure to truncate pg_dist_node in the worker SELECT citus.mitmproxy('conn.onQuery(query="^TRUNCATE pg_dist_node CASCADE").cancel(' || :pid || ')'); SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); @@ -87,7 +81,7 @@ SELECT count(*) FROM pg_dist_node; \c - - - :master_port SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port; --- Verify we can drop metadata after unsuccessful attempts +-- Verify we can stop metadata sync after unsuccessful attempts SELECT citus.mitmproxy('conn.allow()'); SELECT stop_metadata_sync_to_node('localhost', :worker_2_proxy_port); @@ -98,7 +92,7 @@ SELECT count(*) FROM pg_dist_node; SELECT hasmetadata FROM pg_dist_node WHERE nodeport=:worker_2_proxy_port; -- turn metadata sync back on -SELECT citus_activate_node('localhost', :worker_2_proxy_port); +SELECT start_metadata_sync_to_node('localhost', :worker_2_proxy_port); SET SEARCH_PATH = mx_metadata_sync; DROP TABLE t1;