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


The following commit(s) were added to refs/heads/master by this push:
     new 1a99cf1ab KUDU-3599 more robust way of updating tablet copy metrics
1a99cf1ab is described below

commit 1a99cf1abc969b3ba95b72c47948065983aca140
Author: Alexey Serbin <[email protected]>
AuthorDate: Sat Aug 10 19:02:03 2024 -0700

    KUDU-3599 more robust way of updating tablet copy metrics
    
    This patch addresses ThreadSanitizer warnings on accessing recently
    introduced RemoteTabletCopySourceSession::start_time_ field.  That's
    done by using already existing field TabletCopySourceSession::init_once_
    of the thread-safe KuduOnceDynamic type to check if the 'start_time_'
    has already been initialized.
    
    This is a follow-up to d370e0e4511508790c065340a52242ee09ecfea3.
    
    Change-Id: Id78d0df426fcbc5711624eb94b06babd8689d2ba
    Reviewed-on: http://gerrit.cloudera.org:8080/21658
    Reviewed-by: Yingchun Lai <[email protected]>
    Reviewed-by: KeDeng <[email protected]>
    Tested-by: Alexey Serbin <[email protected]>
---
 src/kudu/tserver/tablet_copy_source_session.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/kudu/tserver/tablet_copy_source_session.cc 
b/src/kudu/tserver/tablet_copy_source_session.cc
index 4549e3a1f..cd24c75fa 100644
--- a/src/kudu/tserver/tablet_copy_source_session.cc
+++ b/src/kudu/tserver/tablet_copy_source_session.cc
@@ -515,7 +515,8 @@ Status 
RemoteTabletCopySourceSession::UnregisterAnchorIfNeededUnlocked() {
 }
 
 void RemoteTabletCopySourceSession::UpdateTabletMetrics() {
-  if (PREDICT_TRUE(start_time_.Initialized())) {
+  if (PREDICT_TRUE(IsInitialized())) {
+    DCHECK(start_time_.Initialized());
     tablet_copy_metrics_->copy_duration->Increment(
         (MonoTime::Now() - start_time_).ToMilliseconds());
   }

Reply via email to