Skip to content

Support Customized Wait Time for Low Priority Query#77013

Merged
nickitat merged 26 commits intoClickHouse:masterfrom
VicoWu:customized_wait_time_for_low_priority_query
Mar 25, 2025
Merged

Support Customized Wait Time for Low Priority Query#77013
nickitat merged 26 commits intoClickHouse:masterfrom
VicoWu:customized_wait_time_for_low_priority_query

Conversation

@VicoWu
Copy link
Copy Markdown
Contributor

@VicoWu VicoWu commented Mar 2, 2025

Changelog category (leave one):

  • Improvement

Fix the issue #77570

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

Support configurable per task waiting time of low priority query in session level and in server level.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@thevar1able thevar1able added the can be tested Allows running workflows for external contributors label Mar 2, 2025
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Mar 2, 2025

Workflow [PR], commit [5c571c4]

@VicoWu VicoWu force-pushed the customized_wait_time_for_low_priority_query branch from 4f28a17 to 8b1411e Compare March 12, 2025 14:04
@VicoWu VicoWu force-pushed the customized_wait_time_for_low_priority_query branch from 09a6664 to 4e13e25 Compare March 24, 2025 08:47
@VicoWu VicoWu marked this pull request as ready for review March 24, 2025 09:36
@clickhouse-gh clickhouse-gh bot added the pr-improvement Pull request with some product improvements label Mar 24, 2025
@VicoWu VicoWu force-pushed the customized_wait_time_for_low_priority_query branch from 69e1468 to b897def Compare March 24, 2025 15:34
@nickitat nickitat self-assigned this Mar 24, 2025
@VicoWu
Copy link
Copy Markdown
Contributor Author

VicoWu commented Mar 25, 2025

CI Error is unrelated with changes in this PR, I think we could ignore it:

Query succeeded, using this AST as a start
Fuzzing step 330 out of 1000
Dump of fuzzed AST:
EXPLAIN PIPELINE  WITH sub4 AS (SELECT DISTINCT a, z FROM tab3 WHERE z != 8 QUALIFY isNullable(materialize(toLowCardinality(9)) IS NOT NULL) AND (toLowCardinality(9) IS NULL)), sub5 A
S (SELECT r.y, y, rr.z, x, z FROM sub3 AS ll ANY LEFT JOIN sub4 AS rr ON ll.z = rr.z), sub1 AS (SELECT DISTINCT x, y FROM tab1 PREWHERE x IN (SELECT number FROM numbers(16) WHERE 2 !=
 number) GROUP BY GROUPING SETS ((1), (2), (* AND (7 IS NOT NULL) AS alias4622), (isZeroOrNull(toLowCardinality(2))))), sub2 AS (SELECT y, z FROM tab2__fuzz_1 WHERE y != 4), sub3 AS (
SELECT l.x, r.y, l.y, r.z AS z FROM sub1 AS l ANY LEFT JOIN sub2 AS r ON l.y = r.y) SELECT DISTINCT   7, * FROM sub5 ORDER BY x DESC SETTINGS enable_parallel_replicas = 1, parallel_re
plicas_allow_in_with_subquery = 0

WITH sub4 AS (SELECT DISTINCT a, z FROM tab3 WHERE z != 8 QUALIFY isNullable(materialize(toLowCardinality(9)) IS NOT NULL) AND (toLowCardinality(9) IS NULL)), sub5 AS (SELECT r.y, y,
rr.z, x, z FROM sub3 AS ll ANY LEFT JOIN sub4 AS rr ON ll.z = rr.z), sub1 AS (SELECT DISTINCT x, y FROM tab1 PREWHERE x IN (SELECT number FROM numbers(16) WHERE 2 != number) GROUP BY
GROUPING SETS ((1), (2), (* AND (7 IS NOT NULL) AS alias4622), (isZeroOrNull(2)))), sub2 AS (SELECT y, z FROM tab2__fuzz_4 WHERE y != 4), sub3 AS (SELECT l.x, r.y, l.y, r.z AS z FROM
sub1 AS l ANY LEFT JOIN sub2 AS r ON l.y = r.y WHERE NOT (toNullable(toNullable(7)) AND ((9 IS NULL) IS NOT NULL))) SELECT DISTINCT   7, * FROM sub5 ORDER BY x DESC SETTINGS enable_pa
rallel_replicas = 1, parallel_replicas_allow_in_with_subquery = 0

[ip-172-31-28-56] 2025.03.25 04:10:42.487879 [ 891 ] {825ac557-58ef-469a-af39-28b733aed8d9} <Fatal> : Logical error: 'Not-ready Set is passed as the second argument for function 'in''.
[ip-172-31-28-56] 2025.03.25 04:10:42.515268 [ 891 ] {825ac557-58ef-469a-af39-28b733aed8d9} <Fatal> : Stack trace (when copying this message, always include the lines below):

