kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject kudu git commit: KUDU-2314 Fix printing empty wal & metadata dirs
Date Tue, 19 Jun 2018 15:22:17 GMT
Repository: kudu
Updated Branches:
  refs/heads/master a4fd712eb -> 4ea99dd07


KUDU-2314 Fix printing empty wal & metadata dirs

Change-Id: I8055b09f46d50b13a53bc53b28795c2bc4338d33
Reviewed-on: http://gerrit.cloudera.org:8080/10734
Reviewed-by: Andrew Wong <awong@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/4ea99dd0
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/4ea99dd0
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/4ea99dd0

Branch: refs/heads/master
Commit: 4ea99dd079cd5d95c3e7f2e8653ae26e4896a3b6
Parents: a4fd712
Author: fwang29 <fwang@cloudera.com>
Authored: Fri Jun 15 13:10:39 2018 -0700
Committer: Andrew Wong <awong@cloudera.com>
Committed: Mon Jun 18 23:40:32 2018 +0000

----------------------------------------------------------------------
 src/kudu/fs/fs_manager-test.cc | 15 +++++++++++++++
 src/kudu/fs/fs_manager.cc      | 12 ++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/4ea99dd0/src/kudu/fs/fs_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_manager-test.cc b/src/kudu/fs/fs_manager-test.cc
index 6e1bfd3..194ecef 100644
--- a/src/kudu/fs/fs_manager-test.cc
+++ b/src/kudu/fs/fs_manager-test.cc
@@ -37,6 +37,7 @@
 #include "kudu/fs/block_manager.h"
 #include "kudu/fs/data_dirs.h"
 #include "kudu/fs/fs_manager.h"
+#include "kudu/fs/fs_report.h"
 #include "kudu/gutil/map-util.h"
 #include "kudu/gutil/port.h"
 #include "kudu/gutil/stringprintf.h"
@@ -998,4 +999,18 @@ TEST_F(FsManagerTestBase, TestAddRemoveDataDirsFuzz) {
   }
 }
 
+TEST_F(FsManagerTestBase, TestAncillaryDirsReported) {
+  FsManagerOpts opts;
+  opts.wal_root = GetTestPath("wal");
+  opts.data_roots = { GetTestPath("data") };
+  opts.metadata_root = GetTestPath("metadata");
+  ReinitFsManagerWithOpts(opts);
+  ASSERT_OK(fs_manager()->CreateInitialFileSystemLayout());
+  fs::FsReport report;
+  ASSERT_OK(fs_manager()->Open(&report));
+  string report_str = report.ToString();
+  ASSERT_STR_CONTAINS(report_str, "wal directory: " + opts.wal_root);
+  ASSERT_STR_CONTAINS(report_str, "metadata directory: " + opts.metadata_root);
+}
+
 } // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/4ea99dd0/src/kudu/fs/fs_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/fs/fs_manager.cc b/src/kudu/fs/fs_manager.cc
index df0b13e..8c08f34 100644
--- a/src/kudu/fs/fs_manager.cc
+++ b/src/kudu/fs/fs_manager.cc
@@ -412,18 +412,18 @@ Status FsManager::Open(FsReport* report) {
   error_manager_->SetErrorNotificationCb(ErrorHandlerType::DISK,
       Bind(&DataDirManager::MarkDataDirFailedByUuid, Unretained(dd_manager_.get())));
 
-  // Report wal and metadata directories.
-  if (report) {
-    report->wal_dir = canonicalized_wal_fs_root_.path;
-    report->metadata_dir = canonicalized_metadata_fs_root_.path;
-  }
-
   // Finally, initialize and open the block manager.
   InitBlockManager();
   LOG_TIMING(INFO, "opening block manager") {
     RETURN_NOT_OK(block_manager_->Open(report));
   }
 
+  // Report wal and metadata directories.
+  if (report) {
+    report->wal_dir = canonicalized_wal_fs_root_.path;
+    report->metadata_dir = canonicalized_metadata_fs_root_.path;
+  }
+
   if (FLAGS_enable_data_block_fsync) {
     // Files/directories created by the directory manager in the fs roots have
     // been synchronized, so now is a good time to sync the roots themselves.


Mime
View raw message