Skip to content

Uncomment commented set-configuration-able items in the config template (fix enable_topology_probing & topology_probing_* hot/restart reload)#17933

Open
CRZbulabula wants to merge 2 commits into
masterfrom
fix_v2_995_topology_probing_hot_reload
Open

Uncomment commented set-configuration-able items in the config template (fix enable_topology_probing & topology_probing_* hot/restart reload)#17933
CRZbulabula wants to merge 2 commits into
masterfrom
fix_v2_995_topology_probing_hot_reload

Conversation

@CRZbulabula

@CRZbulabula CRZbulabula commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Several configuration items declared as dynamically settable were left commented out in iotdb-system.properties.template, so set configuration rejected them with:

301: ignored config items: [...] because they are immutable or undefined.

The most visible case (PingCode V2-995) was enable_topology_probing (added in #17595): it is declared effectiveMode: hot_reload and the ConfigNode already implements the hot-reload start/stop logic (ConfigManager.handleTopologyProbingHotReload), yet set configuration "enable_topology_probing"="true" was rejected — so operators could only toggle the TopologyService by editing the file and restarting the ConfigNode (which triggers a leader election and a brief availability hit).

Root cause

ConfigurationFileUtils.getConfigurationItemsFromTemplate only parses uncommented key=value lines into configuration2DefaultValue. When an item's value line is commented out, the key never enters that map, so filterInvalidConfigItems treats it as undefined and drops it before it can reach the apply path. The only effectiveMode that set configuration is supposed to reject is FIRST_START; every other mode (hot_reload, restart, first_start_or_set_configuration) should be accepted (written to the file, applied now for hot_reload or on next restart otherwise).

Fix

Uncomment the affected items so they become bare defaults like every other working settable item (e.g. slow_query_threshold, wal_mode). No Java logic changes are required — the entire downstream chain was already correct; the commented template line was the only blocker.

Items uncommented:

Item effectiveMode
enable_topology_probing=false hot_reload
topology_probing_base_interval_in_ms=5000 restart
topology_probing_timeout_ratio=0.5 restart
cn_max_idle_client_count_for_each_node_in_client_manager=1000 restart
dn_max_idle_client_count_for_each_node_in_client_manager=1000 restart
region_group_allocate_policy=GCR restart

All have real descriptor bindings (ConfigNodeDescriptor / CommonDescriptor / IoTDBDescriptor) and validated defaults, so uncommenting them is safe and behavior-preserving for fresh deployments.

Tests

  • ConfigurationFileUtilsTest.checkSettableItemsAreUncommentedInTemplate — a regression guard that scans the raw template and fails if any item whose effectiveMode permits set configuration (i.e. anything except FIRST_START) is left commented out. It tolerates keys that also have an uncommented variant elsewhere (e.g. the Windows/Unix path pairs such as dn_data_dirs), so it only flags items that are genuinely unreachable. This is what surfaced the additional restart-mode items beyond enable_topology_probing.
  • IoTDBSetConfigurationIT.testSetTopologyProbingConfiguration — end-to-end: asserts set configuration accepts enable_topology_probing (hot_reload) and the two topology_probing_* items (restart) and persists them to the ConfigNode config file.

This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.
  • added integration tests.

Key changed/added classes (or packages if there are too many classes) in this PR
  • iotdb-system.properties.template (node-commons config template)
  • ConfigurationFileUtilsTest (datanode unit test)
  • IoTDBSetConfigurationIT (integration test)

…ig template

enable_topology_probing declares effectiveMode: hot_reload and the
ConfigNode implements the hot-reload start/stop logic, but
'set configuration "enable_topology_probing"="true"' was rejected with
301 "immutable or undefined".

Root cause: the item was left commented out
(# enable_topology_probing=false) in iotdb-system.properties.template.
ConfigurationFileUtils.getConfigurationItemsFromTemplate only parses
uncommented key=value lines into the default-value map, so
filterInvalidConfigItems treated the key as undefined and dropped it
before it could reach the hot-reload path. Uncommenting it makes it a
bare default like every other working hot_reload item (e.g.
slow_query_threshold).

Add regression tests:
- ConfigurationFileUtilsTest.checkHotReloadItemsAreUncommentedInTemplate
  scans the template and fails if any hot_reload item is left commented
  out (while tolerating keys that also have an uncommented variant, e.g.
  the Windows/Unix path pairs).
- IoTDBSetConfigurationIT.testSetHotReloadTopologyProbing verifies
  'set configuration' accepts the item and persists it to the ConfigNode
  config file.
…mplate

Following the enable_topology_probing fix, a generalized regression test
(checkSettableItemsAreUncommentedInTemplate) revealed that several other
items whose effectiveMode permits 'set configuration' (everything except
FIRST_START) were also left commented out in the template, hitting the
same root cause: getConfigurationItemsFromTemplate only parses uncommented
lines, so filterInvalidConfigItems treats them as undefined and rejects
the SQL with '301 immutable or undefined'.

Uncomment these so 'set configuration' can reach them (all restart mode,
all with real descriptor bindings and sensible defaults):
- topology_probing_base_interval_in_ms=5000
- topology_probing_timeout_ratio=0.5
- cn_max_idle_client_count_for_each_node_in_client_manager=1000
- dn_max_idle_client_count_for_each_node_in_client_manager=1000
- region_group_allocate_policy=GCR

Broaden the unit-test guard from hot_reload-only to every settable mode
(hot_reload / restart / first_start_or_set_configuration), so any future
settable item left commented is caught. Extend the integration test to
also set the restart-mode topology_probing_* items end-to-end.
@CRZbulabula CRZbulabula changed the title Fix enable_topology_probing hot-reload by uncommenting it in the config template Uncomment commented set-configuration-able items in the config template (fix enable_topology_probing & topology_probing_* hot/restart reload) Jun 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.07%. Comparing base (abb9ef9) to head (ef292bb).

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #17933   +/-   ##
=========================================
  Coverage     41.07%   41.07%           
  Complexity      318      318           
=========================================
  Files          5257     5257           
  Lines        365010   365010           
  Branches      47180    47180           
=========================================
+ Hits         149918   149923    +5     
+ Misses       215092   215087    -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant