github-actions[bot] commented on code in PR #26826:
URL: https://github.com/apache/doris/pull/26826#discussion_r1390346152
##########
be/src/exec/tablet_info.h:
##########
@@ -238,6 +242,11 @@ class VOlapTablePartitionParam {
}
}
+ VOlapTablePartition* get_tablet_partition(int64_t tablet_id) const {
Review Comment:
warning: method 'get_tablet_partition' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static VOlapTablePartition* get_tablet_partition(int64_t tablet_id) {
```
##########
be/src/vec/sink/writer/vtablet_writer.cpp:
##########
@@ -444,6 +458,12 @@
}
}
+ DBUG_EXECUTE_IF(
+ "VNodeChannel.open_wait:random_failed",
+ if (rand() % 100 < (100 * dp->param("percent", 0.5))) {
Review Comment:
warning: 0.5 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
if (rand() % 100 < (100 * dp->param("percent", 0.5))) {
^
```
##########
be/src/vec/sink/writer/vtablet_writer.cpp:
##########
@@ -457,6 +477,12 @@
}
Status VNodeChannel::add_block(vectorized::Block* block, const Payload*
payload, bool is_append) {
+ DBUG_EXECUTE_IF(
+ "VNodeChannel.add_block:random_failed",
+ if (rand() % 100 < (100 * dp->param("percent", 0.5))) {
Review Comment:
warning: 0.5 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
if (rand() % 100 < (100 * dp->param("percent", 0.5))) {
^
```
##########
be/src/vec/sink/writer/vtablet_writer.cpp:
##########
@@ -165,22 +166,35 @@ void IndexChannel::mark_as_failed(const VNodeChannel*
node_channel, const std::s
return;
}
+ auto succ_replicas_not_enough = [&](int64_t the_tablet_id) {
+ auto partition =
_parent->_vpartition->get_tablet_partition(the_tablet_id);
Review Comment:
warning: 'auto partition' can be declared as 'auto *partition'
[readability-qualified-auto]
```suggestion
auto *partition =
_parent->_vpartition->get_tablet_partition(the_tablet_id);
```
##########
be/src/runtime/tablets_channel.cpp:
##########
@@ -103,6 +104,13 @@ Status TabletsChannel::open(const
PTabletWriterOpenRequest& request) {
}
LOG(INFO) << "open tablets channel: " << _key << ", tablets num: " <<
request.tablets().size()
<< ", timeout(s): " << request.load_channel_timeout_s();
+
+ DBUG_EXECUTE_IF(
+ "TabletsChannel.open:random_failed",
+ if (rand() % 100 < (100 * dp->param("percent", 0.5))) {
Review Comment:
warning: 0.5 is a magic number; consider replacing it with a named constant
[readability-magic-numbers]
```cpp
if (rand() % 100 < (100 * dp->param("percent", 0.5))) {
^
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]