You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2019/08/03 04:45:05 UTC

[kudu] branch master updated (bc80ccc -> 8c14875)

This is an automated email from the ASF dual-hosted git repository.

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


    from bc80ccc  tools: fix warning when compiling in ASAN and TSAN caused by ConvertToKuduPartialRow.
     new 46d1867  testcase: with CheckRowCount instead of CheckRowCountWithRetries
     new 8c14875  testcase: TestTSRegisters adds ts seqno checking after ts restarts

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/kudu/integration-tests/cluster_verifier.cc  | 18 -----------
 src/kudu/integration-tests/cluster_verifier.h   |  6 ----
 src/kudu/integration-tests/registration-test.cc | 19 +++++++++---
 src/kudu/integration-tests/ts_recovery-itest.cc | 40 ++++++++++---------------
 4 files changed, 30 insertions(+), 53 deletions(-)


[kudu] 01/02: testcase: with CheckRowCount instead of CheckRowCountWithRetries

Posted by ad...@apache.org.
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 <xi...@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 <ad...@cloudera.com>
    Tested-by: Adar Dembo <ad...@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 {};


[kudu] 02/02: testcase: TestTSRegisters adds ts seqno checking after ts restarts

Posted by ad...@apache.org.
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 8c14875659b7edd0f4353e945351eada8d5fb9e3
Author: Xiaokai Wang <xi...@live.com>
AuthorDate: Sat Aug 3 09:43:58 2019 +0800

    testcase: TestTSRegisters adds ts seqno checking after ts restarts
    
    Change-Id: Ic46674c007be05057c0ef614dc097e44b2acf303
    Reviewed-on: http://gerrit.cloudera.org:8080/13988
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
    Tested-by: Adar Dembo <ad...@cloudera.com>
---
 src/kudu/integration-tests/registration-test.cc | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/kudu/integration-tests/registration-test.cc b/src/kudu/integration-tests/registration-test.cc
index def3b9e..4bb712d 100644
--- a/src/kudu/integration-tests/registration-test.cc
+++ b/src/kudu/integration-tests/registration-test.cc
@@ -246,11 +246,22 @@ TEST_F(RegistrationTest, TestTSRegisters) {
   cluster_->mini_master()->Shutdown();
   ASSERT_OK(cluster_->mini_master()->Restart());
 
-  ASSERT_OK(cluster_->WaitForTabletServerCount(1));
+  int64_t seqno = descs.back()->latest_seqno();
+  descs.clear();
+  ASSERT_OK(cluster_->WaitForTabletServerCount(
+      1, InternalMiniCluster::MatchMode::MATCH_TSERVERS, &descs));
+  ASSERT_EQ(descs.back()->latest_seqno(), seqno);
+
+  // Restart the tserver, so it will register, and ensure that it gets the
+  // newer sequence number.
+  cluster_->mini_tablet_server(0)->Shutdown();
+  ASSERT_OK(cluster_->mini_tablet_server(0)->Restart());
 
-  // TODO: when the instance ID / sequence number stuff is implemented,
-  // restart the TS and ensure that it re-registers with the newer sequence
-  // number.
+  seqno = descs.back()->latest_seqno();
+  descs.clear();
+  ASSERT_OK(cluster_->WaitForTabletServerCount(
+      1, InternalMiniCluster::MatchMode::MATCH_TSERVERS, &descs));
+  ASSERT_GT(descs.back()->latest_seqno(), seqno);
 }
 
 TEST_F(RegistrationTest, TestMasterSoftwareVersion) {