kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aw...@apache.org
Subject [3/3] kudu git commit: Add TS UUID to alter_table-randomized-test "restart TS" step
Date Tue, 06 Nov 2018 01:17:39 GMT
Add TS UUID to alter_table-randomized-test "restart TS" step

While debugging a failure of the randomized alter test, I needed to know
which tablet server was restarted. The test's logs for it are

I1102 21:39:02.323911  7768 alter_table-randomized-test.cc:120] Restarting TS 2
I1102 21:39:02.430003  7768 alter_table-randomized-test.cc:125] TS 2 Restarted

which don't help me so much because I don't know which UUID is which
index. It's possible to use the startup messages in the logs to figure
out which UUID was restarted, but it'd be easier if it were just logged.
So that's what it does now:

I1105 10:17:26.197420 2830984064 alter_table-randomized-test.cc:122] Restarting TS fef46d70bd71410c8caa0aeb2a3cbafc
(index 2)
I1105 10:17:26.375321 2830984064 alter_table-randomized-test.cc:126] TS fef46d70bd71410c8caa0aeb2a3cbafc
(index 2) restarted

Change-Id: Ifbd2ee5ca3e3d7788812162e6188905adc3a6ec3
Reviewed-on: http://gerrit.cloudera.org:8080/11877
Reviewed-by: Andrew Wong <awong@cloudera.com>
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>


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

Branch: refs/heads/master
Commit: d63fbc9b2ebd6b08634f127261c089ea3c1643bb
Parents: 000f2cd
Author: Will Berkeley <wdberkeley@gmail.org>
Authored: Mon Nov 5 10:09:41 2018 -0800
Committer: Will Berkeley <wdberkeley@gmail.com>
Committed: Mon Nov 5 21:05:21 2018 +0000

----------------------------------------------------------------------
 .../integration-tests/alter_table-randomized-test.cc | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/d63fbc9b/src/kudu/integration-tests/alter_table-randomized-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/alter_table-randomized-test.cc b/src/kudu/integration-tests/alter_table-randomized-test.cc
index 7b6cd78..cfe2847 100644
--- a/src/kudu/integration-tests/alter_table-randomized-test.cc
+++ b/src/kudu/integration-tests/alter_table-randomized-test.cc
@@ -75,6 +75,7 @@ using std::pair;
 using std::string;
 using std::unique_ptr;
 using std::vector;
+using strings::Substitute;
 using strings::SubstituteAndAppend;
 
 const char* kTableName = "default.test_table";
@@ -117,12 +118,12 @@ class AlterTableRandomized : public KuduTest,
   }
 
   void RestartTabletServer(int idx) {
-    LOG(INFO) << "Restarting TS " << idx;
-    cluster_->tablet_server(idx)->Shutdown();
-    CHECK_OK(cluster_->tablet_server(idx)->Restart());
-    CHECK_OK(cluster_->WaitForTabletsRunning(cluster_->tablet_server(idx),
-                                             -1, MonoDelta::FromSeconds(60)));
-    LOG(INFO) << "TS " << idx << " Restarted";
+    auto* ts = cluster_->tablet_server(idx);
+    LOG(INFO) << Substitute("Restarting TS $0 (index $1)", ts->uuid(), idx);
+    ts->Shutdown();
+    CHECK_OK(ts->Restart());
+    CHECK_OK(cluster_->WaitForTabletsRunning(ts, -1, MonoDelta::FromSeconds(60)));
+    LOG(INFO) << Substitute("TS $0 (index $1) restarted", ts->uuid(), idx);
   }
 
   void RestartMaster() {
@@ -197,7 +198,7 @@ struct TableState {
 
   string GetRandomNewColumnName() {
     while (true) {
-      string name = strings::Substitute("c$0", rand_.Uniform(1000));
+      string name = Substitute("c$0", rand_.Uniform(1000));
       if (std::find(col_names_.begin(), col_names_.end(), name) == col_names_.end()) {
         return name;
       }


Mime
View raw message