Repository navigation
Closed
Labels
bugConfirmed user-visible misbehaviour in official releasecomp-object-storage-disksObject-storage disk layer: DiskObjectStorage, metadata storage adapters, transaction support for ...crashCrash / segfault / abortfuzzProblem found by one of the fuzzers
Description
Describe the bug
Easy to reproduce
How to reproduce
With this setup:
<storage_configuration>
<disks>
<disk0>
<type>object_storage</type>
<object_storage_type>local</object_storage_type>
<metadata_type>local</metadata_type>
<path>/var/lib/clickhouse/disk0/</path>
</disk0>
<disk1>
<type>object_storage</type>
<object_storage_type>local</object_storage_type>
<metadata_type>plain_rewritable</metadata_type>
<path>/var/lib/clickhouse/disk1/</path>
</disk1>
</disks>
<policies>
<policy0>
<volumes>
<volume0>
<disk>disk1</disk>
<disk>disk0</disk>
</volume0>
</volumes>
</policy0>
</policies>
</storage_configuration>Run:
CREATE TABLE t0 (c0 Int) ENGINE = MergeTree() ORDER BY tuple() SETTINGS remove_empty_parts = 0, storage_policy = 'policy0';
INSERT INTO TABLE t0 (c0) VALUES (1);
ALTER TABLE t0 DROP PARTITION tuple();
ALTER TABLE t0 MOVE PARTITION tuple() TO DISK 'disk1'; --SEGVError message and/or stacktrace
Stack trace:
contrib/llvm-project/libcxx/include/__vector/vector.h:436: libc++ Hardening assertion !empty() failed: front() called on an empty vector
[ip-10-2-3-131] 2026.06.10 12:13:44.516776 [ 1366355 ] <Fatal> BaseDaemon: ########################################
[ip-10-2-3-131] 2026.06.10 12:13:44.516887 [ 1366355 ] <Fatal> BaseDaemon: (version 26.6.1.584 (official build), build id: 64374109E15FA5B7891B33D3EC113B6564A485C2, git hash: f086fa5d0d07573944daa7eb808035c053e87327) (from thread 1367097) (query_id: 7e0c3da2-9536-4d49-9821-abb8d922124d) (query: ALTER TABLE t0 MOVE PARTITION tuple() TO DISK 'disk1';) Received signal Aborted (6)
[ip-10-2-3-131] 2026.06.10 12:13:44.516922 [ 1366355 ] <Fatal> BaseDaemon: Sent by tkill.
[ip-10-2-3-131] 2026.06.10 12:13:44.516968 [ 1366355 ] <Fatal> BaseDaemon: Stack trace: 0x000074e355a9eb2d 0x000074e355a4527e 0x000074e355a288ff 0x00005867220302e5 0x000058670ee6f104 0x000058670ee08652 0x000058670edff3f3 0x000058670edd89fd 0x000058670edcdc36 0x000058670b97174a 0x000058670b9714e2 0x000058670a356b8b 0x000058670a35e28b 0x000058670a3540d9 0x000058670a35b64e 0x000074e355a9caa4 0x000074e355b29c6c
[ip-10-2-3-131] 2026.06.10 12:13:44.517021 [ 1366355 ] <Fatal> BaseDaemon: 3. pthread_kill@@GLIBC_2.34 @ 0x000000000009eb2d
[ip-10-2-3-131] 2026.06.10 12:13:44.517056 [ 1366355 ] <Fatal> BaseDaemon: 4. __GI_raise @ 0x000000000004527e
[ip-10-2-3-131] 2026.06.10 12:13:44.517093 [ 1366355 ] <Fatal> BaseDaemon: 5. __GI_abort @ 0x00000000000288ff
[ip-10-2-3-131] 2026.06.10 12:13:44.525077 [ 1366355 ] <Fatal> BaseDaemon: 6. contrib/llvm-project/libcxx/src/verbose_abort.cpp:62:3: ? @ 0x000000002cae72e5
[ip-10-2-3-131] 2026.06.10 12:13:44.550922 [ 1366355 ] <Fatal> BaseDaemon: 7.0. inlined from contrib/llvm-project/libcxx/include/__vector/vector.h:436: std::vector<DB::StoredObject, std::allocator<DB::StoredObject>>::front[abi:sqe220101]() const
[ip-10-2-3-131] 2026.06.10 12:13:44.550960 [ 1366355 ] <Fatal> BaseDaemon: 7. src/Disks/DiskObjectStorage/MetadataStorages/PlainRewritable/MetadataStorageFromPlainRewritableObjectStorage.cpp:409:5: DB::MetadataStorageFromPlainRewritableObjectStorageTransaction::createMetadataFile(String const&, std::vector<DB::StoredObject, std::allocator<DB::StoredObject>> const&) @ 0x0000000019926104
[ip-10-2-3-131] 2026.06.10 12:13:44.582570 [ 1366355 ] <Fatal> BaseDaemon: 8.0. inlined from src/Disks/DiskObjectStorage/DiskObjectStorageTransaction.cpp:518: operator()
[ip-10-2-3-131] 2026.06.10 12:13:44.582637 [ 1366355 ] <Fatal> BaseDaemon: 8.1. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90: std::__invoke_result_impl<void, DB::DiskObjectStorageTransaction::copyFileImpl(std::shared_ptr<DB::IMetadataStorage> const&, std::shared_ptr<DB::ClusterConfiguration> const&, std::shared_ptr<DB::ObjectStorageRouter> const&, String const&, String const&, DB::ReadSettings const&, DB::WriteSettings const&)::$_2&, std::shared_ptr<DB::IMetadataTransaction>>::type std::__invoke[abi:sqe220101]<DB::DiskObjectStorageTransaction::copyFileImpl(std::shared_ptr<DB::IMetadataStorage> const&, std::shared_ptr<DB::ClusterConfiguration> const&, std::shared_ptr<DB::ObjectStorageRouter> const&, String const&, String const&, DB::ReadSettings const&, DB::WriteSettings const&)::$_2&, std::shared_ptr<DB::IMetadataTransaction>>(DB::DiskObjectStorageTransaction::copyFileImpl(std::shared_ptr<DB::IMetadataStorage> const&, std::shared_ptr<DB::ClusterConfiguration> const&, std::shared_ptr<DB::ObjectStorageRouter> const&, String const&, String const&, DB::ReadSettings const&, DB::WriteSettings const&)::$_2&, std::shared_ptr<DB::IMetadataTransaction>&&)
[ip-10-2-3-131] 2026.06.10 12:13:44.582665 [ 1366355 ] <Fatal> BaseDaemon: 8.2. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350: void std::__invoke_void_return_wrapper<void, true>::__call[abi:sqe220101]<DB::DiskObjectStorageTransaction::copyFileImpl(std::shared_ptr<DB::IMetadataStorage> const&, std::shared_ptr<DB::ClusterConfiguration> const&, std::shared_ptr<DB::ObjectStorageRouter> const&, String const&, String const&, DB::ReadSettings const&, DB::WriteSettings const&)::$_2&, std::shared_ptr<DB::IMetadataTransaction>>(DB::DiskObjectStorageTransaction::copyFileImpl(std::shared_ptr<DB::IMetadataStorage> const&, std::shared_ptr<DB::ClusterConfiguration> const&, std::shared_ptr<DB::ObjectStorageRouter> const&, String const&, String const&, DB::ReadSettings const&, DB::WriteSettings const&)::$_2&, std::shared_ptr<DB::IMetadataTransaction>&&)
[ip-10-2-3-131] 2026.06.10 12:13:44.582696 [ 1366355 ] <Fatal> BaseDaemon: 8.3. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356: void std::__invoke_r[abi:sqe220101]<void, DB::DiskObjectStorageTransaction::copyFileImpl(std::shared_ptr<DB::IMetadataStorage> const&, std::shared_ptr<DB::ClusterConfiguration> const&, std::shared_ptr<DB::ObjectStorageRouter> const&, String const&, String const&, DB::ReadSettings const&, DB::WriteSettings const&)::$_2&, std::shared_ptr<DB::IMetadataTransaction>>(DB::DiskObjectStorageTransaction::copyFileImpl(std::shared_ptr<DB::IMetadataStorage> const&, std::shared_ptr<DB::ClusterConfiguration> const&, std::shared_ptr<DB::ObjectStorageRouter> const&, String const&, String const&, DB::ReadSettings const&, DB::WriteSettings const&)::$_2&, std::shared_ptr<DB::IMetadataTransaction>&&)
[ip-10-2-3-131] 2026.06.10 12:13:44.582713 [ 1366355 ] <Fatal> BaseDaemon: 8. contrib/llvm-project/libcxx/include/__functional/function.h:443:13: ? @ 0x00000000198bf652
[ip-10-2-3-131] 2026.06.10 12:13:44.606388 [ 1366355 ] <Fatal> BaseDaemon: 9.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:502: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.606432 [ 1366355 ] <Fatal> BaseDaemon: 9.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:754: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.606444 [ 1366355 ] <Fatal> BaseDaemon: 9. src/Disks/DiskObjectStorage/DiskObjectStorageTransaction.cpp:539:12: DB::DiskObjectStorageTransaction::commit() @ 0x00000000198b63f3
[ip-10-2-3-131] 2026.06.10 12:13:44.622359 [ 1366355 ] <Fatal> BaseDaemon: 10. src/Disks/DiskObjectStorage/DiskObjectStorage.cpp:307:26: DB::DiskObjectStorage::copyFile(String const&, DB::IDisk&, String const&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&) @ 0x000000001988f9fd
[ip-10-2-3-131] 2026.06.10 12:13:44.642060 [ 1366355 ] <Fatal> BaseDaemon: 11.0. inlined from src/Disks/IDisk.cpp:158: operator()
[ip-10-2-3-131] 2026.06.10 12:13:44.642101 [ 1366355 ] <Fatal> BaseDaemon: 11.1. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90: std::__invoke_result_impl<void, DB::asyncCopy(DB::IDisk&, String, DB::IDisk&, String, DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&)::$_0&>::type std::__invoke[abi:sqe220101]<DB::asyncCopy(DB::IDisk&, String, DB::IDisk&, String, DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&)::$_0&>(DB::asyncCopy(DB::IDisk&, String, DB::IDisk&, String, DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&)::$_0&)
[ip-10-2-3-131] 2026.06.10 12:13:44.642124 [ 1366355 ] <Fatal> BaseDaemon: 11.2. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350: void std::__invoke_void_return_wrapper<void, true>::__call[abi:sqe220101]<DB::asyncCopy(DB::IDisk&, String, DB::IDisk&, String, DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&)::$_0&>(DB::asyncCopy(DB::IDisk&, String, DB::IDisk&, String, DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&)::$_0&)
[ip-10-2-3-131] 2026.06.10 12:13:44.642149 [ 1366355 ] <Fatal> BaseDaemon: 11.3. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356: void std::__invoke_r[abi:sqe220101]<void, DB::asyncCopy(DB::IDisk&, String, DB::IDisk&, String, DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&)::$_0&>(DB::asyncCopy(DB::IDisk&, String, DB::IDisk&, String, DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>&, DB::ReadSettings const&, DB::WriteSettings const&, std::function<void ()> const&)::$_0&)
[ip-10-2-3-131] 2026.06.10 12:13:44.642191 [ 1366355 ] <Fatal> BaseDaemon: 11. contrib/llvm-project/libcxx/include/__functional/function.h:443:27: ? @ 0x0000000019884c36
[ip-10-2-3-131] 2026.06.10 12:13:44.653750 [ 1366355 ] <Fatal> BaseDaemon: 12.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:502: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.653788 [ 1366355 ] <Fatal> BaseDaemon: 12.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:754: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.653796 [ 1366355 ] <Fatal> BaseDaemon: 12. src/Common/threadPoolCallbackRunner.h:158:12: void DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>::executeCallback<std::function<void ()>>(std::promise<void>&, std::function<void ()>&&, std::shared_ptr<DB::ThreadGroup>, DB::ThreadName) @ 0x000000001642874a
[ip-10-2-3-131] 2026.06.10 12:13:44.662516 [ 1366355 ] <Fatal> BaseDaemon: 13. src/Common/threadPoolCallbackRunner.h:222:13: DB::ThreadPoolCallbackRunnerLocal<void, ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>, std::function<void ()>>::enqueueAndGiveOwnership(std::function<void ()>&&, Priority, std::optional<unsigned long>)::'lambda'()::operator()() @ 0x00000000164284e2
[ip-10-2-3-131] 2026.06.10 12:13:44.672374 [ 1366355 ] <Fatal> BaseDaemon: 14.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:502: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.672393 [ 1366355 ] <Fatal> BaseDaemon: 14.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:754: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.672407 [ 1366355 ] <Fatal> BaseDaemon: 14. src/Common/ThreadPool.cpp:802:12: ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::worker() @ 0x0000000014e0db8b
[ip-10-2-3-131] 2026.06.10 12:13:44.689449 [ 1366355 ] <Fatal> BaseDaemon: 15.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:502: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.689476 [ 1366355 ] <Fatal> BaseDaemon: 15.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:754: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.689640 [ 1366355 ] <Fatal> BaseDaemon: 15.2. inlined from src/Common/ThreadPool.cpp:961: operator()
[ip-10-2-3-131] 2026.06.10 12:13:44.689669 [ 1366355 ] <Fatal> BaseDaemon: 15.3. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:90: std::__invoke_result_impl<void, startThreadFromGlobalPool(std::shared_ptr<ThreadFromGlobalPoolState>, std::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>::type std::__invoke[abi:sqe220101]<startThreadFromGlobalPool(std::shared_ptr<ThreadFromGlobalPoolState>, std::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::shared_ptr<ThreadFromGlobalPoolState>, std::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&)
[ip-10-2-3-131] 2026.06.10 12:13:44.689692 [ 1366355 ] <Fatal> BaseDaemon: 15.4. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:350: void std::__invoke_void_return_wrapper<void, true>::__call[abi:sqe220101]<startThreadFromGlobalPool(std::shared_ptr<ThreadFromGlobalPoolState>, std::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::shared_ptr<ThreadFromGlobalPoolState>, std::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&)
[ip-10-2-3-131] 2026.06.10 12:13:44.689714 [ 1366355 ] <Fatal> BaseDaemon: 15.5. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:356: void std::__invoke_r[abi:sqe220101]<void, startThreadFromGlobalPool(std::shared_ptr<ThreadFromGlobalPoolState>, std::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&>(startThreadFromGlobalPool(std::shared_ptr<ThreadFromGlobalPoolState>, std::function<void ()>, unsigned long, unsigned long, bool, bool)::$_0&)
[ip-10-2-3-131] 2026.06.10 12:13:44.689737 [ 1366355 ] <Fatal> BaseDaemon: 15. contrib/llvm-project/libcxx/include/__functional/function.h:443:12: ? @ 0x0000000014e1528b
[ip-10-2-3-131] 2026.06.10 12:13:44.698499 [ 1366355 ] <Fatal> BaseDaemon: 16.0. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:502: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.698520 [ 1366355 ] <Fatal> BaseDaemon: 16.1. inlined from contrib/llvm-project/libcxx/include/__functional/function.h:754: ?
[ip-10-2-3-131] 2026.06.10 12:13:44.698533 [ 1366355 ] <Fatal> BaseDaemon: 16. src/Common/ThreadPool.cpp:812:12: ThreadPoolImpl<std::thread>::ThreadFromThreadPool::worker() @ 0x0000000014e0b0d9
[ip-10-2-3-131] 2026.06.10 12:13:44.715371 [ 1366355 ] <Fatal> BaseDaemon: 17.0. inlined from contrib/llvm-project/libcxx/include/__type_traits/invoke.h:0: std::__invoke_result_impl<void, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>::type std::__invoke[abi:sqe220101]<void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>(void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*&&)
[ip-10-2-3-131] 2026.06.10 12:13:44.715407 [ 1366355 ] <Fatal> BaseDaemon: 17.1. inlined from contrib/llvm-project/libcxx/include/__thread/thread.h:161: void std::__thread_execute[abi:sqe220101]<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*, 0ul, 1ul>(std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>&, std::__integer_sequence<unsigned long, 0ul, 1ul>)
[ip-10-2-3-131] 2026.06.10 12:13:44.715420 [ 1366355 ] <Fatal> BaseDaemon: 17. contrib/llvm-project/libcxx/include/__thread/thread.h:169: void* std::__thread_proxy[abi:sqe220101]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>>(void*) @ 0x0000000014e1264e
[ip-10-2-3-131] 2026.06.10 12:13:44.715450 [ 1366355 ] <Fatal> BaseDaemon: 18. start_thread @ 0x000000000009caa4
[ip-10-2-3-131] 2026.06.10 12:13:44.715781 [ 1366355 ] <Fatal> BaseDaemon: 19. __GI___clone3 @ 0x0000000000129c6c
[ip-10-2-3-131] 2026.06.10 12:13:44.952562 [ 1366355 ] <Fatal> BaseDaemon: Integrity check of the executable successfully passed (checksum: 06057E431AD2E1F5F910739C0D173E36)
[ip-10-2-3-131] 2026.06.10 12:13:44.953195 [ 1366355 ] <Fatal> BaseDaemon: ClickHouse version 26.6.1.584 is old and should be upgraded to the latest version.
[ip-10-2-3-131] 2026.06.10 12:13:44.953374 [ 1366355 ] <Fatal> BaseDaemon: Changed settings: s3_truncate_on_insert = true, azure_truncate_on_insert = true, allow_suspicious_low_cardinality_types = true, allow_suspicious_fixed_string_types = true, allow_suspicious_indices = true, allow_suspicious_ttl_expressions = true, allow_suspicious_variant_types = true, allow_suspicious_primary_key = true, allow_suspicious_types_in_group_by = true, allow_suspicious_types_in_order_by = true, enable_positional_arguments = true, allow_nonconst_timezone_arguments = true, enable_time_time64_type = true, allow_nondeterministic_optimize_skip_unused_shards = true, table_function_remote_max_addresses = 200, insert_allow_materialized_columns = true, allow_distributed_ddl = true, allow_suspicious_codecs = true, max_execution_time = 60., allow_custom_error_code_in_throwif = true, allow_ddl = true, allow_introspection_functions = true, allow_drop_detached = true, enable_lightweight_delete = true, allow_materialized_view_with_bad_select = true, allow_settings_after_format_in_insert = true, allow_nondeterministic_mutations = true, allow_non_metadata_alters = true, enable_materialized_cte = true, enable_lightweight_update = true, query_cache_nondeterministic_function_handling = 'ignore', query_cache_system_table_handling = 'ignore', allow_experimental_kafka_offsets_storage_in_keeper = true, engine_file_truncate_on_insert = true, database_replicated_allow_replicated_engine_arguments = 1, allow_experimental_correlated_subqueries = true, keeper_max_retries = 15, enable_order_by_all = true, allow_dynamic_type_in_join_keys = true, allow_create_index_without_type = true, allow_named_collection_override_by_default = true, allow_experimental_geo_types_in_iceberg = true, allow_experimental_delta_lake_writes = true, allow_experimental_parallel_reading_from_replicas = 0, parallel_replicas_for_non_replicated_merge_tree = true, parallel_replicas_allow_materialized_views = true, allow_experimental_database_iceberg = true, allow_experimental_database_unity_catalog = true, allow_experimental_database_glue_catalog = true, allow_experimental_analyzer = true, allow_experimental_materialized_postgresql_table = true, allow_experimental_funnel_functions = true, allow_experimental_nlp_functions = true, allow_experimental_hash_functions = true, allow_experimental_time_series_table = true, allow_experimental_unique_key = true, allow_experimental_codecs = true, allow_experimental_join_right_table_sorting = true, allow_experimental_json_lazy_type_hints = true, enable_streaming_queries = true, enable_full_text_index = true, allow_experimental_window_view = true, allow_experimental_database_materialized_postgresql = true, allow_experimental_nullable_tuple_type = true, allow_nullable_tuple_in_extracted_subcolumns = true, allow_experimental_query_deduplication = true, allow_experimental_database_hms_catalog = true, allow_experimental_kusto_dialect = true, allow_experimental_prql_dialect = true, allow_experimental_polyglot_dialect = true, allow_experimental_delta_kernel_rs = true, allow_insert_into_iceberg = true, allow_experimental_cleanup_old_data_files_compaction = true, allow_experimental_iceberg_compaction = true, allow_iceberg_remove_orphan_files = true, allow_experimental_expire_snapshots = true, allow_experimental_ytsaurus_table_engine = true, allow_experimental_ytsaurus_table_function = true, allow_experimental_ytsaurus_dictionary_source = true, allow_experimental_time_series_aggregate_functions = true, allow_experimental_paimon_storage_engine = true, allow_experimental_object_storage_queue_hive_partitioning = true, allow_experimental_database_paimon_rest_catalog = true, allow_experimental_ai_functions = true, allow_experimental_alias_table_engine = true, allow_not_comparable_types_in_order_by = true, allow_not_comparable_types_in_comparison_functions = true, enable_zstd_qat_codec = true, enable_deflate_qpl_codec = true, type_json_skip_duplicated_paths = true, input_format_parquet_allow_geoparquet_parser = true
Version info
- Resolved by: Fix crash moving an empty part to a plain_rewritable disk #107040
- Merged into:
26.7.1.954(included in26.7and later) - Backported to:
26.6.2.75,26.5.6.50,26.4.5.139,26.3.17.53
Metadata
Metadata
Assignees
Labels
bugConfirmed user-visible misbehaviour in official releasecomp-object-storage-disksObject-storage disk layer: DiskObjectStorage, metadata storage adapters, transaction support for ...crashCrash / segfault / abortfuzzProblem found by one of the fuzzers
Activity
PedroTadim commentedon Jun 10, 2026
@groeneai you know what to do!
PedroTadim commentedon Jun 10, 2026
@clickgapai I think this is a regression introduced a few releases back, can you bisect?
groeneai commentedon Jun 10, 2026
@PedroTadim reproduced and fixed: #107040.
Root cause: an empty part (0 rows, kept by
remove_empty_parts = 0afterDROP PARTITION) holds 0-byte files. A local-metadata disk stores a 0-byte file with zero stored objects, so the cross-disk copy (DiskObjectStorageTransaction::copyFileImpl) callscreateMetadataFile(to_file_path, {})with an empty objects list. Theplain_rewritableimplementation didobjects.front()unconditionally and aborted on the empty vector (front() called on an empty vectoratMetadataStorageFromPlainRewritableObjectStorage.cpp:409). The local and non-rewritable plain metadata storages already accept an empty list, so the fix makesplain_rewritabledo the same: record a 0-byte file.On the bisect: this regressed in 25.12, when the
plain_rewritablemetadata storage was split off from the unified plain implementation (thecreateMetadataFile->objects.front()path arrived with commits 3da089d / a18a4fd, first stable tag v25.12.1.649). Before that the unifiedMetadataStorageFromPlainObjectStoragewas used. So @clickgapai's bisect should land in the 25.12 window.Verified both directions on a debug build: unfixed -> SIGABRT (exact backtrace match), fixed -> the move succeeds and the empty part stays fully functional (count/insert/select/optimize/drop). Added stateless test
04327_move_empty_part_to_plain_rewritable.clickgapai commentedon Jun 12, 2026
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
TL;DR
ALTER MOVE out-of-bounds to another disk
ClickGap verified: reproduced it with the script below on
master; tested 1 version(s) — 1 affected, 0 clean (see Affects).Reproduction
Shell reproducer — run against a local ClickHouse build (
bash <script> <clickhouse-binary>); requires the referenced test fixtures from the repo.Bisect
Affects
master@ commite730b593b836(aarch64)master26.5, 26.4, 26.3, 25.8Suggested next step
Manual triage of the
comp-object-storage-diskspath is needed. The reproducer above should be a fast first check.Component:
comp-object-storage-disksSeverity:
P2ClickGap · Finding:
h_issue_106960Triage metadata
comp-object-storage-diskscomp-multidiskcomp-object-storage-disks): @Michicosun @ksseniiclickhouse-gh commentedon Jun 25, 2026
Crash classifier applied:
comp-object-storage-disksFix crash moving an empty part to a plain_rewritable disk
groeneai commentedon Jul 27, 2026
The fix for this issue (#107040) is incomplete on 26.3, 26.4 and 26.5. The reported crash still reproduces there with the configuration and query in the report above. master, 26.6 and 26.7 are correct.
The backport put the guard on a path this repro does not take
#107040 added the empty-blob guard to
DiskObjectStorageTransaction::copyFile. On master that body is the shared helpercopyFileImpl, which bothDiskObjectStorageTransaction::copyFileandMultipleDisksObjectStorageTransaction::copyFiledelegate to, so one hunk covers both overloads. On 26.3/26.4/26.5 there is nocopyFileImpl: the two overloads are separate function bodies, and the backports (#110818, #110819, #110820) applied the hunk to only the first one.ALTER TABLE t0 MOVE PARTITION tuple() TO DISK 'disk1'goes through the unguarded overload, which is visible in the stack trace in the report: frame 11 isIDisk.cpp:158(asyncCopy's per-filefrom_disk.copyFile), and frame 10 isDiskObjectStorage.cpp:307, which istransaction->commit()inside theif (getDataSourceDescription() == to_disk.getDataSourceDescription())branch, i.e. aMultipleDisksObjectStorageTransaction. The two disks in the report take that branch becauseDataSourceDescription::operator==(src/Disks/DiskType.cpp:33-36) compares{type, object_storage_type, description, is_encrypted, zookeeper_name}and excludesmetadata_type;disk0anddisk1are bothobject_storage/localwith the sameLocalObjectStoragedescription, differing only inmetadata_type. Soblobs_to_createis empty for the 0-byte files of the empty part, the unguarded tail callscreateMetadataFile(to_file_path, {}), andMetadataStorageFromPlainRewritableObjectStorageTransaction::createMetadataFiledoesobjects.front()on the empty vector.It is also breaking ReleaseBranchCI
The regression test
DiskObjectStorageTest.CopyEmptyFileToPlainRewritablewas backported and is doing its job: it aborts theunit_tests_dbmsbinary with the same assertion, so nogtest.jsonis written and the job reports the gtest filter string instead of the test:Because the binary aborts mid-suite, every unit test ordered after it is skipped on those branches.
check_status=error), last 2026-07-25Onset matches the backport merges (2026-07-17 13:00-14:11 UTC) to the minute. Latest 26.5 report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=26.5&sha=e6337d57cd0a2f12648c533345e77ada85ff8556&name_0=ReleaseBranchCI&name_1=Unit%20tests%20%28asan_ubsan%29 (identical assertion in the msan and tsan logs).
Suggested fix
Copy the same six lines the backport already applied to the sibling overload into
MultipleDisksObjectStorageTransaction::copyFile, immediately before the trailingoperations_to_execute.push_back, on each of 26.3, 26.4 and 26.5:The existing backported test needs no change: it fails today and passes once the guard is present. Backporting the
copyFileImplrefactor instead would keep the branches structurally identical to master, but it drags a refactor of the copy path (including master's parallel copy dispatch) onto stable branches, so the six-line duplicate looks like the better trade for a bug-fix-only branch. Reverting the test would turn CI green while leaving the crash in three shipping releases, so that does not seem like an option.I cannot open these PRs myself, since I do not author release-branch changes, and there is nothing left to fix on master, so the automated backport flow has no source commit to replay. This needs a hand-adapted commit on each of the three branches. @alesapin, this is assigned to you by the crash classifier above.
PedroTadim commentedon Jul 27, 2026
@groeneai can you create the 3 PR fixes for 26.3, 26.4 and 26.5 and I review them?
groeneai commentedon Jul 27, 2026
Acknowledged. I will open three release-branch PRs (targeting
26.3,26.4and26.5) that add the empty-blob guard to the separateMultipleDisksObjectStorageTransaction::copyFilebody on those branches, verified against the config andALTER TABLE t0 MOVE PARTITION tuple() TO DISK 'disk1'from the report (abort before, clean after), and I will request your review on each.One note on shape, since it is unusual: master, 26.6 and 26.7 need no change (both overloads there delegate to the shared
DiskObjectStorageTransaction::copyFileImpl, which already carries the guard), so there is no master counterpart to backport from and these have to be release-branch-only PRs. I will keep each one to the same 6-line guard that #110818/#110819/#110820 applied to the other overload, so the two overloads on each branch end up consistent.Fix crash moving an empty part to a plain_rewritable disk