kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [2/3] kudu git commit: data_dirs: fix logging message
Date Thu, 11 Jan 2018 22:16:24 GMT
data_dirs: fix logging message

If fs_target_data_dirs_per_tablet is set to be greater than the number
of available directories, it will log a message that is dependent on
there being a configured metrics entity, which is not always available.
This patch avoids the potential nullptr access.

This patch also changes the logging to INFO-level instead of
WARNING-level, as the message doesn't necessarily indicate a problem.

Change-Id: I8135e0ad2411524fcb74b3e349bea7a5828a4237
Reviewed-on: http://gerrit.cloudera.org:8080/8999
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/236fc67e
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/236fc67e
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/236fc67e

Branch: refs/heads/master
Commit: 236fc67e1c8168b72e19db29af45bdb7ef115e6c
Parents: 1cf30ef
Author: Andrew Wong <awong@cloudera.com>
Authored: Wed Jan 10 14:03:14 2018 -0800
Committer: Andrew Wong <awong@cloudera.com>
Committed: Thu Jan 11 18:52:02 2018 +0000

----------------------------------------------------------------------
 src/kudu/fs/data_dirs.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/236fc67e/src/kudu/fs/data_dirs.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/data_dirs.cc b/src/kudu/fs/data_dirs.cc
index 7860caa..5f1c461 100644
--- a/src/kudu/fs/data_dirs.cc
+++ b/src/kudu/fs/data_dirs.cc
@@ -824,10 +824,14 @@ Status DataDirManager::CreateDataDirGroup(const string& tablet_id,
       return Status::IOError("All healthy data directories are full", "", ENOSPC);
     }
     if (PREDICT_FALSE(group_indices.size() < FLAGS_fs_target_data_dirs_per_tablet)) {
-      LOG(WARNING) << Substitute("Could only allocate $0 dirs of requested $1 for tablet
$2 ($3 "
-                                 "dirs total, $4 full, $5 failed).", group_indices.size(),
-                                 FLAGS_fs_target_data_dirs_per_tablet, tablet_id, data_dirs_.size(),
-                                 metrics_->data_dirs_full.get(), metrics_->data_dirs_failed.get());
+      string msg = Substitute("Could only allocate $0 dirs of requested $1 for tablet "
+                              "$2. $3 dirs total", group_indices.size(),
+                              FLAGS_fs_target_data_dirs_per_tablet, tablet_id, data_dirs_.size());
+      if (metrics_) {
+        msg = Substitute("$0, $1 dirs full, $2 dirs failed", msg,
+                         metrics_->data_dirs_full.get(), metrics_->data_dirs_failed.get());
+      }
+      LOG(INFO) << Substitute(msg);
     }
   }
   InsertOrDie(&group_by_tablet_map_, tablet_id, DataDirGroup(group_indices));


Mime
View raw message