mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fix error_count in case of distributed_directory_monitor_max_sleep_time_ms>5min
In this case the error counter will be decremented everytime. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
8c69c14d4a
commit
638d0102f8
@ -218,6 +218,15 @@ void DistributedAsyncInsertDirectoryQueue::run()
|
||||
/// No errors while processing existing files.
|
||||
/// Let's see maybe there are more files to process.
|
||||
do_sleep = false;
|
||||
|
||||
const auto now = std::chrono::system_clock::now();
|
||||
if (now - last_decrease_time > decrease_error_count_period)
|
||||
{
|
||||
std::lock_guard status_lock(status_mutex);
|
||||
|
||||
status.error_count /= 2;
|
||||
last_decrease_time = now;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@ -236,15 +245,6 @@ void DistributedAsyncInsertDirectoryQueue::run()
|
||||
else
|
||||
LOG_TEST(LogFrequencyLimiter(log, 30), "Skipping send data over distributed table.");
|
||||
|
||||
const auto now = std::chrono::system_clock::now();
|
||||
if (now - last_decrease_time > decrease_error_count_period)
|
||||
{
|
||||
std::lock_guard status_lock(status_mutex);
|
||||
|
||||
status.error_count /= 2;
|
||||
last_decrease_time = now;
|
||||
}
|
||||
|
||||
if (do_sleep)
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user