This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 71e3d585874 branch-4.0: [fix](auto-partition) Replace std::mutex with
bthread::Mutex in VTabletWriter #57508 (#57660)
71e3d585874 is described below
commit 71e3d58587420c1fd54f879beaf5c9668119b988
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Nov 4 18:09:14 2025 +0800
branch-4.0: [fix](auto-partition) Replace std::mutex with bthread::Mutex in
VTabletWriter #57508 (#57660)
Cherry-picked from #57508
Co-authored-by: Xin Liao <[email protected]>
---
be/src/vec/sink/writer/vtablet_writer.cpp | 4 ++--
be/src/vec/sink/writer/vtablet_writer.h | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/be/src/vec/sink/writer/vtablet_writer.cpp
b/be/src/vec/sink/writer/vtablet_writer.cpp
index 8b6b2991861..d7a269287af 100644
--- a/be/src/vec/sink/writer/vtablet_writer.cpp
+++ b/be/src/vec/sink/writer/vtablet_writer.cpp
@@ -1281,7 +1281,7 @@ void VTabletWriter::_send_batch_process() {
while (true) {
// incremental open will temporarily make channels into abnormal
state. stop checking when this.
- std::unique_lock<std::mutex> l(_stop_check_channel);
+ std::unique_lock<bthread::Mutex> l(_stop_check_channel);
int running_channels_num = 0;
int opened_nodes = 0;
@@ -1584,7 +1584,7 @@ Status VTabletWriter::_init(RuntimeState* state,
RuntimeProfile* profile) {
Status VTabletWriter::_incremental_open_node_channel(
const std::vector<TOlapTablePartition>& partitions) {
// do what we did in prepare() for partitions. indexes which don't change
when we create new partition is orthogonal to partitions.
- std::unique_lock<std::mutex> _l(_stop_check_channel);
+ std::unique_lock<bthread::Mutex> _l(_stop_check_channel);
for (int i = 0; i < _schema->indexes().size(); ++i) {
const OlapTableIndexSchema* index = _schema->indexes()[i];
std::vector<TTabletWithPartition> tablets;
diff --git a/be/src/vec/sink/writer/vtablet_writer.h
b/be/src/vec/sink/writer/vtablet_writer.h
index 564ed80aa81..3e0dd298fb0 100644
--- a/be/src/vec/sink/writer/vtablet_writer.h
+++ b/be/src/vec/sink/writer/vtablet_writer.h
@@ -31,6 +31,8 @@
#include <google/protobuf/stubs/callback.h>
// IWYU pragma: no_include <bits/chrono.h>
+#include <bthread/mutex.h>
+
#include <atomic>
#include <chrono> // IWYU pragma: keep
#include <cstddef>
@@ -693,7 +695,7 @@ private:
std::unique_ptr<OlapTabletFinder> _tablet_finder;
// index_channel
- std::mutex _stop_check_channel;
+ bthread::Mutex _stop_check_channel;
std::vector<std::shared_ptr<IndexChannel>> _channels;
std::unordered_map<int64_t, std::shared_ptr<IndexChannel>>
_index_id_to_channel;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]