This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new deb03e42395 branch-3.1: [fix](auto-partition) Replace std::mutex with
bthread::Mutex in VTabletWriter #57508 (#57659)
deb03e42395 is described below
commit deb03e423957fd2d25cca748a578ca9ae61b9989
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Nov 7 15:32:27 2025 +0800
branch-3.1: [fix](auto-partition) Replace std::mutex with bthread::Mutex in
VTabletWriter #57508 (#57659)
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 812cc7cc773..4629236fd5e 100644
--- a/be/src/vec/sink/writer/vtablet_writer.cpp
+++ b/be/src/vec/sink/writer/vtablet_writer.cpp
@@ -1280,7 +1280,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;
@@ -1583,7 +1583,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 554a2d711a4..70aeb2d0e16 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]