1 month ago, I found this issue when trying to use version 20.4.1 even it was not released. Now there is an official release of version 20.4.2 but the issue is still there.
I created an issue on GitHub but there is no update then I want to re-post here
Recently, I upgraded ClickHouse from 19.5.3 to 20.4.2 and I got some issue when trying to load table with Dictionary engine during server's start up in version 20.4.2. (It worked fine with 19.5.3).
I defined a Dictionary xml file with name topics_article and put this xml file under /etc/clickhouse-server/config.d/
My table create statement as:
CREATE TABLE intermediate.topics_article (topic_idString,entryString,type String) ENGINE = Dictionary(topics_article)
I also have setting in config.xml as
However, in version 20.4.2, server can not start successfully during this error:
``2020.05.18 07:25:16.032714 [ 191 ] {} <Information> DatabaseOrdinary (intermediate): Total 30 tables and 0 dictionaries.
2020.05.18 07:25:16.087128 [ 218 ] {}<Error> ThreadPool: Exception in ThreadPool(max_threads: 4, max_free_threads: 4, queue_size: 4, shutdown_on_exception: 1).: Code: 36, e.displayText() = DB::Exception: external dictionary 'topics_article' not found: Cannot attach tableintermediate.topics_articlefrom metadata file /var/lib/clickhouse/metadata/intermediate/topics_article.sql from query ATTACH TABLE topics_article (topic_idString,entryString,type` String) ENGINE = Dictionary('topics_article'), Stack trace (when copying this message, always include the lines below):
What will be if you disable dictionaries_lazy_load ?
@nikitamikhaylov I don't think disable _dictionaries_lazy_load_ should resolve the root cause.
Have the same issue after upgrade 20.1.2.4 => 20.4.2.9, dictionaries_lazy_load=false didn't help.
reproduce
<dictionaries_lazy_load>false</dictionaries_lazy_load>
cat /etc/clickhouse-server/node.tsv
1 xxxx
cat /etc/clickhouse-server/dict/node.xml
<dictionaries>
<dictionary>
<name>node</name>
<source>
<file>
<path>/etc/clickhouse-server/node.tsv</path>
<format>TabSeparated</format>
</file>
</source>
<lifetime>0</lifetime>
<layout><flat /></layout>
<structure>
<id><name>key</name></id>
<attribute>
<name>name</name>
<type>String</type>
<null_value></null_value>
</attribute>
</structure>
</dictionary>
</dictionaries>
cat /var/lib/clickhouse/metadata/default/node.sql
ATTACH TABLE node
(
`key` UInt64,
`name` String
)
ENGINE = Dictionary('node')
DB::Exception: external dictionary 'node' not found: Cannot attach table default.node from metadata file /var/lib/clickhouse/metadata/default/node.sql from query ATTACH TABLE node (key UInt64, name String) ENGINE = Dictionary('node'), Stack trace (when copying this message, always include the lines below):
@vitlibar @alexey-milovidov it's impossible to start CH 20.4+ if one have a table with Engine=Dictionary (old xml dictionary).
to start CH, it needs to remove tables metadata ( rm /var/lib/clickhouse/metadata/default/node.sql ) start CH, create tables.
I'll try to fix it.
@vitlibar @alexey-milovidov it's impossible to start CH 20.4+ if one have a table with Engine=Dictionary (old xml dictionary).
to start CH, it needs to remove tables metadata (
rm /var/lib/clickhouse/metadata/default/node.sql) start CH, create tables.
Is this feature newly added in version 20.x? When I restart the clickhouse in version 19.16, there is no such problem when loading the dictionary. I found that the latest version could not start
@MrSsunlight fixed in 20.6.1.4050+
Most helpful comment
I'll try to fix it.