citus/src/test/regress/spec
Gledis Zeneli 27ddb4fc8e
Do not obtain AccessShareLock before actual lock (#5965)
Do not obtain AccessShareLock before acquiring the distributed locks.

Acquiring an AccessShareLock ensures that the relations which we are trying to get a distributed lock on will not be dropped in the time between when the LOCK command is issued and the LOCK commands are send to the worker. However, this also leads to distributed deadlocks in such scenarios:

```sql
-- for dist lock acquiring order coor, w1, w2

-- on w2
LOCK t1 IN ACCESS EXLUSIVE MODE;
-- acquire AccessShareLock locally on t1 to ensure it is not dropped while we get ready to distribute the lock

      -- concurrently on w1
      LOCK t1 IN ACCESS EXLUSIVE MODE;
      -- acquire AccessShareLock locally on t1 to ensure it is not dropped while we get ready to distribute the lock
      -- acquire dist lock on coor, w1, gets blocked on local AccessShareLock on w2

-- on w2 continuation of the execution above
-- starts to acquire dist locks and gets blocked on the coor by the lock acquired by w1

-- distributed deadlock

``` 

We opt for avoiding such deadlocks with the cost of the possibility of running into errors when the relations on which we are trying to acquire locks on get dropped.
2022-05-23 13:06:38 +03:00
..
README.md Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
columnar_index_concurrency.spec Introduce CI checks for hash comments in specs 2021-11-26 14:52:51 +03:00
columnar_temp_tables.spec Feature: alter database owner (#4986) 2021-05-20 13:27:44 +02:00
columnar_vacuum_vs_insert.spec Columnar: rename files and tests. (#4751) 2021-03-01 08:34:24 -08:00
columnar_write_concurrency.spec Split columnar stripe reservation into two phases (#5188) 2021-09-02 11:49:14 +03:00
columnar_write_concurrency_index.spec Introduce CI checks for hash comments in specs 2021-11-26 14:52:51 +03:00
isolation_acquire_distributed_locks.spec Do not obtain AccessShareLock before actual lock (#5965) 2022-05-23 13:06:38 +03:00
isolation_add_node_vs_reference_table_operations.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_add_remove_node.spec Allow disabling node(s) when multiple failures happen 2021-12-01 10:19:48 +01:00
isolation_blocking_move_multi_shard_commands.spec Enable citus.defer_drop_after_shard_move by default (#4961) 2021-05-21 10:48:32 +03:00
isolation_blocking_move_multi_shard_commands_on_mx.spec Create function in transaction according to create object propagation guc 2022-04-08 17:15:31 +03:00
isolation_blocking_move_single_shard_commands.spec Enable citus.defer_drop_after_shard_move by default (#4961) 2021-05-21 10:48:32 +03:00
isolation_blocking_move_single_shard_commands_on_mx.spec Create function in transaction according to create object propagation guc 2022-04-08 17:15:31 +03:00
isolation_cancellation.spec Normalize Output:.. since it changes with pg13 2020-08-04 15:38:13 +03:00
isolation_check_mx.spec Unify old GUCs into a single one 2022-02-04 10:52:56 +01:00
isolation_citus_dist_activity.spec Global PID Helper Functions (#5768) 2022-03-09 13:15:59 +03:00
isolation_cluster_management.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_concurrent_dml.spec Switch to using LOCK instead of lock_relation_if_exists in TRUNCATE (#5930) 2022-05-11 18:38:48 +03:00
isolation_copy_placement_vs_copy_placement.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_copy_placement_vs_modification.spec Remove all occurences of replication_model GUC 2021-05-21 16:14:59 +03:00
isolation_copy_vs_all_on_mx.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_create_citus_local_table.spec Rename udf in regression tests (as per prev commit) 2021-01-27 15:52:37 +03:00
isolation_create_distributed_table.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_create_restore_point.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_create_table_vs_add_remove_node.spec Generalize the error checks while removing node 2021-11-26 14:25:29 +01:00
isolation_data_migration.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_ddl_vs_all.spec Turns mx on in isolations tests 2021-11-04 17:12:30 +03:00
isolation_delete_vs_all.spec Turns mx on in isolations tests 2021-11-04 17:12:30 +03:00
isolation_dis2ref_foreign_keys_on_mx.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_distributed_deadlock_detection.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_distributed_transaction_id.spec Drop support for CitusInitiatedBackend 2022-02-24 12:12:43 +01:00
isolation_dml_vs_repair.spec Switch to using LOCK instead of lock_relation_if_exists in TRUNCATE (#5930) 2022-05-11 18:38:48 +03:00
isolation_drop_alter_index_select_for_update_on_mx.spec Add normalization rules for flaky isolation tests 2022-05-21 00:55:47 +03:00
isolation_drop_shards.spec Remove master_apply_delete_command 2021-10-18 22:29:37 +02:00
isolation_drop_vs_all.spec Change create_object_propagation default to immediate 2022-03-09 17:40:50 +01:00
isolation_dump_global_wait_edges.spec Create function in transaction according to create object propagation guc 2022-04-08 17:15:31 +03:00
isolation_dump_local_wait_edges.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_ensure_dependency_activate_node.spec Revert "Creates new colocation for colocate_with:='none' too" 2022-05-17 15:32:22 +03:00
isolation_extension_commands.spec Move pg_dist_object to pg_catalog (#5765) 2022-03-04 17:40:38 +00:00
isolation_fix_partition_shard_index_names.spec Run fix_partition_shard_index_names after each wrong naming command 2021-11-08 10:43:34 +01:00
isolation_get_all_active_transactions.spec Improve visibility rules for non-priviledge roles 2022-03-02 18:04:01 +01:00
isolation_get_distributed_wait_queries_mx.spec Improve citus_lock_waits 2022-03-07 11:10:44 +01:00
isolation_global_pid.spec Updates citus_dist_stat_activity to use citus_stat_activity 2022-03-04 17:28:17 +03:00
isolation_hash_copy_vs_all.spec Add normalization rules for flaky isolation tests 2022-05-21 00:55:47 +03:00
isolation_insert_select_conflict.spec Enable replication factor > 1 in metadata syncing (#5392) 2021-11-15 15:10:18 +03:00
isolation_insert_select_repartition.spec Isolation tests for INSERT/SELECT repartition 2020-01-16 23:24:52 -08:00
isolation_insert_select_vs_all.spec Turns mx on in isolations tests 2021-11-04 17:12:30 +03:00
isolation_insert_select_vs_all_on_mx.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_insert_vs_all.spec Turns mx on in isolations tests 2021-11-04 17:12:30 +03:00
isolation_insert_vs_all_on_mx.spec Bump pg12 and pg13 images to pg12.8 and pg13.8 (#5208) 2021-08-25 16:04:57 +03:00
isolation_insert_vs_vacuum.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_master_update_node.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_max_client_connections.spec Create function in transaction according to create object propagation guc 2022-04-08 17:15:31 +03:00
isolation_metadata_sync_deadlock.spec Handle tables and objects as metadata. Update UDFs accordingly 2022-01-31 16:20:15 +03:00
isolation_metadata_sync_vs_all.spec Change create_object_propagation default to immediate 2022-03-09 17:40:50 +01:00
isolation_modify_with_subquery_vs_dml.spec Enable replication factor > 1 in metadata syncing (#5392) 2021-11-15 15:10:18 +03:00
isolation_multi_shard_modify_vs_all.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_multiuser_locking.spec Move isolation_multiuser_locking to MX tests 2022-02-04 10:52:57 +01:00
isolation_mx_common.include.spec Create function in transaction according to create object propagation guc 2022-04-08 17:15:31 +03:00
isolation_partitioned_copy_vs_all.spec Remove the word 'master' from Citus UDFs (#4472) 2021-01-13 12:10:43 +03:00
isolation_progress_monitoring.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_range_copy_vs_all.spec Remove copy into new append shard logic 2021-11-07 21:01:40 +01:00
isolation_rebalancer_deferred_drop.spec Create function in transaction according to create object propagation guc 2022-04-08 17:15:31 +03:00
isolation_ref2ref_foreign_keys.spec Turn metadata sync on in isolation_ref2ref_foreign_keys test (#5791) 2022-03-11 13:30:11 +03:00
isolation_ref2ref_foreign_keys_on_mx.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_ref_select_for_update_vs_all_on_mx.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_ref_update_delete_upsert_vs_all_on_mx.spec Revert "Creates new colocation for colocate_with:='none' too" 2022-05-17 15:32:22 +03:00
isolation_reference_copy_vs_all.spec Add normalization rules for flaky isolation tests 2022-05-21 00:55:47 +03:00
isolation_reference_on_mx.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_replace_wait_function.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_replicate_reference_tables_to_coordinator.spec Allow distributed execution from run_command_on_* functions 2022-05-20 15:26:47 +02:00
isolation_replicated_dist_on_mx.spec Enable replication factor > 1 in metadata syncing (#5392) 2021-11-15 15:10:18 +03:00
isolation_select_for_update.spec Introduce CREATE/DROP VIEW 2022-05-10 13:07:14 +03:00
isolation_select_vs_all.spec Remove copy into new append shard logic 2021-11-07 21:01:40 +01:00
isolation_select_vs_all_on_mx.spec Add normalization rules for flaky isolation tests 2022-05-21 00:55:47 +03:00
isolation_shard_rebalancer.spec Fetch shard size on the fly for the rebalance monitor 2021-05-20 16:38:17 +02:00
isolation_shard_rebalancer_progress.spec Fetch shard size on the fly for the rebalance monitor 2021-05-20 16:38:17 +02:00
isolation_shouldhaveshards.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_transaction_recovery.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_truncate_vs_all.spec Remove copy into new append shard logic 2021-11-07 21:01:40 +01:00
isolation_truncate_vs_all_on_mx.spec Add distributing lock command support 2022-05-20 12:28:07 +03:00
isolation_undistribute_table.spec Enable replication factor > 1 in metadata syncing (#5392) 2021-11-15 15:10:18 +03:00
isolation_update_delete_upsert_vs_all_on_mx.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
isolation_update_node.spec Turn metadata sync on in isolation_update_node and isolation_update_node_lock_writes tests (#5779) 2022-03-11 16:39:20 +03:00
isolation_update_node_lock_writes.spec Turn metadata sync on in isolation_update_node and isolation_update_node_lock_writes tests (#5779) 2022-03-11 16:39:20 +03:00
isolation_update_vs_all.spec Turns mx on in isolations tests 2021-11-04 17:12:30 +03:00
isolation_upsert_vs_all.spec Turns mx on in isolations tests 2021-11-04 17:12:30 +03:00
isolation_validate_vs_insert.spec Remove unused steps in isolation tests 2020-08-04 15:18:27 +03:00
shared_connection_waits.spec Fetch shard size on the fly for the rebalance monitor 2021-05-20 16:38:17 +02:00

README.md

In this folder, all tests which in the format of '*_add.spec' organized according to specific format.

You should use // in mx files not //. We preprocess mx files with cpp to include isolation_mx_common.include.spec.

For isolation tests, we selected 'n' representative operations and we aimed to perform all possible pairs of 'n' operations together. So first test just runs first of these 'n' operation with remaining 'n - 1' operation. Similary, second test just runs second operation with remaining 'n - 2' operation. With this logic, we eventually run every selected operation with every other selected operation.