ignore session expired errors after BC check

This commit is contained in:
Alexander Tokmakov 2022-12-12 14:02:14 +01:00
parent f4bc44f729
commit 469406c494
2 changed files with 29 additions and 16 deletions

View File

@ -497,6 +497,7 @@ else
-e "Coordination::Exception: Connection loss" \
-e "MutateFromLogEntryTask" \
-e "No connection to ZooKeeper, cannot get shared table ID" \
-e "Session expired" \
/var/log/clickhouse-server/clickhouse-server.backward.clean.log | zgrep -Fa "<Error>" > /test_output/bc_check_error_messages.txt \
&& echo -e 'Backward compatibility check: Error message in clickhouse-server.log (see bc_check_error_messages.txt)\tFAIL' >> /test_output/test_results.tsv \
|| echo -e 'Backward compatibility check: No Error messages in clickhouse-server.log\tOK' >> /test_output/test_results.tsv

View File

@ -356,6 +356,8 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree(
bool skip_sanity_checks = false;
/// It does not make sense for CREATE query
if (attach)
{
try
{
if (current_zookeeper && current_zookeeper->exists(replica_path + "/host"))
{
@ -369,7 +371,10 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree(
skip_sanity_checks = true;
current_zookeeper->remove(replica_path + "/flags/force_restore_data");
LOG_WARNING(log, "Skipping the limits on severity of changes to data parts and columns (flag {}/flags/force_restore_data).", replica_path);
LOG_WARNING(
log,
"Skipping the limits on severity of changes to data parts and columns (flag {}/flags/force_restore_data).",
replica_path);
}
else if (has_force_restore_data_flag)
{
@ -378,6 +383,13 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree(
LOG_WARNING(log, "Skipping the limits on severity of changes to data parts and columns (flag force_restore_data).");
}
}
catch (const Coordination::Exception & e)
{
if (!Coordination::isHardwareError(e.code))
throw;
LOG_ERROR(log, "Caught exception while checking table metadata in ZooKeeper, will recheck later: {}", e.displayText());
}
}
loadDataParts(skip_sanity_checks);