Skip to content

Commit 338bc8f

Browse files
authored
Merge pull request ClickHouse#75379 from ClickHouse/add-async-inserts-job
Tests: add test job with enabled async inserts
2 parents da1076b + bdfd2a9 commit 338bc8f

File tree

45 files changed

+240
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+240
-38
lines changed

.github/workflows/master.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,44 @@ jobs:
16111611
python3 -m praktika run 'Stateless tests (release, ParallelReplicas, s3 storage)' --workflow "MasterCI" --ci |& tee ./ci/tmp/job.log
16121612
fi
16131613
1614+
stateless_tests_debug_asyncinsert_s3_storage:
1615+
runs-on: [self-hosted, func-tester]
1616+
needs: [config_workflow, dockers_build_amd_and_merge, build_amd_debug]
1617+
if: ${{ !failure() && !cancelled() && !contains(fromJson(needs.config_workflow.outputs.data).cache_success_base64, 'U3RhdGVsZXNzIHRlc3RzIChkZWJ1ZywgQXN5bmNJbnNlcnQsIHMzIHN0b3JhZ2Up') }}
1618+
name: "Stateless tests (debug, AsyncInsert, s3 storage)"
1619+
outputs:
1620+
data: ${{ steps.run.outputs.DATA }}
1621+
steps:
1622+
- name: Checkout code
1623+
uses: actions/checkout@v4
1624+
with:
1625+
ref: ${{ env.CHECKOUT_REF }}
1626+
1627+
- name: Prepare env script
1628+
run: |
1629+
rm -rf ./ci/tmp ./ci/tmp ./ci/tmp
1630+
mkdir -p ./ci/tmp ./ci/tmp ./ci/tmp
1631+
cat > ./ci/tmp/praktika_setup_env.sh << 'ENV_SETUP_SCRIPT_EOF'
1632+
export PYTHONPATH=./ci:.:
1633+
cat > ./ci/tmp/workflow_config_masterci.json << 'EOF'
1634+
${{ needs.config_workflow.outputs.data }}
1635+
EOF
1636+
cat > ./ci/tmp/workflow_status.json << 'EOF'
1637+
${{ toJson(needs) }}
1638+
EOF
1639+
ENV_SETUP_SCRIPT_EOF
1640+
1641+
- name: Run
1642+
id: run
1643+
run: |
1644+
. ./ci/tmp/praktika_setup_env.sh
1645+
set -o pipefail
1646+
if command -v ts &> /dev/null; then
1647+
python3 -m praktika run 'Stateless tests (debug, AsyncInsert, s3 storage)' --workflow "MasterCI" --ci |& ts '[%Y-%m-%d %H:%M:%S]' | tee ./ci/tmp/job.log
1648+
else
1649+
python3 -m praktika run 'Stateless tests (debug, AsyncInsert, s3 storage)' --workflow "MasterCI" --ci |& tee ./ci/tmp/job.log
1650+
fi
1651+
16141652
stateless_tests_debug:
16151653
runs-on: [self-hosted, func-tester]
16161654
needs: [config_workflow, dockers_build_amd_and_merge, build_amd_debug]

