Re: when the startup process doesn't
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephen Frost <sfrost@snowman.net>, Magnus Hagander <magnus@hagander.net>, Jehan-Guillaume de Rorthais <jgdr@dalibo.com>, Robert Haas <robertmhaas@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-04-20T20:36:42Z
Lists: pgsql-hackers
Hi, On 2021-04-20 14:56:58 -0400, Tom Lane wrote: > I wonder though whether we really need authentication here. pg_ping > already exposes whether the database is up, to anyone who can reach the > postmaster port at all. Would it be so horrible if the "can't accept > connections" error message included a detail about "recovery is X% > done"? Unfortunately I think something like a percentage is hard to calculate right now. Even just looking at crash recovery (vs replication or PITR), we don't currently know where the WAL ends without reading all the WAL. The easiest thing to return would be something in LSNs or bytes and I suspect that we don't want to expose either unauthenticated? I wonder if we ought to occasionally update something like ControlFileData->minRecoveryPoint on primaries, similar to what we do on standbys? Then we could actually calculate a percentage, and it'd have the added advantage of allowing to detect more cases where the end of the WAL was lost. Obviously we'd have to throttle it somehow, to avoid adding a lot of fsyncs, but that seems doable? Greetings, Andres Freund
Commits
-
Un-revert "Disable STARTUP_PROGRESS_TIMEOUT in standby mode."
- ecb01e6ebb5a 15.3 landed
-
Revert "Disable STARTUP_PROGRESS_TIMEOUT in standby mode."
- 1eadfbdd7eb0 15.2 landed
-
Disable STARTUP_PROGRESS_TIMEOUT in standby mode.
- 98e7234242a6 15.2 landed
- 8a2f783cc489 16.0 landed
-
Fix race condition in startup progress reporting.
- 5ccceb2946d4 15.0 landed
-
Report progress of startup operations that take a long time.
- 9ce346eabf35 15.0 landed
-
Add enable_timeout_every() to fire the same timeout repeatedly.
- 732e6677a667 15.0 landed