citus/src/test/regress/spec
Jelte Fennema 1c5b8588fe
Address race condition in InitializeBackendData (#6285)
Sometimes in CI our isolation_citus_dist_activity test fails randomly
like this:
```diff
 step s2-view-dist:
  SELECT query, citus_nodename_for_nodeid(citus_nodeid_for_gpid(global_pid)), citus_nodeport_for_nodeid(citus_nodeid_for_gpid(global_pid)), state, wait_event_type, wait_event, usename, datname FROM citus_dist_stat_activity WHERE query NOT ILIKE ALL(VALUES('%pg_prepared_xacts%'), ('%COMMIT%'), ('%BEGIN%'), ('%pg_catalog.pg_isolation_test_session_is_blocked%'), ('%citus_add_node%')) AND backend_type = 'client backend' ORDER BY query DESC;

 query                                                                                                                                                                                                                                                                                                                                                                 |citus_nodename_for_nodeid|citus_nodeport_for_nodeid|state              |wait_event_type|wait_event|usename |datname
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+-------------------------+-------------------+---------------+----------+--------+----------

   INSERT INTO test_table VALUES (100, 100);
                                                                                                                                                                                                                                                                                                                          |localhost                |                    57636|idle in transaction|Client         |ClientRead|postgres|regression
-(1 row)
+
+                SELECT coalesce(to_jsonb(array_agg(csa_from_one_node.*)), '[{}]'::JSONB)
+                FROM (
+                    SELECT global_pid, worker_query AS is_worker_query, pg_stat_activity.* FROM
+                    pg_stat_activity LEFT JOIN get_all_active_transactions() ON process_id = pid
+                ) AS csa_from_one_node;
+            |localhost                |                    57636|active             |               |          |postgres|regression
+(2 rows)

 step s3-view-worker:
```
Source: https://app.circleci.com/pipelines/github/citusdata/citus/26692/workflows/3406e4b4-b686-4667-bec6-8253ee0809b1/jobs/765119

I intended to fix this with #6263, but the fix turned out to be
insufficient. This PR tries to address the issue by setting
distributedCommandOriginator correctly in more situations. However, even
with this change it's still possible to reproduce the flaky test in CI.
In any case this should fix at least some instances of this issue.

In passing this changes the isolation_citus_dist_activity test to allow
running it multiple times in a row.
2022-09-02 14:23:47 +02: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 Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_add_coordinator.spec Properly add / remove coordinator for isolation tests (#6181) 2022-08-18 17:32:12 +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 Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_blocking_move_multi_shard_commands_on_mx.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_blocking_move_single_shard_commands.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_blocking_move_single_shard_commands_on_mx.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_blocking_shard_split.spec Add colocation checks for shard splits 2022-07-27 10:01:19 +02:00
isolation_blocking_shard_split_with_fkey_to_reference.spec Shard Split for Citus (#6029) 2022-07-18 02:54:15 -07: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 Address race condition in InitializeBackendData (#6285) 2022-09-02 14:23:47 +02:00
isolation_citus_locks.spec Introduce citus_locks view 2022-07-21 03:06:57 +03:00
isolation_cluster_management.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_concurrent_dml.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_concurrent_move_create_table.spec Add colocation checks for shard splits 2022-07-27 10:01:19 +02: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 Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02: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_distributed_table_concurrently.spec Add non-blocking variant of create_distributed_table (#6087) 2022-08-30 15:35:40 +03:00
isolation_create_restore_point.spec Clean up multi_shard_commit_protocol guc leftovers (#6110) 2022-08-01 15:22:02 +03: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 Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_delete_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_dis2ref_foreign_keys_on_mx.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_distributed_deadlock_detection.spec Fix flakyness in isolation_distributed_deadlock_detection (#6240) 2022-08-26 12:03:40 +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 Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_drop_shards.spec Remove master_apply_delete_command 2021-10-18 22:29:37 +02:00
isolation_drop_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_dump_global_wait_edges.spec Replace iso tester func only once (#5964) 2022-07-06 11:04: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 "Revert "Creates new colocation for colocate_with:='none' too"" (#6227) 2022-08-24 10:54:04 +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 Check the PGPROC's validity properly 2022-07-26 17:44:44 +02:00
isolation_get_distributed_wait_queries_mx.spec Adjust some isolation test for the recent PG commits (#6210) 2022-08-19 17:06:34 +03:00
isolation_global_pid.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_hash_copy_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_insert_select_conflict.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +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 Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_insert_select_vs_all_on_mx.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_insert_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_insert_vs_all_on_mx.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_insert_vs_vacuum.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_logical_replication_binaryless.spec Enable binary logical replication for shard moves (#6017) 2022-08-23 16:38:00 +02:00
isolation_logical_replication_multi_shard_commands.spec Replace isolation tester func only once on enterprise tests (#6064) 2022-07-14 19:16:53 +03:00
isolation_logical_replication_multi_shard_commands_on_mx.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_logical_replication_single_shard_commands.spec Replace isolation tester func only once on enterprise tests (#6064) 2022-07-14 19:16:53 +03:00
isolation_logical_replication_single_shard_commands_on_mx.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_logical_replication_with_partitioning.spec Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
isolation_master_update_node.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_max_client_connections.spec Concurrent shard move/copy and colocated table creation fix 2022-07-27 10:01:19 +02:00
isolation_metadata_sync_deadlock.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +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 Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_move_placement_vs_modification.spec Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
isolation_move_placement_vs_modification_fk.spec Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
isolation_move_placement_vs_move_placement.spec Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
isolation_multi_shard_modify_vs_all.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_multiuser_locking.spec Grant create on public to some users where necessary (for PG15) (#6180) 2022-08-17 17:35:10 +03:00
isolation_mx_common.include.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_non_blocking_shard_split.spec Introduce Non-Blocking Shard Split Workflow 2022-08-04 16:32:38 +02:00
isolation_non_blocking_shard_split_fkey.spec Introduce Non-Blocking Shard Split Workflow 2022-08-04 16:32:38 +02:00
isolation_non_blocking_shard_split_with_index_as_replicaIdentity.spec Introduce Non-Blocking Shard Split Workflow 2022-08-04 16:32:38 +02:00
isolation_partitioned_copy_vs_all.spec Remove the word 'master' from Citus UDFs (#4472) 2021-01-13 12:10:43 +03:00
isolation_pg_send_cancellation.spec Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07:00
isolation_progress_monitoring.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_range_copy_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_rebalancer_deferred_drop.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_ref2ref_foreign_keys.spec Bump PG versions in CI configs 2022-08-22 17:16:52 +03:00
isolation_ref2ref_foreign_keys_enterprise.spec Replace isolation tester func only once on enterprise tests (#6064) 2022-07-14 19:16:53 +03:00
isolation_ref2ref_foreign_keys_on_mx.spec Add ORDER BY in pg_locks to avoid output order diffs (#6145) 2022-08-09 06:02:07 +03:00
isolation_ref_select_for_update_vs_all_on_mx.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_ref_update_delete_upsert_vs_all_on_mx.spec Revert "Revert "Creates new colocation for colocate_with:='none' too"" (#6227) 2022-08-24 10:54:04 +03:00
isolation_reference_copy_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_reference_on_mx.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_reference_table.spec Fix flakyness in isolation_reference_table (#6193) 2022-08-18 15:47:28 +03:00
isolation_remove_coordinator.spec Properly add / remove coordinator for isolation tests (#6181) 2022-08-18 17:32:12 +03:00
isolation_replace_wait_function.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_replicate_reference_tables_to_coordinator.spec Fix flakyness in isolation_replicate_reference_tables_to_coordinator.spec (#6123) 2022-08-03 12:00:30 +02:00
isolation_replicated_dist_on_mx.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_select_for_update.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_select_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_select_vs_all_on_mx.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_setup.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_shard_move_vs_start_metadata_sync.spec Make enterprise features open source (#6008) 2022-06-16 00:23:46 -07: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 Track rebalance progress at the shard move level (#6187) 2022-08-18 18:57:04 +02:00
isolation_shouldhaveshards.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_tenant_isolation.spec Nonblocking tenant isolation is supported by using split api. (#6167) 2022-08-17 11:13:07 +03:00
isolation_tenant_isolation_nonblocking.spec Add non-blocking variant of create_distributed_table (#6087) 2022-08-30 15:35:40 +03:00
isolation_tenant_isolation_with_fkey_to_reference.spec Nonblocking tenant isolation is supported by using split api. (#6167) 2022-08-17 11:13:07 +03:00
isolation_transaction_recovery.spec Refactor isolation tests (#3062) 2019-12-10 16:12:54 +01:00
isolation_truncate_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_truncate_vs_all_on_mx.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_undistribute_table.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +03:00
isolation_update_delete_upsert_vs_all_on_mx.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_update_node.spec Replace iso tester func only once (#5964) 2022-07-06 11:04:31 +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 Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_upsert_vs_all.spec Fix flakyness in create index concurrently isolation tests (#6158) 2022-08-11 10:29:11 +02:00
isolation_vacuum_skip_locked.spec * Added isolation tests for vacuum, 2022-06-23 15:33:14 +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.