yiguolei commented on code in PR #21948:
URL: https://github.com/apache/doris/pull/21948#discussion_r1266884072


##########
be/src/olap/tablet.h:
##########
@@ -772,6 +772,7 @@ inline int Tablet::version_count() const {
 }
 
 inline Version Tablet::max_version() const {
+    std::shared_lock rdlock(_meta_lock);

Review Comment:
   it is very dangerous because many method call this method. For example, 
Status EngineCloneTask::_finish_full_clone(Tablet* tablet,
                                              const TabletMetaSharedPtr& 
cloned_tablet_meta) {
       Version cloned_max_version = cloned_tablet_meta->max_version();
       LOG(INFO) << "begin to finish full clone. tablet=" << tablet->full_name()
                 << ", cloned_max_version=" << cloned_max_version;
   
   But it already hold header lock in the other method:
       std::lock_guard<std::shared_mutex> wrlock(tablet->get_header_lock());
       SCOPED_SIMPLE_TRACE_IF_TIMEOUT(TRACE_TABLET_LOCK_THRESHOLD);
       if (is_incremental_clone) {
           status = _finish_incremental_clone(tablet, cloned_tablet_meta, 
committed_version);
       } else {
           status = _finish_full_clone(tablet, cloned_tablet_meta);
       }
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to