Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size of WeakHash32 does not match size of column #6993

Closed
Lloyd-Pottiger opened this issue Mar 8, 2023 · 4 comments · Fixed by #7063
Closed

Size of WeakHash32 does not match size of column #6993

Lloyd-Pottiger opened this issue Mar 8, 2023 · 4 comments · Fixed by #7063

Comments

@Lloyd-Pottiger
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

clickbench

mysql> SELECT UserID, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, SearchPhrase LIMIT 10;
ERROR 1105 (HY000): other error for mpp stream: From MPP<query:<query_ts:1678264801169881664, local_query_id:62, server_id:2818397, start_ts:439947048025587714>,task_id:1>: Code: 49, e.displayText() = DB::Exception: Size of WeakHash32 does not match size of column: column size is 0, hash size is 28144, e.what() = DB::Exception,

2. What did you expect to see? (Required)

success

3. What did you see instead (Required)

fail

4. What is your TiFlash version? (Required)

v6.6.0

@Lloyd-Pottiger Lloyd-Pottiger added the type/bug The issue is confirmed as a bug. label Mar 8, 2023
@Lloyd-Pottiger
Copy link
Contributor Author

[2023/03/08 16:35:06.920 +08:00] [WARN] [<unknown>] ["region {2097,2,722} find error: "] [source=pingcap.tikv] [thread_id=72]
[2023/03/08 16:35:12.756 +08:00] [ERROR] [MPPTask.cpp:454] ["task running meets error: Code: 49, e.displayText() = DB::Exception: Size of WeakHash32 does not match size of column: column size is 93767, hash size is 65536, e.what() = DB::Exception, Stack trace:\n\n\n       0x195288e\tDB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) [tiflash+26552462]\n                \tdbms/src/Common/Exception.h:46\n       0x18d1006\tDB::ColumnVector<long>::updateWeakHash32(DB::WeakHash32&, TiDB::ITiDBCollator const* const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const [tiflash+26021894]\n                \tdbms/src/Columns/ColumnVector.cpp:72\n       0x7d2ffba\tDB::HashBaseWriterHelper::computeHash(DB::Block const&, std::__1::vector<long, std::__1::allocator<long> > const&, std::__1::vector<TiDB::ITiDBCollator const*, std::__1::allocator<TiDB::ITiDBCollator const*> > const&, 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> > > >&, DB::WeakHash32&) [tiflash+131268538]\n                \tdbms/src/Flash/Mpp/HashBaseWriterHelper.cpp:100\n       0x7d30216\tDB::HashBaseWriterHelper::scatterColumns(DB::Block const&, std::__1::vector<long, std::__1::allocator<long> > const&, std::__1::vector<TiDB::ITiDBCollator const*, std::__1::allocator<TiDB::ITiDBCollator const*> > const&, 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> > > >&, unsigned int, std::__1::vector<std::__1::vector<COWPtr<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COWPtr<DB::IColumn>::mutable_ptr<DB::IColumn> > >, std::__1::allocator<std::__1::vector<COWPtr<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COWPtr<DB::IColumn>::mutable_ptr<DB::IColumn> > > > >&) [tiflash+131269142]\n                \tdbms/src/Flash/Mpp/HashBaseWriterHelper.cpp:130\n       0x7d36811\tDB::HashPartitionWriter<std::__1::shared_ptr<DB::MPPTunnelSet> >::partitionAndWriteBlocksV1() [tiflash+131295249]\n                \tdbms/src/Flash/Mpp/HashPartitionWriter.cpp:164\n       0x7ce9d1c\tDB::ExchangeSenderBlockInputStream::readImpl() [tiflash+130981148]\n                \tdbms/src/DataStreams/ExchangeSenderBlockInputStream.cpp:44\n       0x70e4d05\tDB::IProfilingBlockInputStream::read(DB::PODArray<unsigned char, 4096ul, Allocator<false>, 15ul, 16ul>*&, bool) [tiflash+118377733]\n                \tdbms/src/DataStreams/IProfilingBlockInputStream.cpp:75\n       0x70e49f5\tDB::IProfilingBlockInputStream::read() [tiflash+118376949]\n                \tdbms/src/DataStreams/IProfilingBlockInputStream.cpp:43\n       0x7cf32ce\tDB::ParallelInputsProcessor<DB::UnionBlockInputStream<(DB::StreamUnionMode)0, true>::Handler, (DB::StreamUnionMode)0>::work(unsigned long, DB::ParallelInputsProcessor<DB::UnionBlockInputStream<(DB::StreamUnionMode)0, true>::Handler, (DB::StreamUnionMode)0>::WorkingInputs&) [tiflash+131019470]\n                \tdbms/src/DataStreams/ParallelInputsProcessor.h:270\n       0x7cf2de6\tstd::__1::__function::__func<DB::ParallelInputsProcessor<DB::UnionBlockInputStream<(DB::StreamUnionMode)0, true>::Handler, (DB::StreamUnionMode)0>::process()::'lambda'(), std::__1::allocator<DB::ParallelInputsProcessor<DB::UnionBlockInputStream<(DB::StreamUnionMode)0, true>::Handler, (DB::StreamUnionMode)0>::process()::'lambda'()>, void ()>::operator()() [tiflash+131018214]\n                \t/usr/local/bin/../include/c++/v1/__functional/function.h:345\n       0x1a28a1b\tDB::ExecutableTask<std::__1::packaged_task<void ()> >::execute() [tiflash+27429403]\n                \tdbms/src/Common/ExecutableTask.h:52\n       0x1a2c033\tDB::DynamicThreadPool::executeTask(std::__1::unique_ptr<DB::IExecutableTask, std::__1::default_delete<DB::IExecutableTask> >&) [tiflash+27443251]\n                \tdbms/src/Common/DynamicThreadPool.cpp:101\n       0x1a2b690\tDB::DynamicThreadPool::fixedWork(unsigned long) [tiflash+27440784]\n                \tdbms/src/Common/DynamicThreadPool.cpp:115\n       0x1a2c782\tvoid* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::thread DB::ThreadFactory::newThread<void (DB::DynamicThreadPool::*)(unsigned long), DB::DynamicThreadPool*, unsigned long&>(bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void (DB::DynamicThreadPool::*&&)(unsigned long), DB::DynamicThreadPool*&&, unsigned long&)::'lambda'(auto&&...), DB::DynamicThreadPool*, unsigned long> >(void*) [tiflash+27445122]\n                \t/usr/local/bin/../include/c++/v1/thread:291\n  0x7f03cb76aea5\tstart_thread [libpthread.so.0+32421]\n                \t/usr/src/debug/glibc-2.17-c758a686/nptl/pthread_create.c:307\n  0x7f03cb0798dd\t<unknown symbol> [libc.so.6+1042653]\n                \t/usr/src/debug////////glibc-2.17-c758a686/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:111"] [source="MPP<query:<query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257>,task_id:1>"] [thread_id=53]
[2023/03/08 16:35:12.756 +08:00] [WARN] [MPPTaskManager.cpp:152] ["Begin to abort query: <query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257>, abort type: ONERROR, reason: From MPP<query:<query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257>,task_id:1>: Code: 49, e.displayText() = DB::Exception: Size of WeakHash32 does not match size of column: column size is 93767, hash size is 65536, e.what() = DB::Exception,"] [thread_id=53]
[2023/03/08 16:35:12.756 +08:00] [WARN] [MPPTaskManager.cpp:195] ["Remaining task in query <query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257> are: MPP<query:<query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257>,task_id:1> MPP<query:<query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257>,task_id:2> "] [thread_id=53]
[2023/03/08 16:35:12.756 +08:00] [WARN] [MPPTask.cpp:496] ["Begin abort task: MPP<query:<query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257>,task_id:1>, abort type: ONERROR"] [source="MPP<query:<query_ts:1678264501513324022, local_query_id:61, server_id:2818397, start_ts:439946969474400257>,task_id:1>"] [thread_id=53]

@Lloyd-Pottiger
Copy link
Contributor Author

/assign @solotzg

@solotzg
Copy link
Contributor

solotzg commented Mar 8, 2023

size_t rows = block.rows();
if unlikely (rows == 0)
return;
hash.getData().resize(rows);
hash.reset(rows);

Size of hash array is set by rows of block. It means the size of this column is different with others columns.

@windtalker
Copy link
Contributor

It is introduced by #6590, I will fix it ASAP.

ti-chi-bot pushed a commit that referenced this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants