Repository navigation
Report log store time in the slow append_entries warning - #149
Open
yackushevas wants to merge 2 commits into
Open
yackushevas wants to merge 2 commits into
yackushevas wants to merge 2 commits into
Conversation
The warning on slow append_entries handling has a single timer covering the whole handler, so there is no way to tell whether the time went to the log store (storing entries and waiting for their durability) or elsewhere (locks, state machine callbacks). Accumulate the time spent on log store operations into a separate counter and report it as "log_store <N> ms" right after the existing total, so that existing parsers of "took long time (N ms)" keep working.
Drop the comment that only restates the names, put the initializer list on leading commas and the destructor body on one line, like the other local guard structs in this file.
yackushevas
marked this pull request as ready for review
November 23, 2026 14:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
handle_append_entriestimes the whole handler with one timer, so the warning cannot tell whether the time went to the log store or to the rest of the handler (locks, state machine callbacks, a busy raft thread).Add a second accumulator for the log store write path:
store_log_entryon both the overwrite and the append path,end_of_append_batch, and the wait for durability withparallel_log_appending_. It is reported right after the total:The new text comes after
took long time (N ms)and adds no parentheses, so parsers matchingtook long time \((\d+) ms\)keep returning the total.In our ClickHouse Keeper production cluster these warnings (118 in 6 hours on 4 of 6 nodes, 500–1534 ms) gave no way to tell fsync stalls from lock waits or raft-thread starvation.
Verified with a ClickHouse build on this branch: in a 3-node keeper cluster with
heart_beat_interval_ms=100, a follower withmin_time_between_fsyncs_ms=600(every changelog flush is delayed) logged the line above and two more like it, withlog_store0–1 ms below the total; the other nodes logged none.