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

Tables with Inverted Index fails with BAD_SIZE_OF_FILE_IN_DATA_PART error when CH restarted or attach table #47810

Closed
zhangjmruc opened this issue Mar 21, 2023 · 2 comments

Comments

@zhangjmruc
Copy link
Contributor

Describe the unexpected behaviour
I tried to create a table with Inverted Index, and insert some rows. But when CH restarts or attach table, there is no rows in this table.

How to reproduce
SET allow_experimental_inverted_index = true;

CREATE TABLE tab
(
key UInt64,
str String,
INDEX inv_idx(str) TYPE inverted(0) GRANULARITY 1
)
ENGINE = MergeTree
ORDER BY key;

INSERT INTO tab(key, str) values (1, 'Hello World');

detach table tab;
attach table tab;

select count() from tab;

  • Which ClickHouse server version to use
    Master: 23.3.1.2537

Expected behavior
The table with Inverted Index can be attached correctly, or data can be loaded during CK start.

Error message and/or stacktrace

2023.03.21 13:58:05.017418 [ 920094 ] {f106f433-b9ed-43e1-a217-05ad7179c1e9} default.tab (a17bb23f-ff60-437b-bd9d-150eb366ed46): while loading part all_1_1_0 on path store/a17/a17bb23f-ff60-437b-bd9d-150eb366ed46/all_1_1_0: Code: 228. DB::Exception: store/a17/a17bb23f-ff60-437b-bd9d-150eb366ed46/all_1_1_0/skp_idx_inv_idx.gin_dict has unexpected size: 44 instead of 0. (BAD_SIZE_OF_FILE_IN_DATA_PART), Stack trace (when copying this message, always include the lines below):

  1. Poco::Exception::Exception(String const&, int) @ 0x15871d5a in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  2. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0xe9605b5 in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  3. DB::Exception::Exception<std::__fs::filesystem::path, unsigned long&, unsigned long const&>(int, FormatStringHelperImpl<std::type_identitystd::__fs::filesystem::path::type, std::type_identity<unsigned long&>::type, std::type_identity<unsigned long const&>::type>, std::__fs::filesystem::path&&, unsigned long&, unsigned long const&) @ 0x1486f8b6 in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  4. DB::MergeTreeDataPartChecksum::checkSize(DB::IDataPartStorage const&, String const&) const @ 0x1486ade2 in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  5. DB::MergeTreeDataPartChecksums::checkSizes(DB::IDataPartStorage const&) const @ 0x1486b198 in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  6. DB::IMergeTreeDataPart::checkConsistencyBase() const @ 0x1477a927 in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  7. DB::MergeTreeDataPartCompact::checkConsistency(bool) const @ 0x1487199c in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  8. DB::IMergeTreeDataPart::loadColumnsChecksumsIndexes(bool, bool) @ 0x1476cfa2 in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  9. DB::MergeTreeData::loadDataPart(DB::MergeTreePartInfo const&, String const&, std::shared_ptrDB::IDisk const&, DB::MergeTreeDataPartState, std::mutex&) @ 0x147e411d in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  10. void std::__function::__policy_invoker<void ()>::__call_impl<std::__function::__default_alloc_func<DB::MergeTreeData::loadDataPartsFromDisk(ThreadPoolImpl<ThreadFromGlobalPoolImpl>&, unsigned long, std::queue<std::vector<std::shared_ptrDB::MergeTreeData::PartLoadingTree::Node, std::allocator<std::shared_ptrDB::MergeTreeData::PartLoadingTree::Node>>, std::deque<std::vector<std::shared_ptrDB::MergeTreeData::PartLoadingTree::Node, std::allocator<std::shared_ptrDB::MergeTreeData::PartLoadingTree::Node>>, std::allocator<std::vector<std::shared_ptrDB::MergeTreeData::PartLoadingTree::Node, std::allocator<std::shared_ptrDB::MergeTreeData::PartLoadingTree::Node>>>>>&, std::shared_ptr<DB::MergeTreeSettings const> const&)::$_19, void ()>>(std::__function::__policy_storage const*) @ 0x14849bd4 in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  11. ThreadPoolImpl<ThreadFromGlobalPoolImpl>::worker(std::__list_iterator<ThreadFromGlobalPoolImpl, void*>) @ 0xea1a4ed in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  12. ThreadFromGlobalPoolImpl::ThreadFromGlobalPoolImpl<void ThreadPoolImpl<ThreadFromGlobalPoolImpl>::scheduleImpl(std::function<void ()>, long, std::optional, bool)::'lambda0'()>(void&&)::'lambda'()::operator()() @ 0xea1d09b in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  13. ThreadPoolImplstd::thread::worker(std::__list_iterator<std::thread, void*>) @ 0xea183cd in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
  14. void* std::__thread_proxy[abi:v15000]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_deletestd::__thread_struct>, void ThreadPoolImplstd::thread::scheduleImpl(std::function<void ()>, long, std::optional, bool)::'lambda0'()>>(void*) @ 0xea1b6ae in /home/zhang/clickhouse-test/clickhouse/bin/clickhouse
@cangyin
Copy link
Contributor

cangyin commented Mar 21, 2023

see #47607
if you encounter 'invalid segment id' error, see #47663

inverted index is still in experimental state.

@zhangjmruc
Copy link
Contributor Author

@cangyin Thanks for your reply. I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants