Optimize the configuration logic of dn_thrift_max_frame_size#16724
Optimize the configuration logic of dn_thrift_max_frame_size#16724
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the Thrift max frame size configuration to use dynamic memory-based defaults and consolidates frame validation error handling.
Key Changes
- Removed hardcoded
LEFT_SIZE_IN_REQUESTconstant and related validation logic - Changed default
dn_thrift_max_frame_sizefrom 512MB to 0 (dynamic), which calculates as min(64MB, heap memory / 64) - Refactored frame size validation in
TElasticFramedTransportusing an enum-based error handling pattern
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| IoTDBConstant.java | Removed unused LEFT_SIZE_IN_REQUEST constant (4MB) |
| iotdb-system.properties.template | Updated default value to 0 and clarified documentation for dynamic calculation |
| IoTDBDescriptor.java | Removed minimum frame size validation that enforced 8MB minimum |
| IoTDBConfig.java | Implemented dynamic calculation of thriftMaxFrameSize based on heap memory, with fallback logic in setter |
| TElasticFramedTransport.java | Refactored frame validation into checkFrameSize() method with enum-based error handling for better code organization |
| TCompressedElasticFramedTransport.java | Simplified by delegating frame size validation to parent class's checkFrameSize() method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
Outdated
Show resolved
Hide resolved
iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
Outdated
Show resolved
Hide resolved
|
Codecov Report❌ Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* Add thrift max frame size calculate logic * Add thrift max frame size calculate logic * fix review (cherry picked from commit ffa9c56)



Description