From 4047528bd962c69fed5f3e72e4afa6f54eca88d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chojnowski?= Date: Tue, 13 Sep 2022 14:38:52 +0200 Subject: [PATCH] db: commitlog: don't print INFO logs on shutdown The intention was for these logs to be printed during the database shutdown sequence, but it was overlooked that it's not the only place where commitlog::shutdown is called. Commitlogs are started and shut down periodically by hinted handoff. When that happens, these messages spam the log. Fix that by adding INFO commitlog shutdown logs to database::stop, and change the level of the commitlog::shutdown log call to DEBUG. Fixes #11508 Closes #11536 (cherry picked from commit 9b6fc553b460abf1217c6863d2575ce2f8179c3f) --- db/commitlog/commitlog.cc | 2 +- replica/database.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/db/commitlog/commitlog.cc b/db/commitlog/commitlog.cc index bffd73d006..665cb2ae3a 100644 --- a/db/commitlog/commitlog.cc +++ b/db/commitlog/commitlog.cc @@ -2031,7 +2031,7 @@ future<> db::commitlog::segment_manager::shutdown() { } } co_await _shutdown_promise->get_shared_future(); - clogger.info("Commitlog shutdown complete"); + clogger.debug("Commitlog shutdown complete"); } void db::commitlog::segment_manager::add_file_to_dispose(named_file f, dispose_mode mode) { diff --git a/replica/database.cc b/replica/database.cc index a228caff51..17b5d77340 100644 --- a/replica/database.cc +++ b/replica/database.cc @@ -2240,10 +2240,14 @@ future<> database::stop() { // try to ensure that CL has done disk flushing if (_commitlog) { + dblog.info("Shutting down commitlog"); co_await _commitlog->shutdown(); + dblog.info("Shutting down commitlog complete"); } if (_schema_commitlog) { + dblog.info("Shutting down schema commitlog"); co_await _schema_commitlog->shutdown(); + dblog.info("Shutting down schema commitlog complete"); } co_await _view_update_concurrency_sem.wait(max_memory_pending_view_updates()); if (_commitlog) {