limit the logs about rescheduling

This commit is contained in:
Sema Checherinda 2024-07-09 17:12:55 +02:00
parent 5b9c74b4b8
commit b539d999cd
2 changed files with 4 additions and 1 deletions

View File

@ -837,6 +837,7 @@ DatabaseCatalog::DatabaseCatalog(ContextMutablePtr global_context_)
, loading_dependencies{"LoadingDeps"}
, view_dependencies{"ViewDeps"}
, log(getLogger("DatabaseCatalog"))
, limitedLog(std::make_shared<LogSeriesLimiter>(log, 1, 5))
, first_async_drop_in_queue(tables_marked_dropped.end())
{
}
@ -1273,7 +1274,7 @@ void DatabaseCatalog::rescheduleDropTableTask()
if (first_async_drop_in_queue != tables_marked_dropped.begin())
{
LOG_TRACE(
log,
limitedLog,
"Have {} tables in queue to drop. Some of them are being dropped in sync mode. Schedule background task ASAP",
tables_marked_dropped.size());
(*drop_task)->scheduleAfter(0);

View File

@ -7,6 +7,7 @@
#include <Parsers/IAST_fwd.h>
#include <Storages/IStorage_fwd.h>
#include <Common/SharedMutex.h>
#include <Common/logger_useful.h>
#include <boost/noncopyable.hpp>
#include <Poco/Logger.h>
@ -325,6 +326,7 @@ private:
TablesDependencyGraph view_dependencies TSA_GUARDED_BY(databases_mutex);
LoggerPtr log;
LogSeriesLimiterPtr limitedLog;
std::atomic_bool is_shutting_down = false;