Skip to content

Fix show configuration displaying raw value instead of effective value#18108

Open
JackieTien97 wants to merge 1 commit into
masterfrom
fix/show-configuration-effective-value
Open

Fix show configuration displaying raw value instead of effective value#18108
JackieTien97 wants to merge 1 commit into
masterfrom
fix/show-configuration-effective-value

Conversation

@JackieTien97

Copy link
Copy Markdown
Contributor

Problem

show configuration (table model) renders ConfigurationFileUtils.lastAppliedProperties, which is populated from the raw config-file values. Several hot-reloaded parameters have setters that rewrite the loaded value before it takes effect, so their displayed value diverged from the effective in-memory value:

  • if (x > 0) setX(x) skips non-positive values → keeps the default, but the display still showed the raw 0 / negative file value
  • loadFixedSizeLimitForQuery rewrites <=0 to a computed default → the display still showed 0

This affects only the display layer, not actual behavior (the effective value is always correct in memory).

Affected keys:

key rewrite on load
cte_buffer_size_in_bytes >0 guard
max_rows_in_cte_buffer >0 guard
max_sub_task_num_for_information_table_scan >0 guard
sort_buffer_size_in_bytes <=0 → computed default (template default is 0, so it was always misdisplayed)
mods_cache_size_limit_per_fi_in_bytes <=0 → computed default (template default is 0, so it was always misdisplayed)

Fix

Add IoTDBDescriptor.overlayEffectiveConfigurationValues(): after the setters run, overwrite those keys in lastAppliedProperties with the post-setter effective value (conf.getX() / commonConfig.getX()). It is invoked in both load paths — loadProperties (startup) and loadHotModifiedProps (hot-reload) — so both local show configuration and show configuration node <id> (remote, which reads each node's own map over RPC) stay correct.

This is a load-side fix rather than a display-side getter map because remote-node display can only be corrected by fixing each node's stored lastAppliedProperties.

Test

Added IoTDBLoadConfigurationTableIT#showConfigurationDisplaysEffectiveValue:

  • non-positive guard params (=0 / =-1) → display the effective defaults (131072 / 1000 / 4)
  • a valid value (=262144) → displayed unchanged (no false rewrite)
  • <=0 params (template default 0) → display a positive computed default, not 0

Verified: passes with the fix; without the fix the first assertion fails with expected:<[131072]> but was:<[0]> (so the test is non-vacuous and actually catches the bug).

🤖 Generated with Claude Code

show configuration (table model) renders ConfigurationFileUtils.lastAppliedProperties, which is populated from the raw config-file values. Several hot-reloaded parameters have setters that rewrite the loaded value (e.g. `if (x > 0) setX(x)` skips non-positive values; loadFixedSizeLimitForQuery rewrites `<=0` to a computed default), so their displayed value diverged from the effective in-memory value.

Add overlayEffectiveConfigurationValues() to overwrite those keys with the post-setter effective value, invoked after the setters in both loadProperties (startup) and loadHotModifiedProps (hot-reload), so local and remote show configuration stay correct. Affected keys: cte_buffer_size_in_bytes, max_rows_in_cte_buffer, max_sub_task_num_for_information_table_scan, sort_buffer_size_in_bytes, mods_cache_size_limit_per_fi_in_bytes.

Added IT: IoTDBLoadConfigurationTableIT#showConfigurationDisplaysEffectiveValue.
@JackieTien97 JackieTien97 requested a review from shuwenwei July 3, 2026 08:56
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.76%. Comparing base (5ce95b1) to head (e8f5c26).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...java/org/apache/iotdb/db/conf/IoTDBDescriptor.java 76.92% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18108      +/-   ##
============================================
+ Coverage     41.53%   41.76%   +0.23%     
  Complexity      318      318              
============================================
  Files          5296     5296              
  Lines        371679   371957     +278     
  Branches      48088    48137      +49     
============================================
+ Hits         154360   155331     +971     
+ Misses       217319   216626     -693     

☔ 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

1 participant