Repository navigation
Store checkpointer alert: a requested checkpoint is no longer blamed on max_wal_size alone (#4758) - #4791
Merged
Conversation
…on max_wal_size alone (#4758) A requested checkpoint comes from WAL volume reaching max_wal_size, a base backup, or a CHECKPOINT statement, and PostgreSQL's counters do not say which; only the log_checkpoints lines do. The Store Checkpointer Pressure alert and the get_store_metrics text called every one of them WAL-forced and told the reader the store had outrun max_wal_size. They now say "requested checkpoint(s)", name all three causes and log_checkpoints, and offer raising max_wal_size as the remedy for the first cause only. The get_store_metrics tool description says the same about the requested field. No threshold is added and the alert stays INFO.
…requested-wording
…ree causes, not only WAL volume (#4758) The tool description's requested field now says a requested checkpoint is started by WAL volume reaching max_wal_size, a base backup, or a CHECKPOINT statement, and that the counter does not say which. This test pins that clause and fails on the old "checkpoints forced by WAL volume" wording.
erikdarlingdata
marked this pull request as ready for review
September 29, 2026 10:39
This was referenced Sep 29, 2026
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.
Fixes #4758
Why
The Store Checkpointer Pressure alert fires on any requested checkpoint in an interval, next to a slow average sync. Its text called that checkpoint "WAL-forced" and said the store had written more WAL between checkpoints than
max_wal_sizeallows, which steers the reader toward raisingmax_wal_size. But PostgreSQL also counts a base backup and aCHECKPOINTstatement as requested, and its counters do not record which one happened. Only thelog_checkpointslines do. The alert is INFO and never pages, so the harm was a wrong remedy, not a false page.The
get_store_metricscheckpointer note made the same claim and closed with "The informational Store Checkpointer Pressure self-alert says the same", so both are reworded together. The tool description'srequestedfield ("checkpoints forced by WAL volume reaching max_wal_size") made it a third time.Diagnosis confirmed in the code: the pressure test is only
Requested > 0(unchanged, no threshold added), and the alert text asserted the WAL cause unconditionally.Before, for one requested checkpoint with a short average sync (abridged; the test pins the current value and detail):
1 WAL-forced checkpoint(s) over 2 checkpoint(s) in 60.0 minAfter:
1 requested checkpoint(s) over 2 checkpoint(s) in 60.0 minWhat changes
DarlingSelfAlertEvaluator.cs: the alert's current value and short message sayN requested checkpoint(s)where they saidN WAL-forced checkpoint(s). The detail names the three causes. When only the requested arm fired (the average sync is under the bar), it also says the counters do not say which, thatlog_checkpointsdoes, and that raisingmax_wal_sizeis the remedy only for the first cause. Two doc comments that said one requested checkpoint means the store outranmax_wal_sizeare reworded, and a comment that quoted the old "WAL-forced" text now says requested-checkpoint pressure.DarlingMcpStoreMetricsTools.cs: theget_store_metricscheckpointer note says the same in its interval sentence and its pressure sentence, so its closing "the self-alert says the same" is true again. Therequestedclause in the tool description says the same in one clause.StoreToastAndCheckpointerTests(forced-arm case extended to require "base backup", "CHECKPOINT statement",log_checkpointsand the remedy sentence in the detail, and "requested checkpoint(s)" in the current value; the two restart-control pins and the MCP note pin updated to the new text), a newDarlingMcpStoreMetricsToolsTestspin on the description clause, and one assertion message in the liveStoreSelfMetricsTests(the forcedCHECKPOINTthere is a statement, not WAL volume).Unchanged on purpose: the firing conditions and threshold string (
average sync > 10s per checkpoint, or any requested checkpoint),severity: null(INFO through the per-metric map), the sync-arm text, and the rule that the short message carries no "restart" wording. Comment-only mentions of "WAL-forced" inDarlingStoreMetricsReader.cs,StoreSelfMetrics.cs,PgMigrations.cs(an existing migration) and the README's migration table describe history or the counter and stay. The monitored-target advice, which grades a requested share, is a separate decision and is untouched.Test plan
StoreToastAndCheckpointerTestsfailed 4 of 67 (the forced-arm case, the two restart controls that pin the current value, and the MCP note case).StoreToastAndCheckpointerTests,DarlingMcpStoreMetricsToolsTests,CheckpointsTimedRungTests,StoreMetricsSummaryFirstTests,McpToolsListBudgetTestsandStoreSelfMetricsTests: 161 tests, 0 failed, 3 skipped.DarlingMcpStoreMetricsToolsTestsplusStoreToastAndCheckpointerTestsafter adding it: 110 tests, 0 failed.Darling.Testsbuilds with 0 warnings and 0 errors.Darling.Testssuite once, after mergingorigin/dev, withoutDARLING_TEST_PG: Total 17291, Failed 0, Skipped 1137 (live PostgreSQL classes), Not Run 1. That run was before the description pin was added; the pin's two classes were re-run afterwards (line above).StoreToastAndCheckpointerLivePostgresTestsand the live method inStoreSelfMetricsTests); no database was available. The only live-test edit is one assertion message.Worth a second look
get_store_metricstool description changed by one clause, so anything that snapshots tool descriptions will see it. The tools-list budget test passes.CHANGELOG
SECTION: Fixed
ENTRY:
REF:
[The store checkpointer alert blames max_wal_size for any requested checkpoint #4758]: The store checkpointer alert blames max_wal_size for any requested checkpoint #4758