Repository navigation
Allow to enable nuraft streaming mode - #101427
Conversation
|
Workflow [PR], commit [7b67d03] Summary: ❌
AI ReviewSummaryThis PR adds Keeper-side support for Findings❌ Blockers
Tests
ClickHouse Rules
Performance & Safety
Final Verdict
|
3357175 to
14df629
Compare
| params.max_log_gap_in_stream_ | ||
| = getValueOrMaxInt32AndLogWarning(coordination_settings[CoordinationSetting::nuraft_max_log_gap_in_stream], "nuraft_max_log_gap_in_stream", log); | ||
| params.max_bytes_in_flight_in_stream_ | ||
| = static_cast<int64_t>(coordination_settings[CoordinationSetting::nuraft_max_bytes_in_flight_in_stream]); |
There was a problem hiding this comment.
Casting nuraft_max_bytes_in_flight_in_stream from UInt64 to int64_t without bounds checking can overflow for values greater than INT64_MAX, producing a negative limit. That can break NuRaft throttling semantics in hard-to-debug ways.
Please clamp/validate this setting before assignment (similar to getValueOrMaxInt32AndLogWarning) and log a warning when truncation happens.
There was a problem hiding this comment.
@kssenii let's do something similar to getValueOrMaxInt32AndLogWarning
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
|
The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158 |
| assert "nuraft_max_bytes_in_flight_in_stream=4194304" in conf | ||
|
|
||
|
|
||
| def test_streaming_mode_logged_at_startup(started_cluster): |
There was a problem hiding this comment.
Please add a boundary test for oversized nuraft_max_bytes_in_flight_in_stream (e.g. value > INT64_MAX). The implementation currently stores this setting in a signed int64_t field, so this edge case can silently produce an invalid negative throttle.
Without this coverage, regressions in overflow handling are easy to miss even after the cast/validation fix in KeeperServer.
|
The The bug was reverted by PR #102247 (merged at ~14:48 UTC). All nessie/lakekeeper test failures between these two merges are unrelated to this PR. |
LLVM Coverage Report
Changed lines: 80.65% (25/31) | lost baseline coverage: 4 line(s) · Uncovered code |
|
Stress test (arm_msan) - should be fixed by #102158 Stress test (arm_asan_ubsan, s3) - #95983, I didn't find new fix |
…ecovery path Fix `LOGICAL_ERROR` abort during SLRU filesystem cache dynamic resize (issue #95983, STID `4012-44fe`). **Per-queue stat fix (core bug):** `SLRUFileCachePriority::collectCandidatesForEviction` shared a single `FileCacheReserveStat` across both sub-queue passes. The probationary pass accumulated `releasable_size`, then the protected pass's stopping condition was immediately satisfied by probationary leftovers — so zero protected candidates were collected. `modifySizeLimits` then threw because the protected queue still exceeded its new limit. Fix: use per-queue local stat objects and merge them afterward. **SLRU recovery path fix:** When eviction fails and entries are restored, they now go back to their original queue (protected or probationary) instead of all defaulting to probationary. `EvictionCandidates` captures the queue type before invalidation, and a new `addForRestore` virtual method routes entries back to the correct sub-queue. Recovery uses `result_limits = prev_limits` since entries existed under those limits. **`SplitFileCachePriority::modifySizeLimits` no-op guard fix:** The no-op guard compared `system_segment_size_ratio` (Data/System split) against `size_ratio_` (SLRU protected/probationary ratio) — different concepts. This caused real resizes to be silently skipped. Fix: compare only `max_size` and `max_elements`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101427&sha=7b67d034be1a37512c7fbc8c9b428f2eeb0907ba&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29 Related PR: #101427 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added keeper settings
nuraft_streaming_mode(by defaultfalse),nuraft_max_log_gap_in_stream,nuraft_max_bytes_in_flight_in_stream. Closes #90743.Documentation entry for user-facing changes
Version info
26.4.1.792