Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[only test] #42355

Closed
wants to merge 4 commits into from
Closed

Conversation

Mryange
Copy link
Contributor

@Mryange Mryange commented Oct 23, 2024

Proposed changes

Issue Number: close #xxx

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@Mryange
Copy link
Contributor Author

Mryange commented Oct 23, 2024

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -209,30 +222,37 @@ Status ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_send_rpc' has cognitive complexity of 76 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
                           ^
Additional context

be/src/pipeline/exec/exchange_sink_buffer.cpp:228: +1, including nesting penalty of 0, nesting level increased to 1

    if (_is_finishing) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:233: +1, including nesting penalty of 0, nesting level increased to 1

    if (!q.empty()) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:247: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block && !request.block->column_metas().empty()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:247: +1

        if (request.block && !request.block->column_metas().empty()) {
                          ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:250: +2, including nesting penalty of 1, nesting level increased to 2

        if (!request.exec_status.ok()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:257: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::exchange_sink_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:260: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:263: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:271: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:276: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:284: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:286: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +1, nesting level increased to 3

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:291: +4, including nesting penalty of 3, nesting level increased to 4

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:302: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:303: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:303: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:306: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:311: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:316: +2, including nesting penalty of 1, nesting level increased to 2

        if (_total_queue_size <= _queue_capacity) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:321: +2, including nesting penalty of 1, nesting level increased to 2

        if (_keep_order) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:324: +1, nesting level increased to 1

    } else if (!broadcast_q.empty()) {
           ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:338: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block() &&
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:338: +1

        if (request.block_holder->get_block() &&
                                              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:346: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::exchange_sink_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:349: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:352: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:360: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:365: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:373: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:375: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:378: +1, nesting level increased to 3

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:380: +4, including nesting penalty of 3, nesting level increased to 4

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:391: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:392: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:392: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:395: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:400: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:404: +2, including nesting penalty of 1, nesting level increased to 2

        if (_keep_order) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:407: +1, nesting level increased to 1

    } else {
      ^

@@ -22,9 +22,9 @@
#include <gen_cpp/internal_service.pb.h>
#include <gen_cpp/types.pb.h>
#include <parallel_hashmap/phmap.h>
#include <stdint.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: inclusion of deprecated C++ header 'stdint.h'; consider using 'cstdint' instead [modernize-deprecated-headers]

Suggested change
#include <stdint.h>
#include <cstdint>

}
}
}

Status ExchangeSinkLocalState::open(RuntimeState* state) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'open' has cognitive complexity of 64 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkLocalState::open(RuntimeState* state) {
                               ^
Additional context

be/src/pipeline/exec/exchange_sink_operator.cpp:120: nesting level increased to 1

    SCOPED_TIMER(_open_timer);
    ^

be/src/util/runtime_profile.h:67: expanded from macro 'SCOPED_TIMER'

#define SCOPED_TIMER(c) ScopedTimer<MonotonicStopWatch> MACRO_CONCAT(SCOPED_TIMER, __COUNTER__)(c)
                        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:121: +1, including nesting penalty of 0, nesting level increased to 1

    RETURN_IF_ERROR(Base::open(state));
    ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:121: +2, including nesting penalty of 1, nesting level increased to 2

    RETURN_IF_ERROR(Base::open(state));
    ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:124: +1, including nesting penalty of 0, nesting level increased to 1

    if (_part_type == TPartitionType::UNPARTITIONED || _part_type == TPartitionType::RANDOM ||
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:144: +1, including nesting penalty of 0, nesting level increased to 1

    if (!only_local_exchange) {
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:147: +1, nesting level increased to 1

    } else {
      ^

be/src/pipeline/exec/exchange_sink_operator.cpp:151: +1, including nesting penalty of 0, nesting level increased to 1

    if ((_part_type == TPartitionType::UNPARTITIONED || channels.size() == 1) &&
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:157: +1, nesting level increased to 1

    } else if (local_size > 0) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:172: +1, including nesting penalty of 0, nesting level increased to 1

    if (_part_type == TPartitionType::HASH_PARTITIONED) {
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:176: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_partitioner->init(p._texprs));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:176: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_partitioner->init(p._texprs));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:177: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:177: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:180: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::BUCKET_SHFFULE_HASH_PARTITIONED) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:184: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_partitioner->init(p._texprs));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:184: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_partitioner->init(p._texprs));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:185: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:185: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:188: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::TABLET_SINK_SHUFFLE_PARTITIONED) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:194: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_schema->init(p._tablet_sink_schema));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:194: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_schema->init(p._tablet_sink_schema));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:196: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_vpartition->init());
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:196: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_vpartition->init());
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:226: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::TABLE_SINK_HASH_PARTITIONED) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:249: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_partitioner->init(p._texprs));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:249: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_partitioner->init(p._texprs));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:250: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:250: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_partitioner->prepare(state, p._row_desc));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:255: +1, including nesting penalty of 0, nesting level increased to 1

    if (_part_type == TPartitionType::HASH_PARTITIONED ||
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:258: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_partitioner->open(state));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:258: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_partitioner->open(state));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:259: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::TABLET_SINK_SHUFFLE_PARTITIONED) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:260: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(_row_distribution.open(_tablet_sink_row_desc));
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:260: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(_row_distribution.open(_tablet_sink_row_desc));
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

