Skip to content

Update NuRaft to fix snapshot install livelock with background snapshot IO - #107338

Merged
antonio2368 merged 6 commits into
masterfrom
update-nuraft-async-snapshot-io-livelock
Jun 16, 2026
Merged

antonio2368 merged 6 commits into
masterfrom
update-nuraft-async-snapshot-io-livelock

Conversation

@antonio2368

@antonio2368 antonio2368 commented Jun 12, 2026 •

Copy link
Copy Markdown
Member

Bumps `contrib/NuRaft` to fix a livelock during snapshot install when
snapshot IO runs on a background thread.

The `nuraft_use_bg_thread_for_snapshot_io` Keeper coordination setting remains
disabled by default (`false`). To get CI coverage of both modes, the setting is
now randomized in stateless tests (via `tests/config/install.sh`) and in Jepsen
tests (via `run.sh`).

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Updated `NuRaft` with a fix for a snapshot-install livelock that occurred when snapshot IO ran on a background thread. The `nuraft_use_bg_thread_for_snapshot_io` Keeper setting remains disabled by default; CI now randomizes it to cover both modes.

Documentation entry:

  • Documentation is not needed because this is an internal Keeper coordination setting tied to a `NuRaft` update.

Version info

  • Merged into: 26.6.1.886

…ot IO

Bumps contrib/NuRaft to 4d591d2 (branch fix-async-snapshot-io-livelock),
which fixes a livelock in snapshot install when snapshot IO runs on a
background thread.

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

clickhouse-gh Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f0bde4a]

Summary: ✅


AI Review

Summary

This PR bumps NuRaft to include the async snapshot IO livelock fix, keeps nuraft_use_bg_thread_for_snapshot_io disabled by default, and adds randomized CI coverage for that mode in stateless and Jepsen configurations. I found no remaining code-review findings in the current diff; the earlier conf assertion and PR metadata issues are addressed.

Missing context / blind spots
  • ⚠️ Full Praktika status could not be fetched through the PR helper because GitHub rejected the configured token; the direct S3 aggregate report for f0bde4abed561907275fee410e874230eda43057 listed no failed tests, but a full Keeper/Jepsen/upgrade CI pass would close this gap.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-improvement Pull request with some product improvements submodule changed At least one submodule changed in this PR. labels Jun 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.80% 84.70% -0.10%
Functions 92.40% 92.40% +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

@antonio2368

Copy link
Copy Markdown
Member Author

@kssenii I'm going to disable the setting by default and randomize it in CI like you suggested in the last PR, seems a safer thing to do.

antonio2368 and others added 2 commits June 15, 2026 06:36
… it in CI

- Change default value from `true` to `false`
- Add `nuraft_use_bg_thread_for_snapshot_io` to `keeper_port.xml` with default 0
  and randomize it in `install.sh` (covers stateless and stress checks)
- Wire the setting through Jepsen: add placeholder to `keeper_config.xml`,
  substitution in `db.clj`, CLI option in `main.clj`, and random selection in `run.sh`
- Bump NuRaft submodule to fff08ccaf16646941d91ab0d26b94c76c17e44d1

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Comment thread tests/config/config.d/keeper_port.xml Resolved
The setting lives in `<coordination_settings>`, which the server parses
strictly: an older binary that does not know it refuses to start with
`UNKNOWN_SETTING`. The upgrade check starts the previous release with the
current config, so it failed to start ("Cannot start clickhouse-server").

Gate the `keeper_port.xml` setting strip on a new `--previous-release` flag in
addition to `--bugfix-validation`, and pass `--previous-release` from the
upgrade check's previous-release `configure` (not the post-upgrade one). Strip
`nuraft_use_bg_thread_for_snapshot_io` there; drop the `use_xid_64` and
`remove_recursive` strips, which the previous release already supports.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added pr-build Pull request with build/testing/packaging improvement and removed pr-improvement Pull request with some product improvements labels Jun 15, 2026
@antonio2368
antonio2368 enabled auto-merge June 16, 2026 11:21
@antonio2368
antonio2368 added this pull request to the merge queue Jun 16, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 38 queries analysed

This PR only changes ClickHouse Keeper (a NuRaft submodule bump) and Keeper/Jepsen test configuration; nothing in the server query-execution path is touched. The flagged improvements on ClickBench Q22/Q23 and TPC-H Q7/Q20 therefore cannot be attributed to this change and are treated as run-to-run variance, especially given the noisy baseline runs. TPC-H Q4's borderline, mixed-signal regression was already trending before this PR and is not introduced here. Net: no query-execution impact expected from a Keeper-only change.

clickbench

⚠️ 2 inconclusive

Flagged queries (2 of 43)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
⚠️ 22 not_sure 334 253 -24.2% <0.0001 Keeper/NuRaft + test-config only; server query path untouched, so this -24% is run-to-run variance (noisy base).
⚠️ 23 not_sure 297 198 -33.3% <0.0001 PR only touches Keeper/NuRaft and test config; query execution unchanged, so -33% is not a PR effect.

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

⚠️ 3 inconclusive

Flagged queries (3 of 22)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
⚠️ 4 not_sure 3015 3307 +9.7% 0.0408 Borderline and already trending before this Keeper-only PR; not introduced by this change.
⚠️ 7 not_sure 113 73 -35.4% <0.0001 Keeper/NuRaft-only change; TPC-H execution path untouched. Query is intrinsically noisy, so -35% is variance.
⚠️ 20 not_sure 248 125 -49.6% <0.0001 Keeper/NuRaft-only change; nothing in the query engine. Very noisy baseline, so -50% is variance.

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

Debug info
  • StressHouse run: 72f5f56f-ccc6-44b2-bd38-72b2da31bf13
  • MIRAI run: 6cc8231f-2d1e-48ba-b5bd-1e9c6ad5fc2d
  • PR check IDs:
    • clickbench_254200_1781631821
    • clickbench_254348_1781632113
    • clickbench_254462_1781632207
    • tpch_adapted_1_official_254482_1781632208
    • tpch_adapted_1_official_254644_1781632236
    • tpch_adapted_1_official_254820_1781632564

Merged via the queue into master with commit eb4e1b0 Jun 16, 2026
166 checks passed
@antonio2368
antonio2368 deleted the update-nuraft-async-snapshot-io-livelock branch June 16, 2026 18:27
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants