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

dataroaring 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 5f5f0022539 [fix](load)when enable_single_replica_load = true, load 
not timeout as expected (#26503)
5f5f0022539 is described below

commit 5f5f0022539fa893801713212cb98ef6a5986177
Author: xuwei <[email protected]>
AuthorDate: Mon Dec 25 17:00:43 2023 +0800

    [fix](load)when enable_single_replica_load = true, load not timeout as 
expected (#26503)
---
 be/src/vec/sink/vtablet_sink.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/sink/vtablet_sink.cpp b/be/src/vec/sink/vtablet_sink.cpp
index dac90399dba..281edeafe68 100644
--- a/be/src/vec/sink/vtablet_sink.cpp
+++ b/be/src/vec/sink/vtablet_sink.cpp
@@ -157,12 +157,16 @@ void IndexChannel::mark_as_failed(const VNodeChannel* 
node_channel, const std::s
 
     {
         std::lock_guard<doris::SpinLock> l(_fail_lock);
+        int least_tablet_success_channel_num = ((_parent->_num_replicas + 1) / 
2);
+        if (_parent->_write_single_replica) {
+            least_tablet_success_channel_num = 1;
+        }
         if (tablet_id == -1) {
             for (const auto the_tablet_id : it->second) {
                 _failed_channels[the_tablet_id].insert(node_id);
                 _failed_channels_msgs.emplace(the_tablet_id,
                                               err + ", host: " + 
node_channel->host());
-                if (_failed_channels[the_tablet_id].size() >= 
((_parent->_num_replicas + 1) / 2)) {
+                if (_failed_channels[the_tablet_id].size() >= 
least_tablet_success_channel_num) {
                     _intolerable_failure_status =
                             
Status::InternalError(_failed_channels_msgs[the_tablet_id]);
                 }
@@ -170,7 +174,7 @@ void IndexChannel::mark_as_failed(const VNodeChannel* 
node_channel, const std::s
         } else {
             _failed_channels[tablet_id].insert(node_id);
             _failed_channels_msgs.emplace(tablet_id, err + ", host: " + 
node_channel->host());
-            if (_failed_channels[tablet_id].size() >= ((_parent->_num_replicas 
+ 1) / 2)) {
+            if (_failed_channels[tablet_id].size() >= 
least_tablet_success_channel_num) {
                 _intolerable_failure_status =
                         
Status::InternalError(_failed_channels_msgs[tablet_id]);
             }


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

Reply via email to