Skip to content

tsdb: fix pendingCommit condition for V1 histogram append#18400

Open
cuiweixie wants to merge 1 commit intoprometheus:mainfrom
cuiweixie:tsdb/fix-histogram-pending-commit-condition
Open

tsdb: fix pendingCommit condition for V1 histogram append#18400
cuiweixie wants to merge 1 commit intoprometheus:mainfrom
cuiweixie:tsdb/fix-histogram-pending-commit-condition

Conversation

@cuiweixie
Copy link
Copy Markdown
Contributor

@cuiweixie cuiweixie commented Mar 30, 2026

AppendHistogram set pendingCommit when appendableHistogram returned an error, while the float histogram branch sets it only on success (err == nil). This change aligns the integer histogram path with the float histogram path for consistency.

Per review: the mistaken branch is effectively unreachable in normal operation (the error path returns before effects that would make pendingCommit observable), so this is an internal consistency fix rather than a user-visible bugfix.

NONE

AppendHistogram used err != nil when deciding to set pendingCommit for integer histograms, while the float histogram branch uses err == nil. Align the classic histogram path so pendingCommit is set only after a successful appendableHistogram check, matching appendableFloatHistogram.

Signed-off-by: Weixie Cui <[email protected]>
@bboreham bboreham changed the title tsdb: fix pendingCommit condition for classic histogram append tsdb: fix pendingCommit condition for histogram append Mar 31, 2026
@bboreham
Copy link
Copy Markdown
Member

Hi, thanks for this. The line you changed certainly looks better, but we'd very much prefer to see a test which demonstrates the problem.

@krajorama krajorama self-assigned this Mar 31, 2026
@bboreham bboreham changed the title tsdb: fix pendingCommit condition for histogram append tsdb: fix pendingCommit condition for V1 histogram append Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants