-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Feature request
Is your feature request related to a problem? Please describe.
StarRocks currently detects disk type (SSD vs HDD) in be/src/util/disk_info.cpp, but this detection is not used when initializing storage paths. Instead, the disk type must be manually specified in the BE configuration (e.g., storage_root_path). This introduces duplication, potential misconfiguration, and prevents StarRocks from automatically adapting to heterogeneous disk environments.
Although StarRocks already determines the underlying disk type during startup, storage_root_path handling in be/src/storage/options.cpp does not use this detected information. Users must manually assign a disk type (“HDD” or “SSD”), which leads to:
- Configuration drift when underlying disk types change
- Risk of incorrect or inconsistent classification
- Extra operational burden in multi-disk setups
- Missed opportunity to simplify BE configuration and reduce errors
Describe the solution you'd like
StarRocks should automatically use the disk type detected in disk_info.cpp unless the user explicitly overrides it. That is:
- If the user omits disk type in
storage_root_path, StarRocks should use the detected type. - If a disk type is explicitly provided, StarRocks should respect the override.
This would ensure backward compatibility while improving usability.
Proposed Approach
I propose updating the logic in be/src/storage/options.cpp to:
- Check whether the user specified a disk type.
- If not specified, retrieve the detected type from DiskInfo (or equivalent utility).
- Populate the disk type field using the detected value.
- Continue using the existing validation and initialization pipeline.
This introduces no behavioral change for existing explicit configurations, but significantly improves default behavior.
Willingness to Contribute
I am able and willing to contribute an implementation for this feature if the maintainers agree with the approach.