You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PostgreSQL on Windows: pending_restart reads false on connections opened after the reload, so we can miss a pending restart #4251
On PostgreSQL running on Windows, pg_settings.pending_restart reads t only in a session that was already open when the configuration was reloaded. A connection opened after the reload reads f for the same setting, even though the change still waits for a restart.
We collect pending_restart from new connections:
PerformanceMonitor.Collectors/PgServerConfigCollector.cs collects it from each target's pg_settings. The class comment calls it "a production trap with no symptom".
The advice reads it back: PerformanceMonitor.Analysis/PgTargetAdvice.Posture.cs:127 and PgTargetAdvice.Buffer.cs:271.
Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingStoreMetricsReader.cs:237 reads the store's own pg_settings, and the managed store runs on Windows on a Windows install.
So on a Windows-hosted PostgreSQL target, or on the managed store itself, we can report "no restart pending" while one is. Connection pooling makes the answer depend on when the pooled connection was opened.
Evidence
Lane D2 found this on a local rig on 2026-09-25, while designing #4215: PostgreSQL 18.6, the build bundled with Darling, on Windows 11. After a reload that changed a restart-only setting:
A session open during the reload showed pending_restart = t.
A new connection showed pending_restart = f.
From a new connection, pg_file_settings still showed the change, with error = 'setting could not be applied'.
Not checked yet: PostgreSQL on Linux, where new backends are forked from the postmaster. That check is part of the fix.
Fix shape
Reproduce it on a rig on Windows, and check Linux the same way. If Linux is not affected, say so with the result.
Where we collect or show pending_restart, also read pg_file_settings (error = 'setting could not be applied', joined on name), and treat either signal as pending. Check the permissions first. The PostgreSQL docs say "By default, the pg_file_settings view can be read only by superusers" (https://www.postgresql.org/docs/current/view-pg-file-settings.html), and a monitoring role usually is not one. Where the view cannot be read, keep today's answer, and say in the output that on a Windows target it can miss a pending restart.
Pin it with a live test that reloads a restart-only change and then reads it from a fresh connection.
Ruled as part of #4215 (see the ruling there): Release A's restart check closes this. It splits error rows by pg_settings.context after postgres -C validation, and it leaves out keys whose source is command line. This issue stays open until that PR merges.
PostgreSQL targets: #4345, merged to dev (d741386). A pending restart on a Windows PostgreSQL target is now read from pg_file_settings, with the probe's pattern valid whether standard_conforming_strings is on or off. The managed store's half is #4336, still open, so this issue stays open.
Activity
erikdarlingdata commentedon Sep 25, 2026
Ruled as part of #4215 (see the ruling there): Release A's restart check closes this. It splits error rows by
pg_settings.contextafterpostgres -Cvalidation, and it leaves out keys whose source iscommand line. This issue stays open until that PR merges.🤖 Generated with Claude Code
https://claude.ai/code/session_01TszxYhJJbTEh4LrZ56NYo3
Store managed-conf verdicts on the owner connection; restart check (#…
Store the SSL trio and timezone/log_timezone verdicts, live-test #4215'…
#4251 round-1 review (P2c): fix the pending-restart predicate (M2, M3…
#4251 round-1 review (P2b): scope the grant advice to Windows, forget…
Fix #4251 round-2 review N1-N5
Detect a pending restart on Windows PostgreSQL targets from pg_file_s…
erikdarlingdata commentedon Sep 25, 2026
Claude posting for Erik Darling
PostgreSQL targets: #4345, merged to dev (d741386). A pending restart on a Windows PostgreSQL target is now read from
pg_file_settings, with the probe's pattern valid whetherstandard_conforming_stringsis on or off. The managed store's half is #4336, still open, so this issue stays open.Merge dev, renumber managed-conf-verdicts rung V144 to V146
erikdarlingdata commentedon Sep 26, 2026
Claude posting for Erik Darling
Closing. Both halves are on dev:
pg_file_settings.pg_file_settingswhen it migrates to and rendersdarling-managed.conf.