You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After adding the second disk to default storage policy, any questions to system.detached_parts return error
Does it reproduce on recent release?
yes reproduced, and any LTS release 20.3 (ordinary), 20.8 21.3
How to reproduce
git clone https://gist.github.com/c17d50ca4b2e2785ce957debc7548420.git ./detached_and_storage_policy
cd ./detached_and_storage_policy
bash -x steps-to-reproduce.sh
Queries to run that lead to unexpected result
SELECT
count() AS detached_parts,
database,
table,
disk,
if(coalesce(reason,'unknown')='','detached_by_user',coalesce(reason,'unknown')) AS detach_reason
FROM system.detached_parts
GROUP BY
database,
table,
disk,
reason
Expected behavior
empty result
Error message and/or stacktrace
2021.07.08 13:01:53.805096 [ 51 ] {52b361e2-8e58-4757-859e-7f867a3f7a8b} <Error> executeQuery: Poco::Exception. Code: 1000, e.code() = 2, e.displayText() = File not found: /var/lib/clickhouse2/store/8f9/8f932fde-af5a-43e1-8f93-2fdeaf5af3e1/detached (version 21.6.6.51 (official build)) (from 127.0.0.1:60496) (in query: SELECT count() AS detached_parts, database, table, disk, if(coalesce(reason,'unknown')='','detached_by_user',coalesce(reason,'unknown')) AS detach_reason FROM system.detached_parts GROUP BY database, table, disk, reason ), Stack trace (when copying this message, always include the lines below):
0. Poco::FileImpl::handleLastErrorImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x12b47ab5 in /usr/bin/clickhouse
1. Poco::DirectoryIteratorImpl::DirectoryIteratorImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x12b30b97 in /usr/bin/clickhouse
2. Poco::DirectoryIterator::DirectoryIterator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x12b30e3f in /usr/bin/clickhouse
3. DB::DiskLocalDirectoryIterator::DiskLocalDirectoryIterator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xf4a5b9d in /usr/bin/clickhouse
4. DB::DiskLocal::iterateDirectory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xf4a2643 in /usr/bin/clickhouse
5. DB::MergeTreeData::getDetachedParts() const @ 0x1017d7a4 in /usr/bin/clickhouse
6. DB::StorageSystemDetachedParts::read(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::SelectQueryInfo&, std::__1::shared_ptr<DB::Context>, DB::QueryProcessingStage::Enum, unsigned long, unsigned int) @ 0xef96f79 in /usr/bin/clickhouse
7. DB::IStorage::read(DB::QueryPlan&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::SelectQueryInfo&, std::__1::shared_ptr<DB::Context>, DB::QueryProcessingStage::Enum, unsigned long, unsigned int) @ 0xfe06117 in /usr/bin/clickhouse
8. DB::InterpreterSelectQuery::executeFetchColumns(DB::QueryProcessingStage::Enum, DB::QueryPlan&) @ 0xf921a2f in /usr/bin/clickhouse
9. DB::InterpreterSelectQuery::executeImpl(DB::QueryPlan&, std::__1::shared_ptr<DB::IBlockInputStream> const&, std::__1::optional<DB::Pipe>) @ 0xf919463 in /usr/bin/clickhouse
10. DB::InterpreterSelectQuery::buildQueryPlan(DB::QueryPlan&) @ 0xf918520 in /usr/bin/clickhouse
11. DB::InterpreterSelectWithUnionQuery::buildQueryPlan(DB::QueryPlan&) @ 0xfa888de in /usr/bin/clickhouse
12. DB::InterpreterSelectWithUnionQuery::execute() @ 0xfa899b1 in /usr/bin/clickhouse
13. ? @ 0xfc44781 in /usr/bin/clickhouse
14. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, bool) @ 0xfc42e03 in /usr/bin/clickhouse
15. DB::TCPHandler::runImpl() @ 0x10468bb2 in /usr/bin/clickhouse
16. DB::TCPHandler::run() @ 0x1047bab9 in /usr/bin/clickhouse
17. Poco::Net::TCPServerConnection::start() @ 0x12a7a50f in /usr/bin/clickhouse
18. Poco::Net::TCPServerDispatcher::run() @ 0x12a7bf9a in /usr/bin/clickhouse
19. Poco::PooledThread::run() @ 0x12bb52f9 in /usr/bin/clickhouse
20. Poco::ThreadImpl::runnableEntry(void*) @ 0x12bb12ea in /usr/bin/clickhouse
21. start_thread @ 0x9609 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
22. clone @ 0x122293 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
Additional context
for Ordinary database
Received exception from server (version 20.3.21):
Code: 1000. DB::Exception: Received from localhost:9000. DB::Exception: File not found: /var/lib/clickhouse2/data/default/t1/detached.
Also a lot of background errors in logs with directory in not exists, but it not affect to successful work
The text was updated successfully, but these errors were encountered:
Slach
added
the
bug
Confirmed user-visible misbehaviour in official release
label
Jul 8, 2021
Describe the bug
After adding the second disk to
default
storage policy, any questions to system.detached_parts return errorDoes it reproduce on recent release?
yes reproduced, and any LTS release 20.3 (ordinary), 20.8 21.3
How to reproduce
git clone https://gist.github.com/c17d50ca4b2e2785ce957debc7548420.git ./detached_and_storage_policy cd ./detached_and_storage_policy bash -x steps-to-reproduce.sh
Expected behavior
empty result
Error message and/or stacktrace
Additional context
for Ordinary database
Also a lot of background errors in logs with directory in not exists, but it not affect to successful work
The text was updated successfully, but these errors were encountered: