Clean up dead RPC thread config and use node-specific selectorNum#17551
Open
JackieTien97 wants to merge 10 commits intomasterfrom
Open
Clean up dead RPC thread config and use node-specific selectorNum#17551JackieTien97 wants to merge 10 commits intomasterfrom
JackieTien97 wants to merge 10 commits intomasterfrom
Conversation
1. Fix dn_selector_thread_count_of_client_manager naming mismatch: rename to dn_selector_thread_nums_of_client_manager to match CommonDescriptor 2. Remove unused dn_rpc_selector_thread_count config and its backing field rpcSelectorThreadCount in IoTDBConfig 3. Remove unused coordinator_write_executor_size config and the dead writeOperationExecutor in Coordinator/TreeModelPlanner 4. Fix ClientPoolProperty.Builder to read maxClientNumForEachNode from CommonConfig instead of hardcoded constant
…nt pool Add a parameterized constructor to AsyncDataNodeInternalServiceClientPoolFactory so that callers can override the selector thread count. The no-arg constructor still defaults to CommonConfig.getSelectorNumOfClientManager(). Coordinator now passes IoTDBConfig.getSelectorNumOfClientManager() to use the DataNode-specific value.
Add selectorNumOfAsyncClientManager field to DataNodeInternalServiceRequestManager so each subclass can supply the correct selector thread count: - CnToDnInternalServiceAsyncRequestManager reads from ConfigNodeConfig - DnToDnInternalServiceAsyncRequestManager reads from IoTDBConfig Also add selectorNumOfClientManager to ConfigNodeConfig and load cn_selector_thread_nums_of_client_manager in ConfigNodeDescriptor.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17551 +/- ##
============================================
+ Coverage 40.05% 40.21% +0.15%
Complexity 2554 2554
============================================
Files 5176 5177 +1
Lines 348528 348712 +184
Branches 44558 44599 +41
============================================
+ Hits 139595 140225 +630
+ Misses 208933 208487 -446 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…idate idle client count - selector_thread_nums_of_client_manager defaults to 0 (auto: max(1, CPU/4)) - max_idle_client_count_for_each_node_in_client_manager ignores negative values - ThriftClientProperty default changed from hardcoded 1 to CPU/4 - Added maxIdleClientNumForEachNode support in ClientPoolProperty
|
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
This PR cleans up dead/misconfigured RPC thread parameters, ensures ConfigNode and DataNode each use their own
selectorNumOfClientManagervalue when constructing async client pools, and addsmaxIdleClientNumForEachNodesupport for client pool eviction control.1. Fix config naming mismatch
dn_selector_thread_count_of_client_manager→dn_selector_thread_nums_of_client_managerin both the properties template andIoTDBDescriptorto match the name already used inCommonDescriptor.2. Remove dead config parameters
dn_rpc_selector_thread_count: Parsed and stored inIoTDBConfig.rpcSelectorThreadCountbut never actually consumed by any server component. Removed the field, getter, setter, template entry, and loading code inIoTDBDescriptor.coordinator_write_executor_size: Created awriteOperationExecutorthread pool inCoordinatorthat was passed toTreeModelPlannerbut never referenced in any of its methods — completely dead code. Removed the config field, the thread pool, theTreeModelPlannerconstructor parameter, and theMPP_COORDINATOR_WRITE_EXECUTORthread name.3. Fix
ClientPoolProperty.Builderhardcoded defaultBuilder.maxClientNumForEachNodewas initialized to the compile-time constantDefaultProperty.MAX_CLIENT_NUM_FOR_EACH_NODE(1000), ignoring any runtime config override fromdn_max_client_count_for_each_node_in_client_managerorcn_max_client_count_for_each_node_in_client_manager. Changed to read fromCommonDescriptor.getInstance().getConfig().getMaxClientNumForEachNode()so callers that don't explicitly callsetMaxClientNumForEachNode()still respect the configured value.4. Use node-specific
selectorNumfor async client poolsPreviously,
AsyncDataNodeInternalServiceClientPoolFactoryalways readselectorNumOfClientManagerfromCommonConfig, which is shared. ConfigNode and DataNode may configure different values viacn_selector_thread_nums_of_client_manageranddn_selector_thread_nums_of_client_managerrespectively.Changes:
AsyncDataNodeInternalServiceClientPoolFactory: Removed the no-arg constructor; the only constructor now requires an explicitselectorNumOfAsyncClientManagerint.Coordinator: PassesIoTDBConfig.getSelectorNumOfClientManager()when constructing the factory.DataNodeInternalServiceRequestManager: Added afinal int selectorNumOfAsyncClientManagerfield and aprotectedconstructor so each subclass supplies its own value.DnToDnInternalServiceAsyncRequestManager: Reads fromIoTDBConfig.getSelectorNumOfClientManager().CnToDnInternalServiceAsyncRequestManager: Reads fromConfigNodeConfig.getSelectorNumOfClientManager().ConfigNodeConfig: AddedselectorNumOfClientManagerfield with getter/setter.ConfigNodeDescriptor: Loadscn_selector_thread_nums_of_client_managerintoConfigNodeConfig.5. Auto-compute selector threads and add idle client eviction control
selector_thread_numsdefault changed to 0 (auto-compute): Bothcn_selector_thread_nums_of_client_manageranddn_selector_thread_nums_of_client_managernow default to0in the properties template. When<= 0, the system auto-computes the value asmax(1, CPU core number / 4). The descriptor files (CommonDescriptor,ConfigNodeDescriptor,IoTDBDescriptor) only update the config when the parsed value is> 0.ThriftClientPropertydefault updated: Changed from hardcoded1tomax(1, availableProcessors() / 4)to match the auto-compute logic.ConfigNodeConfig/IoTDBConfigdefaults updated: Both now usemax(1, availableProcessors() / 4)as the defaultselectorNumOfClientManager.maxIdleClientNumForEachNodesupport added: New config parametercn_max_idle_client_count_for_each_node_in_client_manager/dn_max_idle_client_count_for_each_node_in_client_manager(default0, meaning no idle eviction limit). Added the field and getter/setter toCommonConfig,ConfigNodeConfig, andIoTDBConfig.ClientPoolProperty.Buildernow reads this value fromCommonDescriptorand uses it to setmaxIdlePerKey(previously hardcoded tomaxClientNumForEachNode). Negative values in the properties file are ignored.Test plan
dn_selector_thread_nums_of_client_manager/cn_selector_thread_nums_of_client_managervalues take effect (only when > 0)dn_max_client_count_for_each_node_in_client_manageris respected by client pools that don't explicitly set itdn_max_idle_client_count_for_each_node_in_client_manager/cn_max_idle_client_count_for_each_node_in_client_managercontrols idle client eviction (0 = no limit, negative values ignored)max(1, CPU/4)when set to 0