0. std::exception::exception[abi:ne190107]() @ 0x0000000017d9fab4
1. ./build_docker/./base/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(String const&, int) @ 0x0000000035a17680
2. ./build_docker/./src/Common/Exception.cpp:108: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000002397574b
3. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x0000000017c53316
4. DB::Exception::Exception<String>(int, FormatStringHelperImpl<std::type_identity<String>::type>, String&&) @ 0x0000000017c67dcf
5. DB::(anonymous namespace)::FunctionIn<false, false, true, false>::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, bool, unsigned long) const @ 0x000000001c16d2c3
6. DB::(anonymous namespace)::FunctionIn<false, false, true, false>::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x000000001c16c3f0
7. ./build_docker/./src/Functions/IFunctionAdaptors.cpp:10: DB::FunctionToExecutableFunctionAdaptor::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x000000002ac7584e
8. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002ac69777
9. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const>
const&, unsigned long, bool) const @ 0x000000002ac6c17a
10. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned lo
ng, bool) const @ 0x000000002ac6d790
11. ./build_docker/./src/Interpreters/ExpressionActions.cpp:636: DB::executeAction(DB::ExpressionActions::Action const&, DB::(anonymous namespace)::ExecutionContext&, bool, bool) @ 0x
000000002d572cb5
12. ./build_docker/./src/Interpreters/ExpressionActions.cpp:770: DB::ExpressionActions::execute(DB::Block&, unsigned long&, bool, bool) const @ 0x000000002d5704a7
13. ./build_docker/./src/Interpreters/ExpressionActions.cpp:816: DB::ExpressionActions::execute(DB::Block&, bool, bool) const @ 0x000000002d573c5e
14. ./build_docker/./src/Storages/MergeTree/MergeTreeRangeReader.cpp:1394: DB::MergeTreeRangeReader::executePrewhereActionsAndFilterColumns(DB::MergeTreeRangeReader::ReadResult&, DB::
Block const&, bool) const @ 0x0000000030ebc839
15. ./build_docker/./src/Storages/MergeTree/MergeTreeReadersChain.cpp:110: DB::MergeTreeReadersChain::executePrewhereActions(DB::MergeTreeRangeReader&, DB::MergeTreeRangeReader::ReadR
esult&, DB::Block const&, bool) @ 0x0000000030ee8667
16. ./build_docker/./src/Storages/MergeTree/MergeTreeReadersChain.cpp:75: DB::MergeTreeReadersChain::read(unsigned long, DB::MarkRanges&) @ 0x0000000030ee7acf
17. ./build_docker/./src/Storages/MergeTree/MergeTreeReadTask.cpp:172: DB::MergeTreeReadTask::read() @ 0x0000000030ee44f1
18. ./src/Storages/MergeTree/MergeTreeSelectAlgorithms.h:53: DB::MergeTreeInOrderSelectAlgorithm::readFromTask(DB::MergeTreeReadTask&) @ 0x00000000322887d1
19. ./build_docker/./src/Storages/MergeTree/MergeTreeSelectProcessor.cpp:207: DB::MergeTreeSelectProcessor::read() @ 0x0000000030ef07bf
20. ./build_docker/./src/Storages/MergeTree/MergeTreeSource.cpp:229: DB::MergeTreeSource::tryGenerate() @ 0x00000000322b1d95
21. ./build_docker/./src/Processors/ISource.cpp:108: DB::ISource::work() @ 0x000000003177f523
22. ./build_docker/./src/Processors/Executors/ExecutionThreadContext.cpp:53: DB::ExecutionThreadContext::executeTask() @ 0x00000000317ace8e
23. ./build_docker/./src/Processors/Executors/PipelineExecutor.cpp:296: DB::PipelineExecutor::executeStepImpl(unsigned long, std::atomic<bool>*) @ 0x00000000317983bf
24. ./build_docker/./src/Processors/Executors/PipelineExecutor.cpp:262: DB::PipelineExecutor::executeImpl(unsigned long, bool) @ 0x0000000031797585
25. ./build_docker/./src/Processors/Executors/PipelineExecutor.cpp:128: DB::PipelineExecutor::execute(unsigned long, bool) @ 0x0000000031796f8a
26. ./build_docker/./src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:76: void std::__function::__policy_invoker<void ()>::__call_impl[abi:ne190107]<std::__function::__defaul
t_alloc_func<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::p
ull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()>>(std::__function::__policy_storage const*) @ 0x00000000317b1e97
27. ./contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x0000000023b504cf
28. ./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:117: void* std::__thread_proxy[abi:ne190107]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std:
:__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>>(void*) @ 0x0000000023b5816a
29. ? @ 0x00007f7be4ebaac3

@nickitat
Copy link
Copy Markdown
Member

The fuzzer failure looks similar to #76721

@nickitat nickitat enabled auto-merge March 25, 2025 12:31
@nickitat nickitat added this pull request to the merge queue Mar 25, 2025
Merged via the queue into ClickHouse:master with commit 82641e7 Mar 25, 2025
120 of 122 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 25, 2025
baibaichen added a commit to Kyligence/gluten that referenced this pull request Mar 26, 2025
baibaichen added a commit to Kyligence/gluten that referenced this pull request Mar 26, 2025
baibaichen added a commit to apache/gluten that referenced this pull request Mar 26, 2025
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20250326)

* Fix build due to ClickHouse/ClickHouse#55518

* Fix Build due to ClickHouse/ClickHouse#77013

* Fix gtest build due to ClickHouse/ClickHouse#77895

* disbable query_plan_optimize_lazy_materialization due to #9141

---------

Co-authored-by: kyligence-git <gluten@kyligence.io>
Co-authored-by: Chang chen <changchen@apache.org>
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.

4 participants