-
Notifications
You must be signed in to change notification settings - Fork 740
Handle InferPDiskSlotCount settings in nodewarden #31207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
⚪ ⚪ DetailsYa make output | Test bloat | Test bloat
⚪ Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
🟢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the InferPDiskSlotCount settings from per-PDisk configuration to a global BlobStorageConfig setting. The implementation enables dynamic reconfiguration through NodeWarden's subscription to configuration updates.
Key Changes
- Moved InferPDiskSlotCount settings from individual PDisk configuration to global BlobStorageConfig
- Implemented dynamic configuration updates in NodeWarden via config subscription mechanism
- Removed deprecated per-PDisk InferPDiskSlotCountFromUnitSize and InferPDiskSlotCountMax fields from schemas and protobuf definitions
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ydb/core/protos/blobstorage_config.proto | Added new TInferPDiskSlotCountSettings message structure and reserved deprecated fields |
| ydb/core/protos/blobstorage.proto | Reserved deprecated InferPDiskSlotCountFromUnitSize and InferPDiskSlotCountMax fields in TPDisk message |
| ydb/core/protos/config.proto | Added InferPDiskSlotCountSettings field to TBlobStorageConfig |
| ydb/core/protos/sys_view.proto | Reserved deprecated InferPDiskSlotCountFromUnitSize field in TPDiskInfo |
| ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h | Added TInferPDiskSlotCountSettingsForDriveType helper struct |
| ydb/core/blobstorage/nodewarden/node_warden_impl.h | Added InferPDiskSlotCountSettings member and config notification handlers |
| ydb/core/blobstorage/nodewarden/node_warden_impl.cpp | Implemented config subscription and dynamic settings update in Handle(TEvConfigNotificationRequest) |
| ydb/core/blobstorage/nodewarden/node_warden_pdisk.cpp | Updated CreatePDiskConfig to use global InferPDiskSlotCountSettings |
| ydb/core/mind/bscontroller/scheme.h | Commented out deprecated InferPDiskSlotCountFromUnitSize and InferPDiskSlotCountMax columns |
| ydb/core/mind/bscontroller/impl.h | Updated TPDiskInfo and TDriveInfo structures, removed deprecated fields |
| ydb/core/mind/bscontroller/*.cpp | Updated various controller methods to remove usage of deprecated fields |
| ydb/library/yaml_config/protos/config.proto | Reserved deprecated InferPDiskSlotCountFromUnitSize and InferPDiskSlotCountMax fields |
| ydb/library/yaml_config/yaml_config_parser.cpp | Removed code that propagated per-host InferPDiskSlotCount settings to drives |
| ydb/core/sys_view/*.cpp | Removed or commented out references to deprecated InferPDiskSlotCountFromUnitSize field |
| ydb/tests/library/harness/kikimr_config.py | Added infer_pdisk_slot_count_settings parameter to KikimrConfigGenerator |
| ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp | Updated tests to use new config notification API for setting InferPDiskSlotCount |
| ydb/apps/dstool/lib/common.py | Simplified get_pdisk_inferred_settings by removing deprecated InferPDiskSlotCountFromUnitSize check |
| ydb/tests/functional/scheme_tests/canondata/* | Updated canonical schema data reflecting removal of deprecated columns |
| ydb/library/yaml_config/ut_transform/canondata/* | Updated line numbers in error messages due to code removal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // TODO | ||
| // | ||
| // bool shouldInfer = inferSettingsForDriveType && (!explicitSlotCount || preferInferred); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment appears to be incomplete or outdated. Since the refactoring is complete and the feature is working (as evidenced by tests), this TODO should either be implemented, converted to a more descriptive comment explaining the logic, or removed entirely.
| // TODO | |
| // | |
| // bool shouldInfer = inferSettingsForDriveType && (!explicitSlotCount || preferInferred); | |
| // Infer PDisk settings from the collected metrics. Any decisions about | |
| // whether to use inferred vs. explicit configuration (e.g. feature flags) | |
| // are made when building StaticPDisks / global configuration, so here we | |
| // always extract and expose the inferred values. |
| } | ||
|
|
||
| message TInferPDiskSlotCountForDriveTypeSettings { | ||
| // NodeWarded infers PDiskConfig ExpectedSlotCount and SlotSizeInUnits by the formula |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the comment: "NodeWarded" should be "NodeWarden".
| // NodeWarded infers PDiskConfig ExpectedSlotCount and SlotSizeInUnits by the formula | |
| // NodeWarden infers PDiskConfig ExpectedSlotCount and SlotSizeInUnits by the formula |
| message TInferPDiskSlotCountSettings { | ||
| optional bool PreferInferredSettingsOverExplicit = 1; // Unless true, PDisk.ExpectedSlotCount overrides inferred settings | ||
| optional TInferPDiskSlotCountForDriveTypeSettings Rot = 2; | ||
| optional TInferPDiskSlotCountForDriveTypeSettings Ssd = 3; |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Ssd field should include a comment documenting that it applies to both SSD and NVME device types, similar to the comment that was present in the deprecated proto message definitions.
| optional TInferPDiskSlotCountForDriveTypeSettings Ssd = 3; | |
| optional TInferPDiskSlotCountForDriveTypeSettings Ssd = 3; // Applies to both SSD and NVME device types. |
| bool settingsShouldBeInferred = !pdisk->HasExpectedSlotCount && | ||
| StorageConfig && StorageConfig->HasBlobStorageConfig() && | ||
| StorageConfig->GetBlobStorageConfig().HasInferPDiskSlotCountSettings() && | ||
| (pdisk->Kind.Type() == NPDisk::DEVICE_TYPE_ROT ? | ||
| StorageConfig->GetBlobStorageConfig().GetInferPDiskSlotCountSettings().HasRot() : | ||
| StorageConfig->GetBlobStorageConfig().GetInferPDiskSlotCountSettings().HasSsd()); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for checking if settings should be inferred for SSD/NVME devices may not handle NVME correctly. When the device type is NVME, the check uses HasSsd(), but there's no guarantee that Ssd settings are appropriate for NVME devices. Consider explicitly checking for NVME and using the appropriate settings, or document that Ssd settings apply to both SSD and NVME devices.
| bool settingsShouldBeInferred = !pdisk->HasExpectedSlotCount && | |
| StorageConfig && StorageConfig->HasBlobStorageConfig() && | |
| StorageConfig->GetBlobStorageConfig().HasInferPDiskSlotCountSettings() && | |
| (pdisk->Kind.Type() == NPDisk::DEVICE_TYPE_ROT ? | |
| StorageConfig->GetBlobStorageConfig().GetInferPDiskSlotCountSettings().HasRot() : | |
| StorageConfig->GetBlobStorageConfig().GetInferPDiskSlotCountSettings().HasSsd()); | |
| const bool hasInferSettings = | |
| StorageConfig && | |
| StorageConfig->HasBlobStorageConfig() && | |
| StorageConfig->GetBlobStorageConfig().HasInferPDiskSlotCountSettings(); | |
| const bool isRotational = pdisk->Kind.Type() == NPDisk::DEVICE_TYPE_ROT; | |
| // NOTE: For non-rotational devices (SSD, NVME, etc.) we intentionally use the "Ssd" | |
| // settings from InferPDiskSlotCountSettings. This is by design: Ssd settings apply | |
| // to all solid-state devices, including NVME. | |
| const bool hasDeviceSpecificSettings = isRotational | |
| ? StorageConfig->GetBlobStorageConfig().GetInferPDiskSlotCountSettings().HasRot() | |
| : StorageConfig->GetBlobStorageConfig().GetInferPDiskSlotCountSettings().HasSsd(); | |
| bool settingsShouldBeInferred = !pdisk->HasExpectedSlotCount && | |
| hasInferSettings && | |
| hasDeviceSpecificSettings; |
Changelog entry
...
Changelog category
Description for reviewers
...