yiguolei commented on a change in pull request #8387:
URL: https://github.com/apache/incubator-doris/pull/8387#discussion_r822193924



##########
File path: be/src/olap/delta_writer.cpp
##########
@@ -116,8 +116,8 @@ OLAPStatus DeltaWriter::init() {
     }
 
     {
-        ReadLock base_migration_rlock(_tablet->get_migration_lock_ptr(), 
TRY_LOCK);
-        if (!base_migration_rlock.own_lock()) {
+        ReadLock base_migration_rlock(_tablet->get_migration_lock(), 
std::try_to_lock);
+        if (!base_migration_rlock.owns_lock()) {
             return OLAP_ERR_RWLOCK_ERROR;
         }
         MutexLock push_lock(_tablet->get_push_lock());

Review comment:
       what is mutex lock? could it be replaced?

##########
File path: be/src/olap/push_handler.cpp
##########
@@ -86,8 +86,9 @@ OLAPStatus 
PushHandler::_do_streaming_ingestion(TabletSharedPtr tablet, const TP
     if (tablet == nullptr) {
         return OLAP_ERR_TABLE_NOT_FOUND;
     }
-    ReadLock base_migration_rlock(tablet->get_migration_lock_ptr(), TRY_LOCK);
-    if (!base_migration_rlock.own_lock()) {
+
+    ReadLock base_migration_rlock(tablet->get_migration_lock(), 
std::try_to_lock);
+    if (!base_migration_rlock.owns_lock()) {
         return OLAP_ERR_RWLOCK_ERROR;
     }
     tablet->obtain_push_lock();

Review comment:
       If return not ok, the push lock is not released?

##########
File path: be/src/olap/task/engine_clone_task.cpp
##########
@@ -520,103 +520,101 @@ OLAPStatus EngineCloneTask::_finish_clone(Tablet* 
tablet, const string& clone_di
                                           int64_t committed_version, bool 
is_incremental_clone) {
     OLAPStatus res = OLAP_SUCCESS;
     std::vector<string> linked_success_files;
-
     // clone and compaction operation should be performed sequentially
     tablet->obtain_base_compaction_lock();
     tablet->obtain_cumulative_lock();
     tablet->set_clone_occurred(true);
-
     tablet->obtain_push_lock();

Review comment:
       Why not using RAII for push lock?




-- 
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