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 619bec52149 [fix](full compaction) Full compaction should hold meta
lock when modifying tablet's meta data #28449 (#28490)
619bec52149 is described below
commit 619bec521493d6ca0ccad13277c7e900cb3595fb
Author: bobhan1 <[email protected]>
AuthorDate: Sat Dec 16 19:40:58 2023 +0800
[fix](full compaction) Full compaction should hold meta lock when modifying
tablet's meta data #28449 (#28490)
---
be/src/olap/full_compaction.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/be/src/olap/full_compaction.cpp b/be/src/olap/full_compaction.cpp
index e95d6750ad3..c0c64a96a80 100644
--- a/be/src/olap/full_compaction.cpp
+++ b/be/src/olap/full_compaction.cpp
@@ -117,8 +117,12 @@ Status FullCompaction::modify_rowsets(const
Merger::Statistics* stats) {
_full_compaction_update_delete_bitmap(_output_rowset,
_output_rs_writer.get()));
}
std::vector<RowsetSharedPtr> output_rowsets(1, _output_rowset);
- RETURN_IF_ERROR(_tablet->modify_rowsets(output_rowsets, _input_rowsets,
true));
- _tablet->save_meta();
+ {
+ std::lock_guard<std::mutex>
rowset_update_wlock(_tablet->get_rowset_update_lock());
+ std::lock_guard<std::shared_mutex>
meta_wlock(_tablet->get_header_lock());
+ RETURN_IF_ERROR(_tablet->modify_rowsets(output_rowsets,
_input_rowsets, true));
+ _tablet->save_meta();
+ }
return Status::OK();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]