Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 部署tiflash启动失败
【TiDB Usage Environment】Production Environment or Test Environment or POC
【TiDB Version】V6.2.0
【Encountered Problem】TiFlash failed to start
【Reproduction Path】What operations were performed to encounter the problem
After deploying the TiDB cluster through tidb-operator, deploy TiFlash separately
【Problem Phenomenon and Impact】
TiFlash failed to start.
【Attachments】Related logs and monitoring (https://metricstool.pingcap.com/)
[2022/08/23 11:16:51.617 +00:00] [ERROR] [<unknown>] ["Application:DB::Exception: The configuration \"storage.raft.dir\" should be an array of strings. Please check your configuration file."] [thread_id=1]
Corresponding source code
Call point
if (auto kvstore_paths = get_checked_qualified_array(table, "raft.dir"); kvstore_paths)
kvstore_data_path = *kvstore_paths;
Error point
auto get_checked_qualified_array = [log](const std::shared_ptr<cpptoml::table> table, const char * key) -> cpptoml::option<Strings> {
auto throw_invalid_value = [log, key]() {
String error_msg = fmt::format("The configuration \"storage.{}\" should be an array of strings. Please check your configuration file.", key);
LOG_FMT_ERROR(log, "{}", error_msg);
throw Exception(error_msg, ErrorCodes::INVALID_CONFIG_PARAMETER);
};
// not exist key
if (!table->contains_qualified(key))
return cpptoml::option<Strings>();
// key exist, but not array
auto qualified_ptr = table->get_qualified(key);
if (!qualified_ptr->is_array())
{
throw_invalid_value();
}
// key exist, but can not convert to string array, maybe it is an int array
auto string_array = table->get_qualified_array_of<String>(key);
if (!string_array)
{
throw_invalid_value();
}
return string_array;
};
If the question is about performance optimization or troubleshooting, please download the script and run it. Please select all and copy-paste the terminal output.