mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Merge pull request #40720 from ClickHouse/fix_benign_race
Fix benign race in database replicated worker
This commit is contained in:
commit
4ed375ca5b
@ -133,10 +133,10 @@ bool DatabaseReplicatedDDLWorker::waitForReplicaToProcessAllEntries(UInt64 timeo
|
||||
return true;
|
||||
|
||||
auto max_log = DDLTask::getLogEntryName(max_log_ptr);
|
||||
LOG_TRACE(log, "Waiting for worker thread to process all entries before {}, current task is {}", max_log, current_task);
|
||||
|
||||
{
|
||||
std::unique_lock lock{mutex};
|
||||
LOG_TRACE(log, "Waiting for worker thread to process all entries before {}, current task is {}", max_log, current_task);
|
||||
bool processed = wait_current_task_change.wait_for(lock, std::chrono::milliseconds(timeout_ms), [&]()
|
||||
{
|
||||
return zookeeper->expired() || current_task == max_log || stop_flag;
|
||||
@ -146,8 +146,6 @@ bool DatabaseReplicatedDDLWorker::waitForReplicaToProcessAllEntries(UInt64 timeo
|
||||
return false;
|
||||
}
|
||||
|
||||
LOG_TRACE(log, "Waiting for worker thread to process all entries before {}, current task is {}", max_log, current_task);
|
||||
|
||||
/// Lets now wait for max_log_ptr to be processed
|
||||
Coordination::Stat stat;
|
||||
auto event_ptr = std::make_shared<Poco::Event>();
|
||||
|
Loading…
Reference in New Issue
Block a user