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

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

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.