Skip to content

Revert "Make getServerSetting return live values for runtime-changeable settings" - #106930

Merged
Algunenano merged 1 commit into
masterfrom
revert-105172-fix-getServerSetting-live-values
Jun 10, 2026
Merged

Algunenano merged 1 commit into
masterfrom
revert-105172-fix-getServerSetting-live-values

Conversation

@Algunenano

@Algunenano Algunenano commented Jun 10, 2026 •

Copy link
Copy Markdown
Member

Reverts #105172

Closes #106902

Version info

  • Merged into: 26.6.1.604

@clickhouse-gh

clickhouse-gh Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [cd05016]

Summary: ✅


AI Review

Summary

This PR reverts the live-value path added for getServerSetting, while preserving the special keeper_hosts projection in system.server_settings. The revert removes the broad ServerSettings copy that triggered the linked TSan report, but the PR still promises to close the reload race and the current code leaves an unsynchronized read path for server settings mutated by SYSTEM RELOAD CONFIG.

Findings

❌ Blockers

  • [src/Functions/getServerSetting.cpp:73] getServerSetting still reads shared->server_settings without taking shared->mutex, while Context::setS3QueueDisableStreaming and Context::setMessageQueueDisableInsertion update fields in the same object under that mutex during config reload. The revert removes the new full-object copy race, but a concurrent SYSTEM RELOAD CONFIG and getServerSetting('s3queue_disable_streaming') or getServerSetting('message_queue_disable_insertion') can still race on the same SettingFieldBool, so the linked reload-race issue is not actually closed.
    Suggested fix: route getServerSetting through a synchronized accessor for runtime-mutated server settings, or special-case these settings to use the locked Context getters instead of reading getServerSettings directly.
Tests
  • ⚠️ Add or reference a focused TSan/reload regression that exercises SYSTEM RELOAD CONFIG concurrently with getServerSetting for at least one runtime-mutated setting such as s3queue_disable_streaming or message_queue_disable_insertion.
Final Verdict

Status: ❌ Block

Minimum required action: remove the remaining unsynchronized read path, or narrow the PR/linked issue claim and provide evidence that the remaining path is outside the intended race fix.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jun 10, 2026
}

return server_settings.get(setting_name);
return Context::getGlobalContextInstance()->getServerSettings().get(setting_name);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still leaves an unsynchronized read of shared->server_settings for settings that SYSTEM RELOAD CONFIG mutates under shared->mutex. For example, Context::setS3QueueDisableStreaming and Context::setMessageQueueDisableInsertion write these fields while holding shared->mutex, but getServerSetting('s3queue_disable_streaming') and getServerSetting('message_queue_disable_insertion') reach this get call without taking that lock. That means the PR removes the broad copy race from the reverted helper, but it does not actually close the reload race promised by the PR/linked issue; a concurrent reload and query of either setting can still race on the same SettingFieldBool.

Please route this through a synchronized accessor, or special-case these runtime-mutated settings to use the locked Context getters instead of reading getServerSettings directly.

@clickhouse-gh

clickhouse-gh Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.70% 84.70% +0.00%
Functions 92.30% 92.30% +0.00%
Branches 77.30% 77.30% +0.00%

Changed lines: Changed C/C++ lines covered by tests: 26/26 (100.00%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code

Full report · Diff report

@Algunenano
Algunenano enabled auto-merge June 10, 2026 14:39
@Algunenano
Algunenano added this pull request to the merge queue Jun 10, 2026
Merged via the queue into master with commit e6a9b21 Jun 10, 2026
166 checks passed
@Algunenano
Algunenano deleted the revert-105172-fix-getServerSetting-live-values branch June 10, 2026 15:33
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data race on ServerSettings during reload

2 participants