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 cfde052f965388e595640e204aec559e196b6d4c Author: Alexey Serbin <[email protected]> AuthorDate: Thu Jul 9 22:15:56 2020 -0700 [tablet] OpState::op_state_lock_ --> WriteOpState::op_state_lock_ Moved op_state_lock_ from the base OpState class to the WriteOpState: the only class using the sync primitive. This is a follow-up to 386de6caeb19dd490654abff1195e11b5d9625ca. Change-Id: I801604507f09a25b790e74d11be6e270a1abb938 Reviewed-on: http://gerrit.cloudera.org:8080/16165 Tested-by: Kudu Jenkins Reviewed-by: Andrew Wong <[email protected]> --- src/kudu/tablet/ops/op.h | 3 --- src/kudu/tablet/ops/write_op.h | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kudu/tablet/ops/op.h b/src/kudu/tablet/ops/op.h index 73527cb..995104a 100644 --- a/src/kudu/tablet/ops/op.h +++ b/src/kudu/tablet/ops/op.h @@ -310,9 +310,6 @@ class OpState { // The defined consistency mode for this op. ExternalConsistencyMode external_consistency_mode_; - - // Lock that protects access to op state. - mutable simple_spinlock op_state_lock_; }; // A parent class for the callback that gets called when ops diff --git a/src/kudu/tablet/ops/write_op.h b/src/kudu/tablet/ops/write_op.h index 3db4cd6..e803692 100644 --- a/src/kudu/tablet/ops/write_op.h +++ b/src/kudu/tablet/ops/write_op.h @@ -244,7 +244,7 @@ class WriteOpState : public OpState { boost::optional<WriteAuthorizationContext> authz_context_; // The row operations which are decoded from the request during Prepare(). - // Protected by superclass's op_state_lock_. + // Protected by op_state_lock_. std::vector<RowOp*> row_ops_; // Array of ProbeStats for each of the operations in 'row_ops_'. @@ -263,9 +263,12 @@ class WriteOpState : public OpState { // The Schema of the tablet when the op was first decoded. This is verified // at APPLY time to ensure we don't have races against schema change. - // Protected by superclass's op_state_lock_. + // Protected by op_state_lock_. const Schema* schema_at_decode_time_; + // Lock that protects access to various fields of WriteOpState. + mutable simple_spinlock op_state_lock_; + DISALLOW_COPY_AND_ASSIGN(WriteOpState); };
