Repository: kudu
Updated Branches:
  refs/heads/master 7b6cc8459 -> 2bff29b59


Fix log message when there's too few data dirs for a data dir group

The address of the dirs full and dirs failed metrics were being
logged instead of the metric value:

I0201 14:45:22.566895  3316 data_dirs.cc:930] Could only allocate 1 dirs of 
requested 3 for tablet 78a4a8db9829474e84b7a5474c9114fd. 1 dirs total, 
0x379c750 dirs full, 0x37599b0 dirs failed

Change-Id: I877d335a75625a087e4e9027b7f311fc8c0805c9
Reviewed-on: http://gerrit.cloudera.org:8080/9194
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <aw...@cloudera.com>


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

Branch: refs/heads/master
Commit: 6d8694cac2a601e97693afc81eb01bf189b7886f
Parents: 7b6cc84
Author: Will Berkeley <wdberke...@apache.org>
Authored: Fri Feb 2 10:29:31 2018 -0800
Committer: Andrew Wong <aw...@cloudera.com>
Committed: Fri Feb 2 22:35:06 2018 +0000

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


http://git-wip-us.apache.org/repos/asf/kudu/blob/6d8694ca/src/kudu/fs/data_dirs.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/data_dirs.cc b/src/kudu/fs/data_dirs.cc
index 163cec7..5b7e4cd 100644
--- a/src/kudu/fs/data_dirs.cc
+++ b/src/kudu/fs/data_dirs.cc
@@ -126,6 +126,7 @@ using std::unordered_map;
 using std::unordered_set;
 using std::vector;
 using strings::Substitute;
+using strings::SubstituteAndAppend;
 
 
 namespace {
@@ -924,10 +925,10 @@ Status DataDirManager::CreateDataDirGroup(const string& 
tablet_id,
                               "$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());
+        SubstituteAndAppend(&msg, ", $0 dirs full, $1 dirs failed",
+                            metrics_->data_dirs_full->value(), 
metrics_->data_dirs_failed->value());
       }
-      LOG(INFO) << Substitute(msg);
+      LOG(INFO) << msg;
     }
   }
   InsertOrDie(&group_by_tablet_map_, tablet_id, DataDirGroup(group_indices));

Reply via email to