kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [kudu] 01/02: testcase: with CheckRowCount instead of CheckRowCountWithRetries
Date Sat, 03 Aug 2019 04:45:06 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 46d186718f64e2c80fdd0bea8216a78e2a27af8f
Author: Xiaokai Wang <xiaokai.wang@live.com>
AuthorDate: Sat Aug 3 09:30:07 2019 +0800

    testcase: with CheckRowCount instead of CheckRowCountWithRetries
    
    KUDU-796 was fixed. So, we need not retries when reading after a restart.
    
    Change-Id: I0f2d535bd9519e0cdd3c4f3d63e57c5c3bb53ebd
    Reviewed-on: http://gerrit.cloudera.org:8080/13989
    Reviewed-by: Adar Dembo <adar@cloudera.com>
    Tested-by: Adar Dembo <adar@cloudera.com>
---
 src/kudu/integration-tests/cluster_verifier.cc  | 18 -----------
 src/kudu/integration-tests/cluster_verifier.h   |  6 ----
 src/kudu/integration-tests/ts_recovery-itest.cc | 40 ++++++++++---------------
 3 files changed, 15 insertions(+), 49 deletions(-)

diff --git a/src/kudu/integration-tests/cluster_verifier.cc b/src/kudu/integration-tests/cluster_verifier.cc
index 23d4145..f5b8bd7 100644
--- a/src/kudu/integration-tests/cluster_verifier.cc
+++ b/src/kudu/integration-tests/cluster_verifier.cc
@@ -18,7 +18,6 @@
 #include "kudu/integration-tests/cluster_verifier.h"
 
 #include <memory>
-#include <ostream>
 #include <string>
 #include <vector>
 
@@ -155,21 +154,4 @@ Status ClusterVerifier::DoCheckRowCount(const std::string& table_name,
   return Status::OK();
 }
 
-void ClusterVerifier::CheckRowCountWithRetries(const std::string& table_name,
-                                               ComparisonMode mode,
-                                               int expected_row_count,
-                                               const MonoDelta& timeout) {
-  MonoTime deadline = MonoTime::Now() + timeout;
-  Status s;
-  while (true) {
-    s = DoCheckRowCount(table_name, mode, expected_row_count);
-    if (s.ok() || deadline < MonoTime::Now()) break;
-    LOG(WARNING) << "CheckRowCount() has not succeeded yet: " << s.ToString()
-                 << "... will retry";
-    SleepFor(MonoDelta::FromMilliseconds(100));
-  }
-
-  ASSERT_OK(s);
-}
-
 } // namespace kudu
diff --git a/src/kudu/integration-tests/cluster_verifier.h b/src/kudu/integration-tests/cluster_verifier.h
index f95e742..66d4df0 100644
--- a/src/kudu/integration-tests/cluster_verifier.h
+++ b/src/kudu/integration-tests/cluster_verifier.h
@@ -70,12 +70,6 @@ class ClusterVerifier {
                      ComparisonMode mode,
                      int expected_row_count);
 
-  // The same as above, but retries until a timeout elapses.
-  void CheckRowCountWithRetries(const std::string& table_name,
-                                ComparisonMode mode,
-                                int expected_row_count,
-                                const MonoDelta& timeout);
-
   // Run the ksck utility against the cluster.
   Status RunKsck();
 
diff --git a/src/kudu/integration-tests/ts_recovery-itest.cc b/src/kudu/integration-tests/ts_recovery-itest.cc
index 67a0a76..8c41956 100644
--- a/src/kudu/integration-tests/ts_recovery-itest.cc
+++ b/src/kudu/integration-tests/ts_recovery-itest.cc
@@ -378,16 +378,10 @@ TEST_P(TsRecoveryITest, TestRestartWithOrphanedReplicates) {
   // Restart the server and check to make sure that the change is eventually applied.
   ASSERT_OK(cluster_->tablet_server(0)->Restart());
 
-  // TODO(KUDU-796): after a restart, we may have to replay some
-  // orphaned replicates from the log. However, we currently
-  // allow reading while those are being replayed, which means we
-  // can "go back in time" briefly. So, we have some retries here.
-  // When KUDU-796 is fixed, remove the retries.
   ClusterVerifier v(cluster_.get());
-  NO_FATALS(v.CheckRowCountWithRetries(work.table_name(),
-                                       ClusterVerifier::AT_LEAST,
-                                       work.rows_inserted(),
-                                       MonoDelta::FromSeconds(40)));
+  NO_FATALS(v.CheckRowCount(work.table_name(),
+                            ClusterVerifier::AT_LEAST,
+                            work.rows_inserted()));
 }
 
 // Regression test for KUDU-1477: a pending commit message would cause
@@ -424,10 +418,9 @@ TEST_P(TsRecoveryITest, TestRestartWithPendingCommitFromFailedOp) {
   ASSERT_OK(cluster_->tablet_server(0)->Restart());
 
   ClusterVerifier v(cluster_.get());
-  NO_FATALS(v.CheckRowCountWithRetries(work.table_name(),
-                                       ClusterVerifier::AT_LEAST,
-                                       work.rows_inserted(),
-                                       MonoDelta::FromSeconds(20)));
+  NO_FATALS(v.CheckRowCount(work.table_name(),
+                            ClusterVerifier::AT_LEAST,
+                            work.rows_inserted()));
 }
 
 // Test that we replay from the recovery directory, if it exists.
@@ -469,10 +462,9 @@ TEST_P(TsRecoveryITest, TestCrashDuringLogReplay) {
   ASSERT_OK(cluster_->tablet_server(0)->Restart());
 
   ClusterVerifier v(cluster_.get());
-  NO_FATALS(v.CheckRowCountWithRetries(work.table_name(),
-                                       ClusterVerifier::AT_LEAST,
-                                       work.rows_inserted(),
-                                       MonoDelta::FromSeconds(30)));
+  NO_FATALS(v.CheckRowCount(work.table_name(),
+                            ClusterVerifier::AT_LEAST,
+                            work.rows_inserted()));
 }
 
 // Regression test for KUDU-1551: if the tserver crashes after preallocating a segment
@@ -504,10 +496,9 @@ TEST_P(TsRecoveryITest, TestCrashBeforeWriteLogSegmentHeader) {
   ignore_result(cluster_->tablet_server(0)->Restart());
 
   ClusterVerifier v(cluster_.get());
-  NO_FATALS(v.CheckRowCountWithRetries(work.table_name(),
-                                       ClusterVerifier::AT_LEAST,
-                                       work.rows_inserted(),
-                                       MonoDelta::FromSeconds(60)));
+  NO_FATALS(v.CheckRowCount(work.table_name(),
+                            ClusterVerifier::AT_LEAST,
+                            work.rows_inserted()));
 }
 
 // Test the following scenario:
@@ -553,10 +544,9 @@ TEST_P(TsRecoveryITest, TestChangeMaxCellSize) {
   ts->mutable_flags()->pop_back();
   ASSERT_OK(ts->Restart());
   ClusterVerifier v(cluster_.get());
-  NO_FATALS(v.CheckRowCountWithRetries(work.table_name(),
-                                       ClusterVerifier::EXACTLY,
-                                       work.rows_inserted(),
-                                       MonoDelta::FromSeconds(60)));
+  NO_FATALS(v.CheckRowCount(work.table_name(),
+                            ClusterVerifier::EXACTLY,
+                            work.rows_inserted()));
 }
 
 class TsRecoveryITestDeathTest : public TsRecoveryITest {};


Mime
View raw message