@@ -383,7 +365,7 @@
Status st) {
channel->set_receiver_eof(st);
// Chanel will not send RPC to the downstream when eof, so close chanel by OK status.
static_cast<void>(channel->close(state));
static_cast<void>(channel->close(state, Status::OK()));
}

Status ExchangeSinkOperatorX::sink(RuntimeState* state, vectorized::Block* block, bool eos) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'sink' has cognitive complexity of 232 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkOperatorX::sink(RuntimeState* state, vectorized::Block* block, bool eos) {
                              ^
Additional context

be/src/pipeline/exec/exchange_sink_operator.cpp:382: +1, including nesting penalty of 0, nesting level increased to 1

    if (all_receiver_eof) {
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:390: +1, including nesting penalty of 0, nesting level increased to 1

    if (_part_type == TPartitionType::UNPARTITIONED || local_state.channels.size() == 1) {
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:394: +2, including nesting penalty of 1, nesting level increased to 2

        if (local_state.only_local_exchange) {
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:395: +3, including nesting penalty of 2, nesting level increased to 3

            if (!block->empty()) {
            ^

be/src/pipeline/exec/exchange_sink_operator.cpp:410: +1, nesting level increased to 2

        } else {
          ^

be/src/pipeline/exec/exchange_sink_operator.cpp:414: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(local_state._serializer.next_serialized_block(
                ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:414: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(local_state._serializer.next_serialized_block(
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:417: +3, including nesting penalty of 2, nesting level increased to 3

                if (serialized) {
                ^

be/src/pipeline/exec/exchange_sink_operator.cpp:419: +4, including nesting penalty of 3, nesting level increased to 4

                    if (!cur_block.empty()) {
                    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:420: +5, including nesting penalty of 4, nesting level increased to 5

                        RETURN_IF_ERROR(local_state._serializer.serialize_block(
                        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:420: +6, including nesting penalty of 5, nesting level increased to 6

                        RETURN_IF_ERROR(local_state._serializer.serialize_block(
                        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:423: +1, nesting level increased to 4

                    } else {
                      ^

be/src/pipeline/exec/exchange_sink_operator.cpp:448: +4, including nesting penalty of 3, nesting level increased to 4

                    if (moved) {
                    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:450: +1, nesting level increased to 4

                    } else {
                      ^

be/src/pipeline/exec/exchange_sink_operator.cpp:458: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::RANDOM) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:462: +2, including nesting penalty of 1, nesting level increased to 2

        if (!current_channel->is_receiver_eof()) {
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:464: +3, including nesting penalty of 2, nesting level increased to 3

            if (current_channel->is_local()) {
            ^

be/src/pipeline/exec/exchange_sink_operator.cpp:466: +4, including nesting penalty of 3, nesting level increased to 4

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:228: expanded from macro 'HANDLE_CHANNEL_STATUS'

    do {                                                 \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:466: +5, including nesting penalty of 4, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:229: expanded from macro 'HANDLE_CHANNEL_STATUS'

        if (status.is<ErrorCode::END_OF_FILE>()) {       \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:466: +1, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:231: expanded from macro 'HANDLE_CHANNEL_STATUS'

        } else {                                         \
          ^

be/src/pipeline/exec/exchange_sink_operator.cpp:466: +6, including nesting penalty of 5, nesting level increased to 6

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:466: +7, including nesting penalty of 6, nesting level increased to 7

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:467: +1, nesting level increased to 3

            } else {
              ^

be/src/pipeline/exec/exchange_sink_operator.cpp:468: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(local_state._serializer.serialize_block(
                ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:468: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(local_state._serializer.serialize_block(
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:472: +4, including nesting penalty of 3, nesting level increased to 4

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:228: expanded from macro 'HANDLE_CHANNEL_STATUS'

    do {                                                 \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:472: +5, including nesting penalty of 4, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:229: expanded from macro 'HANDLE_CHANNEL_STATUS'

        if (status.is<ErrorCode::END_OF_FILE>()) {       \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:472: +1, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:231: expanded from macro 'HANDLE_CHANNEL_STATUS'

        } else {                                         \
          ^

be/src/pipeline/exec/exchange_sink_operator.cpp:472: +6, including nesting penalty of 5, nesting level increased to 6

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:472: +7, including nesting penalty of 6, nesting level increased to 7

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:478: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::HASH_PARTITIONED ||
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:483: +2, including nesting penalty of 1, nesting level increased to 2

            RETURN_IF_ERROR(local_state._partitioner->do_partitioning(state, block));
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:483: +3, including nesting penalty of 2, nesting level increased to 3

            RETURN_IF_ERROR(local_state._partitioner->do_partitioning(state, block));
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:490: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(channel_add_rows(
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:490: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(channel_add_rows(
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:502: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::TABLET_SINK_SHUFFLE_PARTITIONED) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:508: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(local_state._send_new_partition_batch());
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:508: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(local_state._send_new_partition_batch());
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:515: +2, including nesting penalty of 1, nesting level increased to 2

        if (input_rows > 0) {
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:520: +3, including nesting penalty of 2, nesting level increased to 3

            RETURN_IF_ERROR(local_state._row_distribution.generate_rows_distribution(
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:520: +4, including nesting penalty of 3, nesting level increased to 4

            RETURN_IF_ERROR(local_state._row_distribution.generate_rows_distribution(
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:526: +3, including nesting penalty of 2, nesting level increased to 3

            for (int idx = 0; idx < row_ids.size(); ++idx) {
            ^

be/src/pipeline/exec/exchange_sink_operator.cpp:534: +2, including nesting penalty of 1, nesting level increased to 2

        if (eos) {
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:536: +3, including nesting penalty of 2, nesting level increased to 3

            RETURN_IF_ERROR(local_state._send_new_partition_batch());
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:536: +4, including nesting penalty of 3, nesting level increased to 4

            RETURN_IF_ERROR(local_state._send_new_partition_batch());
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:540: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(channel_add_rows_with_idx(state, local_state.channels, num_channels,
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:540: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(channel_add_rows_with_idx(state, local_state.channels, num_channels,
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:550: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::TABLE_SINK_HASH_PARTITIONED) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:557: +2, including nesting penalty of 1, nesting level increased to 2

            RETURN_IF_ERROR(local_state._partitioner->do_partitioning(state, block));
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:557: +3, including nesting penalty of 2, nesting level increased to 3

            RETURN_IF_ERROR(local_state._partitioner->do_partitioning(state, block));
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:561: +2, including nesting penalty of 1, nesting level increased to 2

        RETURN_IF_ERROR(channel_add_rows_with_idx(
        ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:561: +3, including nesting penalty of 2, nesting level increased to 3

        RETURN_IF_ERROR(channel_add_rows_with_idx(
        ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:572: +1, nesting level increased to 1

    } else if (_part_type == TPartitionType::TABLE_SINK_RANDOM_PARTITIONED) {
           ^

be/src/pipeline/exec/exchange_sink_operator.cpp:577: +2, including nesting penalty of 1, nesting level increased to 2

        if (!current_channel->is_receiver_eof()) {
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:579: +3, including nesting penalty of 2, nesting level increased to 3

            if (current_channel->is_local()) {
            ^

be/src/pipeline/exec/exchange_sink_operator.cpp:581: +4, including nesting penalty of 3, nesting level increased to 4

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:228: expanded from macro 'HANDLE_CHANNEL_STATUS'

    do {                                                 \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:581: +5, including nesting penalty of 4, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:229: expanded from macro 'HANDLE_CHANNEL_STATUS'

        if (status.is<ErrorCode::END_OF_FILE>()) {       \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:581: +1, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:231: expanded from macro 'HANDLE_CHANNEL_STATUS'

        } else {                                         \
          ^

be/src/pipeline/exec/exchange_sink_operator.cpp:581: +6, including nesting penalty of 5, nesting level increased to 6

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:581: +7, including nesting penalty of 6, nesting level increased to 7

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:582: +1, nesting level increased to 3

            } else {
              ^

be/src/pipeline/exec/exchange_sink_operator.cpp:583: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(local_state._serializer.serialize_block(
                ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:583: +5, including nesting penalty of 4, nesting level increased to 5

                RETURN_IF_ERROR(local_state._serializer.serialize_block(
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:587: +4, including nesting penalty of 3, nesting level increased to 4

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:228: expanded from macro 'HANDLE_CHANNEL_STATUS'

    do {                                                 \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:587: +5, including nesting penalty of 4, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:229: expanded from macro 'HANDLE_CHANNEL_STATUS'

        if (status.is<ErrorCode::END_OF_FILE>()) {       \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:587: +1, nesting level increased to 5

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:231: expanded from macro 'HANDLE_CHANNEL_STATUS'

        } else {                                         \
          ^

be/src/pipeline/exec/exchange_sink_operator.cpp:587: +6, including nesting penalty of 5, nesting level increased to 6

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:587: +7, including nesting penalty of 6, nesting level increased to 7

                HANDLE_CHANNEL_STATUS(state, current_channel, status);
                ^

be/src/vec/sink/vdata_stream_sender.h:232: expanded from macro 'HANDLE_CHANNEL_STATUS'

            RETURN_IF_ERROR(status);                     \
            ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:593: +2, including nesting penalty of 1, nesting level increased to 2

        if (_writer_count < local_state.channels.size()) {
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:594: +3, including nesting penalty of 2, nesting level increased to 3

            if (_data_processed >=
            ^

be/src/pipeline/exec/exchange_sink_operator.cpp:601: +1, nesting level increased to 1

    } else {
      ^

be/src/pipeline/exec/exchange_sink_operator.cpp:608: +1, including nesting penalty of 0, nesting level increased to 1

    if (eos) {
    ^

be/src/pipeline/exec/exchange_sink_operator.cpp:610: +2, including nesting penalty of 1, nesting level increased to 2

        for (int i = 0; i < local_state.channels.size(); ++i) {
        ^

be/src/pipeline/exec/exchange_sink_operator.cpp:612: +3, including nesting penalty of 2, nesting level increased to 3

            if (!st.ok() && final_st.ok()) {
            ^

be/src/pipeline/exec/exchange_sink_operator.cpp:612: +1

            if (!st.ok() && final_st.ok()) {
                         ^

be/src/pipeline/exec/exchange_sink_operator.cpp:616: +2, including nesting penalty of 1, nesting level increased to 2

        if (local_state._sink_buffer) {
        ^

void on_channel_finished(InstanceLoId channel_id);
std::vector<vectorized::PipChannel*> channels;
std::vector<std::shared_ptr<vectorized::PipChannel>> channel_shared_ptrs;
int current_channel_idx; // index of current channel to send to if _random == true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use default member initializer for 'current_channel_idx' [modernize-use-default-member-init]

be/src/pipeline/exec/exchange_sink_operator.h:56:

-               current_channel_idx(0),
+               ,
Suggested change
int current_channel_idx; // index of current channel to send to if _random == true
int current_channel_idx{0}; // index of current channel to send to if _random == true

std::vector<vectorized::PipChannel*> channels;
std::vector<std::shared_ptr<vectorized::PipChannel>> channel_shared_ptrs;
int current_channel_idx; // index of current channel to send to if _random == true
bool only_local_exchange;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use default member initializer for 'only_local_exchange' [modernize-use-default-member-init]

be/src/pipeline/exec/exchange_sink_operator.h:57:

-               only_local_exchange(false),
+               ,
Suggested change
bool only_local_exchange;
bool only_local_exchange{false};

protected:
bool _recvr_is_valid() {
if (_local_recvr && !_local_recvr->is_closed()) {
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]

            return true;
                   ^

int64_t _num_data_bytes_sent {};
int64_t _packet_seq {};

bool _need_close;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use default member initializer for '_need_close' [modernize-use-default-member-init]

be/src/vec/sink/vdata_stream_sender.h:114:

-               _need_close(false),
+               ,
Suggested change
bool _need_close;
bool _need_close{false};

int64_t _packet_seq {};

bool _need_close;
bool _closed;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use default member initializer for '_closed' [modernize-use-default-member-init]

be/src/vec/sink/vdata_stream_sender.h:115:

-               _closed(false),
+               ,
Suggested change
bool _closed;
bool _closed{false};

ch_roll_pb_block();
}

~PipChannel() override { delete Channel<pipeline::ExchangeSinkLocalState>::_ch_cur_pb_block; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use '= default' to define a trivial destructor [modernize-use-equals-default]

    ~PipChannel() override { delete Channel<pipeline::ExchangeSinkLocalState>::_ch_cur_pb_block; }
    ^

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.47% (9712/25916)
Line Coverage: 28.73% (80528/280335)
Region Coverage: 28.16% (41642/147884)
Branch Coverage: 24.71% (21150/85584)
Coverage Report: http://coverage.selectdb-in.cc/coverage/33f164cdd98125bc1a87d5efa1eee8c2cbc572a3_33f164cdd98125bc1a87d5efa1eee8c2cbc572a3/report/index.html

@Mryange Mryange force-pushed the exchange-sink-buffer-test-5 branch from 33f164c to 42bd17e Compare October 23, 2024 23:11
@Mryange
Copy link
Contributor Author

Mryange commented Oct 23, 2024

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -209,30 +222,40 @@ Status ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_send_rpc' has cognitive complexity of 76 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
                           ^
Additional context

be/src/pipeline/exec/exchange_sink_buffer.cpp:228: +1, including nesting penalty of 0, nesting level increased to 1

    if (_is_finishing) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:235: +1, including nesting penalty of 0, nesting level increased to 1

    while (!q.empty()) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:250: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block && !request.block->column_metas().empty()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:250: +1

        if (request.block && !request.block->column_metas().empty()) {
                          ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:253: +2, including nesting penalty of 1, nesting level increased to 2

        if (!request.exec_status.ok()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:260: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::exchange_sink_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:263: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:266: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:274: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:279: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:287: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:292: +1, nesting level increased to 3

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:294: +4, including nesting penalty of 3, nesting level increased to 4

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:305: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:306: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:306: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:309: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:314: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:319: +2, including nesting penalty of 1, nesting level increased to 2

        if (_total_queue_size <= _queue_capacity) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:324: +2, including nesting penalty of 1, nesting level increased to 2

        if (_keep_order) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:329: +1, including nesting penalty of 0, nesting level increased to 1

    while (!broadcast_q.empty()) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:344: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block() &&
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:344: +1

        if (request.block_holder->get_block() &&
                                              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:352: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::exchange_sink_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:355: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:358: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:366: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:371: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:379: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:381: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:384: +1, nesting level increased to 3

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:386: +4, including nesting penalty of 3, nesting level increased to 4

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:397: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:398: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:629: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:398: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:401: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:406: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:410: +2, including nesting penalty of 1, nesting level increased to 2

        if (_keep_order) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:414: +1, including nesting penalty of 0, nesting level increased to 1

    if (is_empty) {
    ^

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.47% (9712/25916)
Line Coverage: 28.73% (80530/280341)
Region Coverage: 28.15% (41633/147886)
Branch Coverage: 24.71% (21152/85586)
Coverage Report: http://coverage.selectdb-in.cc/coverage/42bd17e61d04a2f288d6975e53392d7baf998220_42bd17e61d04a2f288d6975e53392d7baf998220/report/index.html

@doris-robot
Copy link

TPC-H: Total hot run time: 42086 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 42bd17e61d04a2f288d6975e53392d7baf998220, data reload: false

------ Round 1 ----------------------------------
q1	17558	7468	7330	7330
q2	2032	303	280	280
q3	12096	1110	1158	1110
q4	10566	844	819	819
q5	7783	3200	3180	3180
q6	235	160	154	154
q7	1044	620	625	620
q8	9593	1903	1967	1903
q9	8341	6517	6264	6264
q10	7087	2465	2426	2426
q11	459	245	256	245
q12	414	229	220	220
q13	17789	3404	3484	3404
q14	279	258	247	247
q15	766	704	723	704
q16	678	598	585	585
q17	990	483	552	483
q18	7215	6692	6775	6692
q19	1373	966	1005	966
q20	483	194	192	192
q21	4038	3176	3250	3176
q22	1186	1086	1095	1086
Total cold run time: 112005 ms
Total hot run time: 42086 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7295	7262	7406	7262
q2	346	237	257	237
q3	2986	2798	2904	2798
q4	2151	1904	1931	1904
q5	5963	6027	5977	5977
q6	239	152	150	150
q7	2289	1852	1861	1852
q8	3420	3464	3565	3464
q9	8087	8992	8436	8436
q10	3639	3634	3615	3615
q11	603	494	493	493
q12	827	630	637	630
q13	4553	3775	3549	3549
q14	337	322	309	309
q15	778	741	762	741
q16	705	643	669	643
q17	1883	1677	1671	1671
q18	8421	7997	7723	7723
q19	1705	1403	1497	1403
q20	2802	2536	2549	2536
q21	5711	5494	5496	5494
q22	1286	1162	1147	1147
Total cold run time: 66026 ms
Total hot run time: 62034 ms

@Mryange
Copy link
Contributor Author

Mryange commented Oct 24, 2024

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 43289 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 6fed1a5794a651de90232ad7ab712186a2d1fd31, data reload: false

------ Round 1 ----------------------------------
q1	17666	7487	7367	7367
q2	2048	298	294	294
q3	12209	1114	1207	1114
q4	10567	879	884	879
q5	7771	3211	3178	3178
q6	239	154	156	154
q7	1017	643	612	612
q8	9568	2014	1978	1978
q9	8277	7084	7027	7027
q10	7143	2458	2478	2458
q11	457	248	255	248
q12	438	225	233	225
q13	17806	3541	3572	3541
q14	270	247	242	242
q15	925	898	890	890
q16	684	599	610	599
q17	1011	536	525	525
q18	7185	6798	6637	6637
q19	1359	1038	1057	1038
q20	491	197	197	197
q21	4079	3086	3003	3003
q22	1174	1092	1083	1083
Total cold run time: 112384 ms
Total hot run time: 43289 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7312	7268	7471	7268
q2	344	251	257	251
q3	3135	3084	3024	3024
q4	2160	1897	1918	1897
q5	6012	6063	6010	6010
q6	232	148	152	148
q7	2306	1961	1852	1852
q8	3447	3639	3503	3503
q9	9618	9660	9704	9660
q10	3666	3614	3611	3611
q11	608	499	500	499
q12	798	585	631	585
q13	5186	3731	3779	3731
q14	360	332	318	318
q15	963	932	936	932
q16	736	656	659	656
q17	1919	1657	1652	1652
q18	8533	8036	7987	7987
q19	1699	1499	1350	1350
q20	2818	2555	2600	2555
q21	5700	5648	5594	5594
q22	1271	1160	1128	1128
Total cold run time: 68823 ms
Total hot run time: 64211 ms

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.46% (9711/25924)
Line Coverage: 28.73% (80556/280349)
Region Coverage: 28.15% (41630/147885)
Branch Coverage: 24.72% (21150/85548)
Coverage Report: http://coverage.selectdb-in.cc/coverage/6fed1a5794a651de90232ad7ab712186a2d1fd31_6fed1a5794a651de90232ad7ab712186a2d1fd31/report/index.html

@Mryange Mryange closed this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants