Skip to content

Limit disks to search for orphaned parts #84710

Merged
azat merged 16 commits intoClickHouse:masterfrom
ilejn:search_orphaned_parts
Aug 7, 2025
Merged

Limit disks to search for orphaned parts #84710
azat merged 16 commits intoClickHouse:masterfrom
ilejn:search_orphaned_parts

Conversation

@ilejn
Copy link
Contributor

@ilejn ilejn commented Jul 30, 2025

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

New MergeTree setting search_orphaned_parts_drives to limit scope to look for parts e.g. by disks with local metadata.

Fixes: #70514

@ilejn ilejn changed the title Limit disk to search for parts Limit disks to search for parts Jul 30, 2025
@ilejn ilejn changed the title Limit disks to search for parts Limit disks to search for orphaned parts Aug 4, 2025
@azat azat self-assigned this Aug 4, 2025
@ilejn
Copy link
Contributor Author

ilejn commented Aug 5, 2025

CH is not able to start if s3 is not available and s3 disk with plain_rewritable metadata is configured.
https://pastila.nl/?00314508/95c6b93efc0152bc16406a0c3d4eddc1#e1OEKKuCGwcIWUy941a3Zw==
I'd like to leave it out of the scope of this PR and investigate later.

@azat azat added the can be tested Allows running workflows for external contributors label Aug 5, 2025
@clickhouse-gh
Copy link
Contributor

clickhouse-gh bot commented Aug 5, 2025

Workflow [PR], commit [84f91fd]

Summary:

job_name test_name status info comment
Integration tests (aarch64, distributed plan, 4/4) failure
test_storage_rabbitmq/test.py::test_rabbitmq_address FAIL
test_storage_rabbitmq/test.py::test_rabbitmq_msgpack FAIL
Stress test (amd_debug) failure
Server died FAIL
Hung check failed, possible deadlock found (see hung_check.log) FAIL
Killed by signal (in clickhouse-server.log) FAIL
Fatal message in clickhouse-server.log (see fatal_messages.txt) FAIL
Killed by signal (output files) FAIL
Found signal in gdb.log FAIL

@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Aug 5, 2025
@azat
Copy link
Member

azat commented Aug 6, 2025

Tests has failed, @ilejn PTAL

@ilejn
Copy link
Contributor Author

ilejn commented Aug 6, 2025

Something about settings changes history.
Trace

2025.08.06 14:09:04.930748 [ 777 ] {} <Error> Application: Code: 170. DB::Exception: Bad get: has UInt64, requested String. (BAD_GET), Stack trace (when copying this message, always include the lines below):

0. /home/ilejn/projects/ClickHouse_search_orphaned_parts/contrib/llvm-project/libcxx/include/__exception/exception.h:113: Poco::Exception::Exception(String const&, int) @ 0x000000001e145f72
1. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Common/Exception.cpp:116: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000108024db
2. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Common/Exception.h:119: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x00000000097e826c
3. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Common/Exception.h:137: DB::Exception::Exception<std::basic_string_view<char, std::char_traits<char>>, std::basic_string_view<char, std::char_traits<char>>>(int, FormatStringHelperImpl<std::type_identity<std::basic_string_view<char, std::char_traits<char>>>::type, std::type_identity<std::basic_string_view<char, std::char_traits<char>>>::type>, std::basic_string_view<char, std::char_traits<char>>&&, std::basic_string_view<char, std::char_traits<char>>&&) @ 0x0000000014ccc22b
4. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Core/Field.cpp:874: DB::NearestFieldTypeImpl<__decay(String), void>::Type& DB::Field::safeGet<String>() & @ 0x0000000014ccd2ab
5. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Core/Field.h:437: DB::SettingFieldEnum<DB::SearchOrphanedPartsDisks, DB::SettingFieldSearchOrphanedPartsDisksTraits>::SettingFieldEnum(DB::Field const&) @ 0x00000000190f01cc
6. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Storages/MergeTree/MergeTreeSettings.cpp:1915: DB::MergeTreeSettingsTraits::Accessor::instance()::$_0::operator()() const::'lambda501'(DB::Field const&)::__invoke(DB::Field const&) @ 0x00000000190e7f52
7. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Storages/MergeTree/MergeTreeSettings.cpp:1890: DB::MergeTreeSettings::applyCompatibilitySetting(String const&) @ 0x00000000190af7ce
8. /home/ilejn/projects/ClickHouse_search_orphaned_parts/src/Interpreters/Context.cpp:5409: DB::Context::getMergeTreeSettings() const @ 0x0000000015ed1352
9. /home/ilejn/projects/ClickHouse_search_orphaned_parts/programs/server/Server.cpp:837: DB::(anonymous namespace)::sanityChecks(DB::Server&) @ 0x0000000010b312ad

Probably I misunderstand semantic somehow

        addSettingsChanges(merge_tree_settings_changes_history, "25.8",
        {
            {"search_orphaned_parts_disks", SearchOrphanedPartsDisks::ANY, SearchOrphanedPartsDisks::ANY, "New setting"},

@ilejn
Copy link
Contributor Author

ilejn commented Aug 6, 2025

Hm ... it seems it should be
{"search_orphaned_parts_disks", "any", "any"

Rechecking.

@azat
Copy link
Member

azat commented Aug 7, 2025

CH Inc sync - Waiting for status to be reported — Conflicts found. The sync PR is not mergeable, it probably has conflicts

Conflicts has been resolved

@ilejn
Copy link
Contributor Author

ilejn commented Aug 7, 2025

Test failures are new (did not exist while previous run).
It seems that test_storage_delta is flaky, while I will look into it.

@ilejn
Copy link
Contributor Author

ilejn commented Aug 7, 2025

I cannot say anything meaningful about the nature of test_storage_delta failures,
but they are not related to the PR.

@azat
Copy link
Member

azat commented Aug 7, 2025

CI:

@azat azat enabled auto-merge August 7, 2025 21:11
@azat azat added this pull request to the merge queue Aug 7, 2025
Merged via the queue into ClickHouse:master with commit a130149 Aug 7, 2025
121 of 124 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 7, 2025
ilejn pushed a commit to Altinity/ClickHouse that referenced this pull request Aug 25, 2025
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 10, 2025
24.8.14 Backport of ClickHouse#84710: Limit disks to search for orphaned parts
yl-lisen added a commit to timeplus-io/proton that referenced this pull request Oct 29, 2025
* partial ported from ClickHouse/ClickHouse#84710

* ignore no_such_file_or_directory during dropAllData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected dependency on unused s3

4 participants