kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [kudu] 01/03: Deflake KsckRemoteTest.TestClusterWithLocation
Date Wed, 01 May 2019 05:20:50 GMT
This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 762ae0f87025441edeba65004cfbead8aa67346b
Author: Will Berkeley <wdberkeley@gmail.com>
AuthorDate: Tue Apr 30 09:50:24 2019 -0700

    Deflake KsckRemoteTest.TestClusterWithLocation
    Ksck::CheckMasterConsensus did not reset a boolean flag indicating
    whether a master consensus conflict had been found. This meant that, if
    an instance of the Ksck object was being used to check repeatedly for
    master consensus conflict, it would fail to recognize if the conflict
    went away. Indeed, this was happening in
    RemoteKsckTest.TestClusterWithLocation and made the test about 1% flaky
    on debug (8/1000 failed). I ran 1000 runs on debug with this fix and saw
    no failures.
    Also, the CheckMasterHealth and CheckMasterUnusualFlags calls
    outside ASSERT_EVENTUALLY are unnecessary. I removed them.
    Change-Id: I3cfffad1c997a820834fadb55491691ea29ffaa2
    Reviewed-on: http://gerrit.cloudera.org:8080/13198
    Reviewed-by: Adar Dembo <adar@cloudera.com>
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
    Tested-by: Will Berkeley <wdberkeley@gmail.com>
 src/kudu/tools/ksck.cc             | 3 +++
 src/kudu/tools/ksck_remote-test.cc | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index ab28cdd..0a77cc0 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -230,6 +230,9 @@ Status Ksck::CheckMasterHealth() {
 Status Ksck::CheckMasterConsensus() {
+  // Reset this instance's view of master consensus conflict, in case this
+  // instance is being used to repeatedly check for master consensus conflict.
+  results_.master_consensus_conflict = false;
   if (!FLAGS_consensus) {
     return Status::OK();
diff --git a/src/kudu/tools/ksck_remote-test.cc b/src/kudu/tools/ksck_remote-test.cc
index edbe060..fc76b4c 100644
--- a/src/kudu/tools/ksck_remote-test.cc
+++ b/src/kudu/tools/ksck_remote-test.cc
@@ -527,8 +527,6 @@ TEST_F(RemoteKsckTest, TestClusterWithLocation) {
   ASSERT_EQ(4, mini_cluster_->num_tablet_servers());
-  ASSERT_OK(ksck_->CheckMasterHealth());
-  ASSERT_OK(ksck_->CheckMasterUnusualFlags());
   // In case of TSAN builds and running the test at inferior machines
   // with lot of concurrent activity, the masters and tablet servers run Raft
   // re-elections from time to time. Also, establishing and negotiation

View raw message