From commits-return-7744-archive-asf-public=cust-asf.ponee.io@kudu.apache.org Sat Aug 3 04:45:07 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C0DD0180654 for ; Sat, 3 Aug 2019 06:45:06 +0200 (CEST) Received: (qmail 89243 invoked by uid 500); 3 Aug 2019 04:45:06 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 89214 invoked by uid 99); 3 Aug 2019 04:45:05 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Aug 2019 04:45:05 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id A996785ED2; Sat, 3 Aug 2019 04:45:05 +0000 (UTC) Date: Sat, 03 Aug 2019 04:45:06 +0000 To: "commits@kudu.apache.org" Subject: [kudu] 01/02: testcase: with CheckRowCount instead of CheckRowCountWithRetries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: adar@apache.org In-Reply-To: <156480750560.16989.16318886730924665555@gitbox.apache.org> References: <156480750560.16989.16318886730924665555@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: kudu X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 46d186718f64e2c80fdd0bea8216a78e2a27af8f X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20190803044505.A996785ED2@gitbox.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 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 Tested-by: Adar Dembo --- 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 -#include #include #include @@ -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 {};