mirror of https://github.com/citusdata/citus.git
Remove IF EXISTS from cleanup on failure test for subscription object (#6547)
Nothing critical. Just improving a DROP SUBSCRIPTION test for a cleanup after failure scenario.pull/6551/head
parent
7499c3073d
commit
3cc5d9842a
|
@ -316,15 +316,18 @@ SELECT citus.mitmproxy('conn.allow()');
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- first, manually drop the subscsription object. But the record for it will remain on pg_dist_cleanup
|
-- first, manually drop the subscsription object. But the record for it will remain on pg_dist_cleanup
|
||||||
SELECT run_command_on_workers($$DROP SUBSCRIPTION IF EXISTS citus_shard_move_subscription_xxxxxxx_xxxxxxx$$);
|
-- we expect the drop query will succeed on only one node
|
||||||
run_command_on_workers
|
SELECT COUNT(*)
|
||||||
|
FROM run_command_on_workers(
|
||||||
|
$$DROP SUBSCRIPTION citus_shard_move_subscription_xxxxxxx_xxxxxxx$$)
|
||||||
|
WHERE success AND result = 'DROP SUBSCRIPTION';
|
||||||
|
count
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,9060,t,"DROP SUBSCRIPTION")
|
1
|
||||||
(localhost,57637,t,"DROP SUBSCRIPTION")
|
(1 row)
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
-- cleanup leftovers
|
-- cleanup leftovers
|
||||||
-- verify we don't see any error for already dropped subscription
|
-- then, verify we don't see any error for already dropped subscription
|
||||||
SET client_min_messages TO WARNING;
|
SET client_min_messages TO WARNING;
|
||||||
CALL citus_cleanup_orphaned_resources();
|
CALL citus_cleanup_orphaned_resources();
|
||||||
RESET client_min_messages;
|
RESET client_min_messages;
|
||||||
|
|
|
@ -131,9 +131,14 @@ SELECT master_move_shard_placement(101, 'localhost', :worker_1_port, 'localhost'
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
SELECT citus.mitmproxy('conn.allow()');
|
||||||
-- first, manually drop the subscsription object. But the record for it will remain on pg_dist_cleanup
|
-- first, manually drop the subscsription object. But the record for it will remain on pg_dist_cleanup
|
||||||
SELECT run_command_on_workers($$DROP SUBSCRIPTION IF EXISTS citus_shard_move_subscription_10_15$$);
|
-- we expect the drop query will succeed on only one node
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM run_command_on_workers(
|
||||||
|
$$DROP SUBSCRIPTION citus_shard_move_subscription_10_15$$)
|
||||||
|
WHERE success AND result = 'DROP SUBSCRIPTION';
|
||||||
|
|
||||||
-- cleanup leftovers
|
-- cleanup leftovers
|
||||||
-- verify we don't see any error for already dropped subscription
|
-- then, verify we don't see any error for already dropped subscription
|
||||||
SET client_min_messages TO WARNING;
|
SET client_min_messages TO WARNING;
|
||||||
CALL citus_cleanup_orphaned_resources();
|
CALL citus_cleanup_orphaned_resources();
|
||||||
RESET client_min_messages;
|
RESET client_min_messages;
|
||||||
|
|
Loading…
Reference in New Issue