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:05 UTC

[kudu] branch master updated (7e50695 -> 0cc190f)

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

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


    from 7e50695  [scripts] fix y-axis label in benchmarks.sh
     new 79fd2c8  [tablet] txn --> op in tablet_inject_latency_on_apply
     new 0cc190f  [tablet] acquire a lock for DCHECK() only in debug build

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/tablet_replacement-itest.cc |  2 +-
 src/kudu/tablet/ops/op_driver.cc                       |  2 ++
 src/kudu/tablet/ops/write_op.cc                        | 16 ++++++++--------
 3 files changed, 11 insertions(+), 9 deletions(-)


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

Posted by al...@apache.org.
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();


[kudu] 02/02: [tablet] acquire a lock for DCHECK() only in debug build

Posted by al...@apache.org.
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 0cc190f9b149ade571162fe43937ca7dcce8a116
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Fri Aug 7 15:29:34 2020 -0700

    [tablet] acquire a lock for DCHECK() only in debug build
    
    Change-Id: I5b3ffe76f568d5b27bee06c2b8cbed9c954597c2
    Reviewed-on: http://gerrit.cloudera.org:8080/16310
    Tested-by: Alexey Serbin <as...@cloudera.com>
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
---
 src/kudu/tablet/ops/op_driver.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/kudu/tablet/ops/op_driver.cc b/src/kudu/tablet/ops/op_driver.cc
index fe93195..020d81c 100644
--- a/src/kudu/tablet/ops/op_driver.cc
+++ b/src/kudu/tablet/ops/op_driver.cc
@@ -499,11 +499,13 @@ void OpDriver::ApplyTask() {
     return;
   }
 
+#if DCHECK_IS_ON()
   {
     std::lock_guard<simple_spinlock> lock(lock_);
     DCHECK_EQ(replication_state_, REPLICATED);
     DCHECK_EQ(prepare_state_, PREPARED);
   }
+#endif // #if DCHECK_IS_ON() ...
 
   // We need to ref-count ourself, since Commit() may run very quickly
   // and end up calling Finalize() while we're still in this code.