mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 01:30:51 +00:00
dbms: fixed one of errors [#METR-13979].
This commit is contained in:
parent
76ba1f053b
commit
b2696ffec1
@ -40,10 +40,25 @@ void ReplicatedMergeTreeRestartingThread::run()
|
||||
if (storage.zookeeper->expired())
|
||||
{
|
||||
LOG_WARNING(log, "ZooKeeper session has expired. Switching to a new session.");
|
||||
storage.is_read_only = true;
|
||||
|
||||
partialShutdown();
|
||||
storage.zookeeper = storage.context.getZooKeeper();
|
||||
storage.is_read_only = true;
|
||||
|
||||
do
|
||||
{
|
||||
try
|
||||
{
|
||||
/// TODO race condition при присваивании?
|
||||
storage.zookeeper = storage.context.getZooKeeper();
|
||||
}
|
||||
catch (const zkutil::KeeperException & e)
|
||||
{
|
||||
/// Исключение при попытке zookeeper_init обычно бывает, если не работает DNS. Будем пытаться сделать это заново.
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
wakeup_event.tryWait(10 * 1000);
|
||||
continue;
|
||||
}
|
||||
} while (false);
|
||||
|
||||
while (!need_stop && !tryStartup())
|
||||
wakeup_event.tryWait(10 * 1000);
|
||||
|
Loading…
Reference in New Issue
Block a user