sollhui opened a new pull request, #60688:
URL: https://github.com/apache/doris/pull/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 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]

Reply via email to