mirror of https://github.com/citusdata/citus.git
Update isolation test
parent
a6cdf091bc
commit
76c3f3a1bf
|
@ -122,142 +122,3 @@ restore_isolation_tester_func
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
|
||||||
starting permutation: increase-retry-interval reload-conf s2-start-session-level-connection s2-begin-on-worker s2-truncate-on-worker s3-invalidate-metadata s3-resync s3-wait s1-count-daemons s1-cancel-metadata-sync s1-count-daemons reset-retry-interval reload-conf s2-commit-on-worker s2-stop-connection s3-resync s3-wait
|
|
||||||
create_distributed_table
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step increase-retry-interval:
|
|
||||||
ALTER SYSTEM SET citus.metadata_sync_retry_interval TO 20000;
|
|
||||||
|
|
||||||
step reload-conf:
|
|
||||||
SELECT pg_reload_conf();
|
|
||||||
|
|
||||||
pg_reload_conf
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2-start-session-level-connection:
|
|
||||||
SELECT start_session_level_connection_to_node('localhost', 57638);
|
|
||||||
|
|
||||||
start_session_level_connection_to_node
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2-begin-on-worker:
|
|
||||||
SELECT run_commands_on_session_level_connection_to_node('BEGIN');
|
|
||||||
|
|
||||||
run_commands_on_session_level_connection_to_node
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2-truncate-on-worker:
|
|
||||||
SELECT run_commands_on_session_level_connection_to_node('TRUNCATE t2');
|
|
||||||
|
|
||||||
run_commands_on_session_level_connection_to_node
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s3-invalidate-metadata:
|
|
||||||
update pg_dist_node SET metadatasynced = false;
|
|
||||||
|
|
||||||
step s3-resync:
|
|
||||||
SELECT trigger_metadata_sync();
|
|
||||||
|
|
||||||
trigger_metadata_sync
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s3-wait:
|
|
||||||
SELECT pg_sleep(2);
|
|
||||||
|
|
||||||
pg_sleep
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1-count-daemons:
|
|
||||||
SELECT count(*) FROM pg_stat_activity WHERE application_name LIKE 'Citus Met%';
|
|
||||||
|
|
||||||
count
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1-cancel-metadata-sync:
|
|
||||||
SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE application_name LIKE 'Citus Met%';
|
|
||||||
SELECT pg_sleep(2);
|
|
||||||
|
|
||||||
pg_cancel_backend
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
pg_sleep
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s1-count-daemons:
|
|
||||||
SELECT count(*) FROM pg_stat_activity WHERE application_name LIKE 'Citus Met%';
|
|
||||||
|
|
||||||
count
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
0
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step reset-retry-interval:
|
|
||||||
ALTER SYSTEM RESET citus.metadata_sync_retry_interval;
|
|
||||||
|
|
||||||
step reload-conf:
|
|
||||||
SELECT pg_reload_conf();
|
|
||||||
|
|
||||||
pg_reload_conf
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
t
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2-commit-on-worker:
|
|
||||||
SELECT run_commands_on_session_level_connection_to_node('COMMIT');
|
|
||||||
|
|
||||||
run_commands_on_session_level_connection_to_node
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s2-stop-connection:
|
|
||||||
SELECT stop_session_level_connection_to_node();
|
|
||||||
|
|
||||||
stop_session_level_connection_to_node
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s3-resync:
|
|
||||||
SELECT trigger_metadata_sync();
|
|
||||||
|
|
||||||
trigger_metadata_sync
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
step s3-wait:
|
|
||||||
SELECT pg_sleep(2);
|
|
||||||
|
|
||||||
pg_sleep
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
restore_isolation_tester_func
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
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_1500775 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 | 57638|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
|
||||||
UPDATE public.ref_table_1500775 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_1500767 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57637|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
step s2-end:
|
step s2-end:
|
||||||
|
|
|
@ -31,16 +31,6 @@ teardown
|
||||||
|
|
||||||
session "s1"
|
session "s1"
|
||||||
|
|
||||||
step "increase-retry-interval"
|
|
||||||
{
|
|
||||||
ALTER SYSTEM SET citus.metadata_sync_retry_interval TO 20000;
|
|
||||||
}
|
|
||||||
|
|
||||||
step "reset-retry-interval"
|
|
||||||
{
|
|
||||||
ALTER SYSTEM RESET citus.metadata_sync_retry_interval;
|
|
||||||
}
|
|
||||||
|
|
||||||
step "enable-deadlock-detection"
|
step "enable-deadlock-detection"
|
||||||
{
|
{
|
||||||
ALTER SYSTEM SET citus.distributed_deadlock_detection_factor TO 3;
|
ALTER SYSTEM SET citus.distributed_deadlock_detection_factor TO 3;
|
||||||
|
@ -76,17 +66,6 @@ step "s1-commit"
|
||||||
COMMIT;
|
COMMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
step "s1-count-daemons"
|
|
||||||
{
|
|
||||||
SELECT count(*) FROM pg_stat_activity WHERE application_name LIKE 'Citus Met%';
|
|
||||||
}
|
|
||||||
|
|
||||||
step "s1-cancel-metadata-sync"
|
|
||||||
{
|
|
||||||
SELECT pg_cancel_backend(pid) FROM pg_stat_activity WHERE application_name LIKE 'Citus Met%';
|
|
||||||
SELECT pg_sleep(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
session "s2"
|
session "s2"
|
||||||
|
|
||||||
step "s2-start-session-level-connection"
|
step "s2-start-session-level-connection"
|
||||||
|
@ -147,7 +126,3 @@ step "s3-wait"
|
||||||
// themselves involved in a distributed deadlock.
|
// themselves involved in a distributed deadlock.
|
||||||
// See https://github.com/citusdata/citus/issues/4393 for more details.
|
// See https://github.com/citusdata/citus/issues/4393 for more details.
|
||||||
permutation "enable-deadlock-detection" "reload-conf" "s2-start-session-level-connection" "s1-begin" "s1-update-1" "s2-begin-on-worker" "s2-update-2-on-worker" "s2-truncate-on-worker" "s3-invalidate-metadata" "s3-resync" "s3-wait" "s2-update-1-on-worker" "s1-update-2" "s1-commit" "s2-commit-on-worker" "disable-deadlock-detection" "reload-conf" "s2-stop-connection"
|
permutation "enable-deadlock-detection" "reload-conf" "s2-start-session-level-connection" "s1-begin" "s1-update-1" "s2-begin-on-worker" "s2-update-2-on-worker" "s2-truncate-on-worker" "s3-invalidate-metadata" "s3-resync" "s3-wait" "s2-update-1-on-worker" "s1-update-2" "s1-commit" "s2-commit-on-worker" "disable-deadlock-detection" "reload-conf" "s2-stop-connection"
|
||||||
|
|
||||||
// Test that when metadata sync is waiting for locks, cancelling it terminates it.
|
|
||||||
// This is important in cases where the metadata sync daemon itself is involved in a deadlock.
|
|
||||||
permutation "increase-retry-interval" "reload-conf" "s2-start-session-level-connection" "s2-begin-on-worker" "s2-truncate-on-worker" "s3-invalidate-metadata" "s3-resync" "s3-wait" "s1-count-daemons" "s1-cancel-metadata-sync" "s1-count-daemons" "reset-retry-interval" "reload-conf" "s2-commit-on-worker" "s2-stop-connection" "s3-resync" "s3-wait"
|
|
||||||
|
|
Loading…
Reference in New Issue