Skip to content

Disable nuraft_use_bg_thread_for_snapshot_io by default - #106842

Merged
antonio2368 merged 3 commits into
masterfrom
disable-keeper-bg-snapshot
Jun 10, 2026
Merged

antonio2368 merged 3 commits into
masterfrom
disable-keeper-bg-snapshot

Conversation

@antonio2368

@antonio2368 antonio2368 commented Jun 9, 2026 •

Copy link
Copy Markdown
Member

This PR changes the default of the nuraft_use_bg_thread_for_snapshot_io coordination setting from true to false.

When enabled, NuRaft uses a background thread for snapshot IO; with this change the default reverts to reading snapshot objects synchronously from the Raft worker threads. The setting itself (added in 5918a8f57ab) is kept, so the background-thread behavior remains available by opting in explicitly.

Close #106933

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Version info

  • Merged into: 26.6.1.599

Change the default of `nuraft_use_bg_thread_for_snapshot_io` from `true`
to `false`, so snapshot objects are read synchronously from Raft worker
threads instead of using a background thread for NuRaft snapshot IO.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dfed3f1]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_asan_ubsan, azure, parallel) FAIL
01169_old_alter_partition_isolation_stress FAIL cidb
00169_contingency FAIL cidb
AST fuzzer (amd_tsan) FAIL
Logical error: Table expression A data must be initialized. In scope B (STID: 5618-54d9) FAIL cidb

AI Review

Summary

This PR changes the default of Keeper setting nuraft_use_bg_thread_for_snapshot_io from true to false and updates the affected integration-test assertion. The code change is narrowly scoped and the earlier bot finding about the stale conf assertion is addressed, but the PR metadata still needs to reflect the changed default because the merged PR that introduced this setting already added a changelog entry saying it is enabled by default.

PR Metadata
  • Changelog category is not correct as Not for changelog: PR 106285 already merged with an Improvement entry saying nuraft_use_bg_thread_for_snapshot_io is enabled by default, so generated release notes would publish the wrong default after this PR.
  • Use category Improvement.
  • Suggested Changelog entry: Changed the default value of Keeper setting nuraft_use_bg_thread_for_snapshot_io to false; set it to true to opt into NuRaft background snapshot IO.
Findings

💡 Nits

  • [src/Coordination/CoordinationSettings.cpp:92] The changed default invalidates the already-merged changelog entry from PR 106285, which says nuraft_use_bg_thread_for_snapshot_io is enabled by default. Leaving this PR as Not for changelog makes the release notes inaccurate.
    Suggested fix: update the PR category and changelog entry as shown above.
Final Verdict

Status: ⚠️ Request changes

Minimum required action: update the PR changelog metadata to describe the new default for nuraft_use_bg_thread_for_snapshot_io.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jun 9, 2026
@antonio2368
antonio2368 enabled auto-merge June 9, 2026 13:28
@kssenii kssenii self-assigned this Jun 9, 2026
antonio2368 and others added 2 commits June 10, 2026 10:08
…snapshot_io default

The test asserted the old default value `true` of
`nuraft_use_bg_thread_for_snapshot_io` reported by the `conf` four-letter
command, while this PR changes the default to `false`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106842&sha=latest&name_0=PR
PR: #106842

Co-Authored-By: Claude Fable 5 <[email protected]>
DECLARE(Milliseconds, stream_suspect_retry_delay_ms, 1000, "Delay before reconnecting to the leader after a stream breaks while the new stream is suspected to be unhealthy", 0) \
DECLARE(Milliseconds, stream_in_flight_drain_timeout_ms, 5000, "Maximum time to wait for in-flight requests to drain after a stream break (e.g. leader change) before dropping them", 0) \
DECLARE(Bool, nuraft_use_bg_thread_for_snapshot_io, true, "Use a background thread for NuRaft snapshot IO instead of reading snapshot objects synchronously from Raft worker threads.", 0) \
DECLARE(Bool, nuraft_use_bg_thread_for_snapshot_io, false, "Use a background thread for NuRaft snapshot IO instead of reading snapshot objects synchronously from Raft worker threads.", 0) \

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.

The previous PR that introduced nuraft_use_bg_thread_for_snapshot_io already merged with an Improvement changelog entry saying the setting is enabled by default. With this default flipped to false, leaving this PR as Not for changelog will make the generated release notes publish the wrong default for this Keeper setting. Please change the PR metadata to a changeloged category, for example Improvement, with an entry like: Changed the default value of Keeper setting nuraft_use_bg_thread_for_snapshot_io to false; set it to true to opt into NuRaft background snapshot IO.

@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: 7/7 (100.00%) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

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.

IKeeperStateMachine::read_logical_snp_obj: "Snapshot transfer context is null"

3 participants