.github/workflows/pull_request.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,44 @@ jobs:
17651765
python3 -m praktika run 'Stateless tests (release, ParallelReplicas, s3 storage)' --workflow "PR" --ci |& tee ./ci/tmp/job.log
17661766
fi
17671767
1768+
stateless_tests_debug_asyncinsert_s3_storage:
1769+
runs-on: [self-hosted, func-tester]
1770+
needs: [config_workflow, dockers_build_amd_and_merge, build_amd_debug]
1771+
if: ${{ !failure() && !cancelled() && !contains(fromJson(needs.config_workflow.outputs.data).cache_success_base64, 'U3RhdGVsZXNzIHRlc3RzIChkZWJ1ZywgQXN5bmNJbnNlcnQsIHMzIHN0b3JhZ2Up') }}
1772+
name: "Stateless tests (debug, AsyncInsert, s3 storage)"
1773+
outputs:
1774+
data: ${{ steps.run.outputs.DATA }}
1775+
steps:
1776+
- name: Checkout code
1777+
uses: actions/checkout@v4
1778+
with:
1779+
ref: ${{ env.CHECKOUT_REF }}
1780+
1781+
- name: Prepare env script
1782+
run: |
1783+
rm -rf ./ci/tmp ./ci/tmp ./ci/tmp
1784+
mkdir -p ./ci/tmp ./ci/tmp ./ci/tmp
1785+
cat > ./ci/tmp/praktika_setup_env.sh << 'ENV_SETUP_SCRIPT_EOF'
1786+
export PYTHONPATH=./ci:.:
1787+
cat > ./ci/tmp/workflow_config_pr.json << 'EOF'
1788+
${{ needs.config_workflow.outputs.data }}
1789+
EOF
1790+
cat > ./ci/tmp/workflow_status.json << 'EOF'
1791+
${{ toJson(needs) }}
1792+
EOF
1793+
ENV_SETUP_SCRIPT_EOF
1794+
1795+
- name: Run
1796+
id: run
1797+
run: |
1798+
. ./ci/tmp/praktika_setup_env.sh
1799+
set -o pipefail
1800+
if command -v ts &> /dev/null; then
1801+
python3 -m praktika run 'Stateless tests (debug, AsyncInsert, s3 storage)' --workflow "PR" --ci |& ts '[%Y-%m-%d %H:%M:%S]' | tee ./ci/tmp/job.log
1802+
else
1803+
python3 -m praktika run 'Stateless tests (debug, AsyncInsert, s3 storage)' --workflow "PR" --ci |& tee ./ci/tmp/job.log
1804+
fi
1805+
17681806
stateless_tests_debug:
17691807
runs-on: [self-hosted, func-tester]
17701808
needs: [config_workflow, dockers_build_amd_and_merge, build_amd_debug]
@@ -4351,7 +4389,7 @@ jobs:
43514389
43524390
finish_workflow:
43534391
runs-on: [self-hosted, style-checker-aarch64]
4354-
needs: [config_workflow, dockers_build_arm, dockers_build_amd_and_merge, style_check, docs_check, fast_test, build_amd_tidy, build_arm_tidy, build_amd_debug, build_amd_release, build_amd_asan, build_amd_tsan, build_amd_msan, build_amd_ubsan, build_amd_binary, build_arm_release, build_arm_asan, build_arm_coverage, build_arm_binary, build_amd_darwin, build_arm_darwin, build_arm_v80compat, build_amd_freebsd, build_ppc64le, build_amd_compat, build_amd_musl, build_riscv64, build_s390x, build_loongarch64, build_fuzzers, unit_tests_asan, unit_tests_tsan, unit_tests_msan, unit_tests_ubsan, docker_server_image, docker_keeper_image, install_packages_release, install_packages_aarch64, compatibility_check_release, compatibility_check_aarch64, stateless_tests_asan_distributed_plan_1_2, stateless_tests_asan_distributed_plan_2_2, stateless_tests_release, stateless_tests_release_old_analyzer_s3_databasereplicated_1_2, stateless_tests_release_old_analyzer_s3_databasereplicated_2_2, stateless_tests_release_parallelreplicas_s3_storage, stateless_tests_debug, stateless_tests_tsan_1_3, stateless_tests_tsan_2_3, stateless_tests_tsan_3_3, stateless_tests_msan_1_4, stateless_tests_msan_2_4, stateless_tests_msan_3_4, stateless_tests_msan_4_4, stateless_tests_ubsan, stateless_tests_debug_distributed_plan_s3_storage, stateless_tests_tsan_s3_storage_1_3, stateless_tests_tsan_s3_storage_2_3, stateless_tests_tsan_s3_storage_3_3, stateless_tests_aarch64, stateless_tests_coverage_1_6, stateless_tests_coverage_2_6, stateless_tests_coverage_3_6, stateless_tests_coverage_4_6, stateless_tests_coverage_5_6, stateless_tests_coverage_6_6, bugfix_validation, stateless_tests_asan_flaky_check, integration_tests_asan_old_analyzer_1_6, integration_tests_asan_old_analyzer_2_6, integration_tests_asan_old_analyzer_3_6, integration_tests_asan_old_analyzer_4_6, integration_tests_asan_old_analyzer_5_6, integration_tests_asan_old_analyzer_6_6, integration_tests_release_1_4, integration_tests_release_2_4, integration_tests_release_3_4, integration_tests_release_4_4, integration_tests_aarch64_distributed_plan_1_4, integration_tests_aarch64_distributed_plan_2_4, integration_tests_aarch64_distributed_plan_3_4, integration_tests_aarch64_distributed_plan_4_4, integration_tests_tsan_1_6, integration_tests_tsan_2_6, integration_tests_tsan_3_6, integration_tests_tsan_4_6, integration_tests_tsan_5_6, integration_tests_tsan_6_6, integration_tests_asan_flaky_check, stress_test_amd_debug, stress_test_amd_tsan, stress_test_arm_asan, stress_test_amd_ubsan, stress_test_amd_msan, upgrade_check_arm_asan, upgrade_check_amd_tsan, upgrade_check_amd_msan, upgrade_check_amd_debug, ast_fuzzer_amd_debug, ast_fuzzer_arm_asan, ast_fuzzer_amd_tsan, ast_fuzzer_amd_msan, ast_fuzzer_amd_ubsan, buzzhouse_amd_debug, buzzhouse_arm_asan, buzzhouse_amd_tsan, buzzhouse_amd_msan, buzzhouse_amd_ubsan, performance_comparison_amd_release_master_head_1_3, performance_comparison_amd_release_master_head_2_3, performance_comparison_amd_release_master_head_3_3, performance_comparison_arm_release_master_head_1_3, performance_comparison_arm_release_master_head_2_3, performance_comparison_arm_release_master_head_3_3]
4392+
needs: [config_workflow, dockers_build_arm, dockers_build_amd_and_merge, style_check, docs_check, fast_test, build_amd_tidy, build_arm_tidy, build_amd_debug, build_amd_release, build_amd_asan, build_amd_tsan, build_amd_msan, build_amd_ubsan, build_amd_binary, build_arm_release, build_arm_asan, build_arm_coverage, build_arm_binary, build_amd_darwin, build_arm_darwin, build_arm_v80compat, build_amd_freebsd, build_ppc64le, build_amd_compat, build_amd_musl, build_riscv64, build_s390x, build_loongarch64, build_fuzzers, unit_tests_asan, unit_tests_tsan, unit_tests_msan, unit_tests_ubsan, docker_server_image, docker_keeper_image, install_packages_release, install_packages_aarch64, compatibility_check_release, compatibility_check_aarch64, stateless_tests_asan_distributed_plan_1_2, stateless_tests_asan_distributed_plan_2_2, stateless_tests_release, stateless_tests_release_old_analyzer_s3_databasereplicated_1_2, stateless_tests_release_old_analyzer_s3_databasereplicated_2_2, stateless_tests_release_parallelreplicas_s3_storage, stateless_tests_debug_asyncinsert_s3_storage, stateless_tests_debug, stateless_tests_tsan_1_3, stateless_tests_tsan_2_3, stateless_tests_tsan_3_3, stateless_tests_msan_1_4, stateless_tests_msan_2_4, stateless_tests_msan_3_4, stateless_tests_msan_4_4, stateless_tests_ubsan, stateless_tests_debug_distributed_plan_s3_storage, stateless_tests_tsan_s3_storage_1_3, stateless_tests_tsan_s3_storage_2_3, stateless_tests_tsan_s3_storage_3_3, stateless_tests_aarch64, stateless_tests_coverage_1_6, stateless_tests_coverage_2_6, stateless_tests_coverage_3_6, stateless_tests_coverage_4_6, stateless_tests_coverage_5_6, stateless_tests_coverage_6_6, bugfix_validation, stateless_tests_asan_flaky_check, integration_tests_asan_old_analyzer_1_6, integration_tests_asan_old_analyzer_2_6, integration_tests_asan_old_analyzer_3_6, integration_tests_asan_old_analyzer_4_6, integration_tests_asan_old_analyzer_5_6, integration_tests_asan_old_analyzer_6_6, integration_tests_release_1_4, integration_tests_release_2_4, integration_tests_release_3_4, integration_tests_release_4_4, integration_tests_aarch64_distributed_plan_1_4, integration_tests_aarch64_distributed_plan_2_4, integration_tests_aarch64_distributed_plan_3_4, integration_tests_aarch64_distributed_plan_4_4, integration_tests_tsan_1_6, integration_tests_tsan_2_6, integration_tests_tsan_3_6, integration_tests_tsan_4_6, integration_tests_tsan_5_6, integration_tests_tsan_6_6, integration_tests_asan_flaky_check, stress_test_amd_debug, stress_test_amd_tsan, stress_test_arm_asan, stress_test_amd_ubsan, stress_test_amd_msan, upgrade_check_arm_asan, upgrade_check_amd_tsan, upgrade_check_amd_msan, upgrade_check_amd_debug, ast_fuzzer_amd_debug, ast_fuzzer_arm_asan, ast_fuzzer_amd_tsan, ast_fuzzer_amd_msan, ast_fuzzer_amd_ubsan, buzzhouse_amd_debug, buzzhouse_arm_asan, buzzhouse_amd_tsan, buzzhouse_amd_msan, buzzhouse_amd_ubsan, performance_comparison_amd_release_master_head_1_3, performance_comparison_amd_release_master_head_2_3, performance_comparison_amd_release_master_head_3_3, performance_comparison_arm_release_master_head_1_3, performance_comparison_arm_release_master_head_2_3, performance_comparison_arm_release_master_head_3_3]
43554393
if: ${{ !cancelled() }}
43564394
name: "Finish Workflow"
43574395
outputs:

