This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new e6ce29f188 [fix](inverted index change) make mutex for 
ALTER_INVERTED_INDEX task and STORAGE_MEDIUM_MIGRATE task (#23033)
e6ce29f188 is described below

commit e6ce29f188bf1fa1f8aced1900635062c109a9ee
Author: YueW <[email protected]>
AuthorDate: Thu Aug 17 08:14:11 2023 +0800

    [fix](inverted index change) make mutex for ALTER_INVERTED_INDEX task and 
STORAGE_MEDIUM_MIGRATE task (#23033)
---
 be/src/olap/task/index_builder.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/be/src/olap/task/index_builder.cpp 
b/be/src/olap/task/index_builder.cpp
index 67e39104c6..147d9c7b93 100644
--- a/be/src/olap/task/index_builder.cpp
+++ b/be/src/olap/task/index_builder.cpp
@@ -398,6 +398,12 @@ Status IndexBuilder::do_build_inverted_index() {
                 "failed to obtain build inverted index lock. tablet={}", 
_tablet->tablet_id());
     }
 
+    std::shared_lock migration_rlock(_tablet->get_migration_lock(), 
std::try_to_lock);
+    if (!migration_rlock.owns_lock()) {
+        return Status::Error<ErrorCode::TRY_LOCK_FAILED>("got migration_rlock 
failed. tablet={}",
+                                                         _tablet->full_name());
+    }
+
     _input_rowsets =
             
_tablet->pick_candidate_rowsets_to_build_inverted_index(_alter_index_ids, 
_is_drop_op);
     if (_input_rowsets.empty()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to