Skip to content

[fix](brpc) Embed serialized request into the attachment and transmit it through http brpc#9803

Merged
morningman merged 9 commits into
apache:masterfrom
xinyiZzz:brpc_http_push_v4
Jun 13, 2022
Merged

[fix](brpc) Embed serialized request into the attachment and transmit it through http brpc#9803
morningman merged 9 commits into
apache:masterfrom
xinyiZzz:brpc_http_push_v4

Conversation

@xinyiZzz

@xinyiZzz xinyiZzz commented May 26, 2022

Copy link
Copy Markdown
Contributor

Proposed changes

Issue Number: close #7163

Problem Summary:

When the length of Tuple/Block data is greater than 2G, serialize the protoBuf request and embed the Tuple/Block data into the controller attachment and transmit it through http brpc.

This is to avoid errors when the length of the protoBuf request exceeds 2G: Bad request, error_text=[E1003]Fail to compress request.

In #7164, Tuple/Block data was put into attachment and sent via default baidu_std brpc, but when the attachment exceeds 2G, it will be truncated. There is no 2G limit for sending via http brpc.

Also, in #7921, consider putting Tuple/Block data into attachment transport by default, as this theoretically reduces one serialization and improves performance. However, the test found that the performance did not improve, but the memory peak increased due to the addition of a memory copy.

Upgrade:

The old request transfer attachement logic is expected to be removed in V1.3, and set transfer_large_data_by_brpc default true.

Therefore, the version before V1.3 needs to be upgraded to V1.3 before the upgrade can continue.

Checklist(Required)

  1. Does it affect the original behavior: (Yes)
  2. Has unit tests been added: (No)
  3. Has document been added or modified: (Yes)
  4. Does it need to update dependencies: (No)
  5. Are there any changes that cannot be rolled back: (Yes)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions github-actions Bot added area/vectorization kind/docs Categorizes issue or PR as related to documentation. labels May 26, 2022
@xinyiZzz xinyiZzz changed the title brpc_http [fix](brpc) Embed serialized request into the attachment and transmit it through http brpc May 26, 2022
@xinyiZzz xinyiZzz requested a review from yangzhg May 26, 2022 13:46
@xinyiZzz xinyiZzz force-pushed the brpc_http_push_v4 branch from d621af9 to 35a5bbb Compare May 26, 2022 13:49
@morningman morningman added this to the v1.2 milestone May 27, 2022
Comment thread gensrc/proto/internal_service.proto Outdated
repeated string channels = 2;
};

message PEchoRequest {};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why named PEchoRequest ? what dose echo mean

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the official example of brpc, use EchoRequest to represent empty Request.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

brpc called EchoRequest because of it's service called echo
you can use PEmptyRequest or PEmptyTransmitDataParams

Comment thread be/src/util/proto_util.h Outdated
Comment thread be/src/common/config.h Outdated
Comment thread be/src/exec/tablet_sink.cpp Outdated
Comment thread be/src/util/proto_util.h Outdated
Comment thread be/src/common/config.h Outdated
Comment thread be/src/vec/sink/vdata_stream_sender.cpp Outdated
@xinyiZzz xinyiZzz force-pushed the brpc_http_push_v4 branch from 35a5bbb to 2d67c8b Compare June 1, 2022 18:35
@xinyiZzz

xinyiZzz commented Jun 2, 2022

Copy link
Copy Markdown
Contributor Author

@yangzhg @morningman PTAL

@morningman morningman added the dev/1.0.1-deprecated should be merged into dev-1.0.1 branch label Jun 2, 2022
@morningman morningman modified the milestones: v1.2, v1.1 Jun 2, 2022
Comment thread be/src/runtime/row_batch.cpp Outdated
Comment thread be/src/exec/tablet_sink.cpp Outdated
Comment thread be/src/runtime/data_stream_sender.cpp Outdated
Comment thread be/src/service/internal_service.cpp Outdated
PTransmitDataResult* response,
google::protobuf::Closure* done) {
SCOPED_SWITCH_BTHREAD();
PTransmitDataParams* request_raw = new PTransmitDataParams();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Memory leak?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fix = =

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the new NewHttpClosure delete req and call the old done.run.

Comment thread be/src/service/internal_service.cpp
@xinyiZzz xinyiZzz force-pushed the brpc_http_push_v4 branch from 0356ec2 to 3145593 Compare June 8, 2022 14:10
Comment thread be/src/util/brpc_client_cache.h Outdated
morningman
morningman previously approved these changes Jun 10, 2022

@morningman morningman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 10, 2022
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@yangzhg

yangzhg commented Jun 11, 2022

Copy link
Copy Markdown
Member

PEchoRequest has not been renamed, should not merge it before resolve it

@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label Jun 11, 2022
@xinyiZzz

Copy link
Copy Markdown
Contributor Author

PEchoRequest has not been renamed, should not merge it before resolve it

fix, modified to PEmptyRequest , thks~

@xinyiZzz xinyiZzz force-pushed the brpc_http_push_v4 branch from 5d22d9a to 7735848 Compare June 11, 2022 17:31
@xinyiZzz xinyiZzz force-pushed the brpc_http_push_v4 branch from 7735848 to 21e8a38 Compare June 11, 2022 18:18
@xinyiZzz xinyiZzz force-pushed the brpc_http_push_v4 branch from 21e8a38 to d30e9dc Compare June 12, 2022 15:11

@yangzhg yangzhg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jun 13, 2022
@morningman morningman merged commit d58e00c into apache:master Jun 13, 2022
morningman pushed a commit that referenced this pull request Jun 14, 2022
… it through http brpc (#9803)

When the length of `Tuple/Block data` is greater than 2G, serialize the protoBuf request and embed the
`Tuple/Block data` into the controller attachment and transmit it through http brpc.

This is to avoid errors when the length of the protoBuf request exceeds 2G:
`Bad request, error_text=[E1003]Fail to compress request`.

In #7164, `Tuple/Block data` was put into attachment and sent via default `baidu_std brpc`,
but when the attachment exceeds 2G, it will be truncated. There is no 2G limit for sending via `http brpc`.

Also, in #7921, consider putting `Tuple/Block data` into attachment transport by default, as this theoretically
reduces one serialization and improves performance. However, the test found that the performance did not improve,
but the memory peak increased due to the addition of a memory copy.
@morningman morningman added dev/merged-1.0.1-deprecated PR has been merged into dev-1.0.1 and removed dev/1.0.1-deprecated should be merged into dev-1.0.1 branch labels Jun 14, 2022
pingchunzhang added a commit to pingchunzhang/doris that referenced this pull request Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/vectorization dev/merged-1.0.1-deprecated PR has been merged into dev-1.0.1 kind/docs Categorizes issue or PR as related to documentation. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Failed to send brpc batch, error_text=Fail to compress request

3 participants