You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2020/08/07 23:48:06 UTC

[kudu] 01/02: [tablet] txn --> op in tablet_inject_latency_on_apply

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

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

commit 79fd2c8d2797b4e11e78be8c9cb78fdacaa82786
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Fri Aug 7 15:24:25 2020 -0700

    [tablet] txn --> op in tablet_inject_latency_on_apply
    
    Renamed test-only --tablet_inject_latency_on_apply_write_txn_ms flag
    into --tablet_inject_latency_on_apply_write_op_ms.  This patch doesn't
    contain any functional changes.
    
    This is a follow-up to eae52ea669aa63f440d9e452fd01caed3f85330a.
    
    Change-Id: Ieae6ef0c5e038c1ab6ccd6e7ca971461d219d495
    Reviewed-on: http://gerrit.cloudera.org:8080/16309
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
    Tested-by: Alexey Serbin <as...@cloudera.com>
---
 src/kudu/integration-tests/tablet_replacement-itest.cc |  2 +-
 src/kudu/tablet/ops/write_op.cc                        | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/kudu/integration-tests/tablet_replacement-itest.cc b/src/kudu/integration-tests/tablet_replacement-itest.cc
index 096fa78..4cbd217 100644
--- a/src/kudu/integration-tests/tablet_replacement-itest.cc
+++ b/src/kudu/integration-tests/tablet_replacement-itest.cc
@@ -636,7 +636,7 @@ TEST_F(TabletReplacementITest, TestRemoteBoostrapWithPendingConfigChangeCommits)
   // Delay tablet applies in order to delay COMMIT messages to trigger KUDU-1233.
   // Then insert another row.
   ASSERT_OK(cluster_->SetFlag(cluster_->tablet_server_by_uuid(leader_ts->uuid()),
-                              "tablet_inject_latency_on_apply_write_txn_ms", "5000"));
+                              "tablet_inject_latency_on_apply_write_op_ms", "5000"));
 
   // Kick off an async insert, which will be delayed for 5 seconds. This is
   // normally enough time to evict a replica, tombstone it, add it back, and
diff --git a/src/kudu/tablet/ops/write_op.cc b/src/kudu/tablet/ops/write_op.cc
index a20cdb5..f4e726c 100644
--- a/src/kudu/tablet/ops/write_op.cc
+++ b/src/kudu/tablet/ops/write_op.cc
@@ -63,11 +63,11 @@
 #include "kudu/util/slice.h"
 #include "kudu/util/trace.h"
 
-DEFINE_int32(tablet_inject_latency_on_apply_write_txn_ms, 0,
+DEFINE_int32(tablet_inject_latency_on_apply_write_op_ms, 0,
              "How much latency to inject when a write op is applied. "
              "For testing only!");
-TAG_FLAG(tablet_inject_latency_on_apply_write_txn_ms, unsafe);
-TAG_FLAG(tablet_inject_latency_on_apply_write_txn_ms, runtime);
+TAG_FLAG(tablet_inject_latency_on_apply_write_op_ms, unsafe);
+TAG_FLAG(tablet_inject_latency_on_apply_write_op_ms, runtime);
 
 using std::string;
 using std::unique_ptr;
@@ -228,11 +228,11 @@ Status WriteOp::Apply(CommitMsg** commit_msg) {
   TRACE_EVENT0("op", "WriteOp::Apply");
   TRACE("APPLY: Starting.");
 
-  if (PREDICT_FALSE(
-          ANNOTATE_UNPROTECTED_READ(FLAGS_tablet_inject_latency_on_apply_write_txn_ms) > 0)) {
-    TRACE("Injecting $0ms of latency due to --tablet_inject_latency_on_apply_write_txn_ms",
-          FLAGS_tablet_inject_latency_on_apply_write_txn_ms);
-    SleepFor(MonoDelta::FromMilliseconds(FLAGS_tablet_inject_latency_on_apply_write_txn_ms));
+  if (PREDICT_FALSE(ANNOTATE_UNPROTECTED_READ(
+      FLAGS_tablet_inject_latency_on_apply_write_op_ms) > 0)) {
+    TRACE("Injecting $0ms of latency due to --tablet_inject_latency_on_apply_write_op_ms",
+          FLAGS_tablet_inject_latency_on_apply_write_op_ms);
+    SleepFor(MonoDelta::FromMilliseconds(FLAGS_tablet_inject_latency_on_apply_write_op_ms));
   }
 
   Tablet* tablet = state()->tablet_replica()->tablet();