Merge pull request #35071 from azat/fix-buffer-flush_time

Take flush_time into account for scheduling background flush of the Buffer
This commit is contained in:
Antonio Andelic 2022-03-09 08:54:39 +01:00 committed by GitHub
commit 6a9c293b92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1000,7 +1000,8 @@ void StorageBuffer::reschedule()
size_t min = std::max<ssize_t>(min_thresholds.time - time_passed, 1);
size_t max = std::max<ssize_t>(max_thresholds.time - time_passed, 1);
flush_handle->scheduleAfter(std::min(min, max) * 1000);
size_t flush = std::max<ssize_t>(flush_thresholds.time - time_passed, 1);
flush_handle->scheduleAfter(std::min({min, max, flush}) * 1000);
}
void StorageBuffer::checkAlterIsPossible(const AlterCommands & commands, ContextPtr local_context) const