[fix](move-memtable) fix StreamWrite EINVAL error when report tablet load info#60688
Merged
dataroaring merged 1 commit intoapache:masterfrom Feb 11, 2026
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 29968 ms |
ClickBench: Total hot run time: 28.31 s |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
sollhui
added a commit
to sollhui/doris
that referenced
this pull request
Feb 27, 2026
…load info (apache#60688) ## Summary Fix a bug where `_report_tablet_load_info` writes an empty `IOBuf` to brpc stream, causing `Socket::Write` to return EINVAL and log warnings like: ``` Fail to write to _fake_socket, Invalid argument ``` ## Root Cause `_report_tablet_load_info` is called on every `ADD_SEGMENT` request to report tablet load info (version count) back to the sender for back-pressure control. The call chain is: 1. `_report_tablet_load_info` gets `write_tablet_ids` from the index stream 2. `_collect_tablet_load_info_from_tablets` iterates over these tablet IDs 3. `collect_tablet_load_rowset_num_info` only adds an entry when `version_count` exceeds `max_version_config * load_back_pressure_version_threshold / 100` In normal cases where no tablet hits the back-pressure threshold, `tablet_load_infos` remains empty. A protobuf message with only an empty repeated field serializes to an empty string (0 bytes). The empty `IOBuf` is then passed to `brpc::StreamWrite`, and brpc's `Socket::Write` rejects empty data with EINVAL. This error is harmless (the socket is not closed or failed, and subsequent writes succeed), but it produces noisy WARNING logs on every `ADD_SEGMENT` request. ## Fix Skip the `StreamWrite` call when `tablet_load_infos` is empty after collection, since there is nothing to report.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix a bug where
_report_tablet_load_infowrites an emptyIOBufto brpc stream,causing
Socket::Writeto return EINVAL and log warnings like:Root Cause
_report_tablet_load_infois called on everyADD_SEGMENTrequest to report tabletload info (version count) back to the sender for back-pressure control.
The call chain is:
_report_tablet_load_infogetswrite_tablet_idsfrom the index stream_collect_tablet_load_info_from_tabletsiterates over these tablet IDscollect_tablet_load_rowset_num_infoonly adds an entry whenversion_countexceeds
max_version_config * load_back_pressure_version_threshold / 100In normal cases where no tablet hits the back-pressure threshold,
tablet_load_infosremains empty. A protobuf message with only an empty repeated field serializes to an
empty string (0 bytes). The empty
IOBufis then passed tobrpc::StreamWrite, andbrpc's
Socket::Writerejects empty data with EINVAL.This error is harmless (the socket is not closed or failed, and subsequent writes
succeed), but it produces noisy WARNING logs on every
ADD_SEGMENTrequest.Fix
Skip the
StreamWritecall whentablet_load_infosis empty after collection,since there is nothing to report.