You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by hu...@apache.org on 2022/11/04 02:35:57 UTC

[incubator-kvrocks] branch unstable updated: [BugFix] Fixing logging initialized before loaded (#1061)

This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 06e029b5 [BugFix] Fixing logging initialized before loaded (#1061)
06e029b5 is described below

commit 06e029b5744d8f91acc1462a0a083b45fe3e506d
Author: mwish <ma...@gmail.com>
AuthorDate: Fri Nov 4 10:35:52 2022 +0800

    [BugFix] Fixing logging initialized before loaded (#1061)
---
 src/config/config.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/config/config.cc b/src/config/config.cc
index 08332610..ac1e0465 100644
--- a/src/config/config.cc
+++ b/src/config/config.cc
@@ -354,8 +354,9 @@ void Config::initFieldCallback() {
            previous_backup = std::move(backup_dir);
            backup_dir = v;
          }
-         if (!previous_backup.empty()) {
-           LOG(INFO) << "change backup dir from " << backup_dir << " to " << v;
+         if (!previous_backup.empty() && srv != nullptr && !srv->IsLoading()) {
+           // LOG(INFO) should be called after log is initialized and server is loaded.
+           LOG(INFO) << "change backup dir from " << previous_backup << " to " << v;
          }
          return Status::OK();
        }},