ci/defs/job_configs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ class JobConfigs:
336336
"release, old analyzer, s3, DatabaseReplicated, 1/2",
337337
"release, old analyzer, s3, DatabaseReplicated, 2/2",
338338
"release, ParallelReplicas, s3 storage",
339+
"debug, AsyncInsert, s3 storage",
339340
],
340341
runs_on=[
341342
RunnerLabels.FUNC_TESTER_AMD,
@@ -344,6 +345,7 @@ class JobConfigs:
344345
RunnerLabels.FUNC_TESTER_AMD,
345346
RunnerLabels.FUNC_TESTER_AMD,
346347
RunnerLabels.FUNC_TESTER_AMD,
348+
RunnerLabels.FUNC_TESTER_AMD,
347349
],
348350
requires=[
349351
["Build (amd_asan)"],
@@ -352,6 +354,7 @@ class JobConfigs:
352354
["Build (amd_release)"],
353355
["Build (amd_release)"],
354356
["Build (amd_release)"],
357+
["Build (amd_debug)"],
355358
],
356359
)
357360
functional_tests_jobs_coverage = Job.Config(

tests/async_insert_blacklist.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Deduplication in dependent materialized view cannot work together with async inserts. Please disable either `deduplicate_blocks_in_dependent_materialized_views` or `async_insert` setting
2+
00633_materialized_view_and_too_many_parts_zookeeper
3+
02912_ingestion_mv_deduplication
4+
03008_deduplication_cases_from_docs
5+
03008_deduplication_insert_into_partitioned_table
6+
01927_query_views_log_matview_exceptions
7+
8+
!!!insert deduplication doesn't work
9+
02124_insert_deduplication_token_multiple_blocks
10+
02124_insert_deduplication_token_multiple_blocks_replica
11+
03008_deduplication_random_setttings
12+
13+
Cannot insert column value, because it is MATERIALIZED column
14+
00952_insert_into_distributed_with_materialized_column
15+
16+
!!!performance degradation (timeout)
17+
02046_low_cardinality_parallel_group_by
18+
03221_insert_timeout_overflow_mode
19+
20+
Not bugs
21+
22+
Transactions
23+
Async inserts inside transactions are not supported. (NOT_IMPLEMENTED)
24+
01133_begin_commit_race
25+
01169_old_alter_partition_isolation_stress
26+
01170_alter_partition_isolation
27+
01171_mv_select_insert_isolation_long
28+
01172_transaction_counters
29+
01173_transaction_control_queries
30+
01174_select_insert_isolation
31+
02421_truncate_isolation_no_merges
32+
02421_truncate_isolation_with_mutations
33+
03167_transactions_are_really_disabled
34+
01167_isolation_hermitage
35+
36+
Async inserts with 'implicit_transaction' are not supported. (NOT_IMPLEMENTED)
37+
01168_mutations_isolation
38+
Cannot execute query because current transaction failed. Expecting ROLLBACK statement. (INVALID_TRANSACTION
39+
01169_alter_partition_isolation_stress
40+
41+
Processing async inserts with both inlined and external data (from stdin or infile) is not supported. (NOT_IMPLEMENTED)
42+
02270_stdin_with_query_or_infile_data
43+
02435_rollback_cancelled_queries
44+
45+
https://github.com/ClickHouse/ClickHouse/issues/57768
46+
02423_insert_summary_behaviour
47+
48+
https://github.com/ClickHouse/ClickHouse/issues/79790
49+
02046_remote_table_function_named_collections

tests/ci/ci_cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ def apply(
947947
"Stateless tests (aarch64)": "deb6778b88",
948948
"Stateless tests (release, old analyzer, s3, DatabaseReplicated)": "deb6778b88",
949949
"Stateless tests (release, ParallelReplicas, s3 storage)": "deb6778b88",
950+
"Stateless tests (debug, AsyncInsert, s3 storage)": "deb6778b88",
950951
"Stateless tests (debug, s3 storage)": "deb6778b88",
951952
"Stateless tests (tsan, s3 storage)": "deb6778b88",
952953
"Stress test (debug)": "aa298abf10",

tests/ci/ci_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ class CI:
322322
JobNames.STATELESS_TEST_PARALLEL_REPLICAS_REPLICATED_RELEASE: CommonJobConfigs.STATELESS_TEST.with_properties(
323323
required_builds=[BuildNames.PACKAGE_RELEASE], num_batches=1
324324
),
325+
JobNames.STATELESS_TEST_ASYNC_INSERT_DEBUG: CommonJobConfigs.STATELESS_TEST.with_properties(
326+
required_builds=[BuildNames.PACKAGE_DEBUG], num_batches=1
327+
),
325328
JobNames.STATELESS_TEST_S3_DEBUG_DISTRIBUTED_PLAN: CommonJobConfigs.STATELESS_TEST.with_properties(
326329
required_builds=[BuildNames.PACKAGE_DEBUG], num_batches=1
327330
),

tests/ci/ci_definitions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ class JobNames(metaclass=WithIter):
154154
STATELESS_TEST_PARALLEL_REPLICAS_REPLICATED_RELEASE = (
155155
"Stateless tests (release, ParallelReplicas, s3 storage)"
156156
)
157+
STATELESS_TEST_ASYNC_INSERT_DEBUG = (
158+
"Stateless tests (debug, AsyncInsert, s3 storage)"
159+
)
157160
STATELESS_TEST_S3_DEBUG_DISTRIBUTED_PLAN = (
158161
"Stateless tests (debug, distributed plan, s3 storage)"
159162
)

tests/ci/functional_test_check.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def get_additional_envs(
6262
result.append("USE_POLYMORPHIC_PARTS=1")
6363
if "ParallelReplicas" in check_name:
6464
result.append("USE_PARALLEL_REPLICAS=1")
65+
if "AsyncInsert" in check_name:
66+
result.append("USE_ASYNC_INSERT=1")
6567
if "s3 storage" in check_name:
6668
result.append("USE_S3_STORAGE_FOR_MERGE_TREE=1")
6769
result.append("RANDOMIZE_OBJECT_KEY_TYPE=1")

tests/ci/test_ci_options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"Stateless tests (ubsan)",
7979
"Stateless tests (release, old analyzer, s3, DatabaseReplicated)",
8080
"Stateless tests (release, ParallelReplicas, s3 storage)"
81+
"Stateless tests (debug, AsyncInsert, s3 storage)"
8182
"Stateless tests (debug, s3 storage)",
8283
"Stateless tests (tsan, s3 storage)",
8384
"Stateless tests (asan, flaky check)",

tests/clickhouse-test

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ class FailureReason(enum.Enum):
910910
AZURE_BLOB_STORAGE = "azure-blob-storage"
911911
BUILD = "not running for current build"
912912
NO_PARALLEL_REPLICAS = "smth in not supported with parallel replicas"
913+
NO_ASYNC_INSERT = "test is not supported with async inserts enabled"
913914
SHARED_MERGE_TREE = "no-shared-merge-tree"
914915
DISTRIBUTED_CACHE = "distributed-cache"
915916
NO_STATELESS = "no-stateless"
@@ -1453,6 +1454,9 @@ class TestCase:
14531454
if "no-parallel-replicas" in tags and args.no_parallel_replicas:
14541455
return FailureReason.NO_PARALLEL_REPLICAS
14551456

1457+
if "no-async-insert" in tags and args.no_async_insert:
1458+
return FailureReason.NO_ASYNC_INSERT
1459+
14561460
if args.skip and any(s in self.name for s in args.skip):
14571461
return FailureReason.SKIP
14581462

@@ -1873,7 +1877,10 @@ class TestCase:
18731877
+ database
18741878
+ "_1"
18751879
)
1876-
for env_to_param in ["CLICKHOUSE_USER_FILES", "CLICKHOUSE_USER_FILES_UNIQUE"]:
1880+
for env_to_param in [
1881+
"CLICKHOUSE_USER_FILES",
1882+
"CLICKHOUSE_USER_FILES_UNIQUE",
1883+
]:
18771884
value = os.environ.get(env_to_param, None)
18781885
if value:
18791886
query_params += f" --param_{env_to_param}={value}"
@@ -3327,6 +3334,12 @@ def main(args):
33273334
blacklist = try_get_skip_list(base_dir, "../parallel_replicas_blacklist.txt")
33283335
blacklist_check.extend(blacklist)
33293336

3337+
if args.no_async_insert is True:
3338+
skip_list_async_inserts = try_get_skip_list(
3339+
base_dir, "../async_insert_blacklist.txt"
3340+
)
3341+
skip_list.extend(skip_list_async_inserts)
3342+
33303343
for suite in sorted(os.listdir(base_dir), key=suite_key_func):
33313344
if server_died.is_set():
33323345
break
@@ -3804,6 +3817,12 @@ def parse_args():
38043817
default=False,
38053818
help="Do not include tests that are not supported with parallel replicas feature",
38063819
)
3820+
parser.add_argument(
3821+
"--no-async-insert",
3822+
action="store_true",
3823+
default=False,
3824+
help="Do not include tests that are not supported with async insert feature",
3825+
)
38073826
parser.add_argument(
38083827
"--replace-replicated-with-shared",
38093828
action="store_true",

0 commit comments

Comments
 (0)