Merge pull request #26808 from amosbird/safe2

Make sure table is readonly when restarting fails.
This commit is contained in:
tavplubix 2021-07-27 17:21:08 +03:00 committed by GitHub
commit 168edaed73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,8 @@ void ReplicatedMergeTreeRestartingThread::run()
/// The exception when you try to zookeeper_init usually happens if DNS does not work. We will try to do it again.
tryLogCurrentException(log, __PRETTY_FUNCTION__);
/// Here we're almost sure the table is already readonly, but it doesn't hurt to enforce it.
setReadonly();
if (first_time)
storage.startup_event.set();
task->scheduleAfter(retry_period_ms);