Re: Question regarding "Make archiver process an auxiliary process. commit"

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Sravan Kumar <sravanvcybage@gmail.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2023-02-01T06:51:48Z
Lists: pgsql-hackers
On Tue, Jan 31, 2023 at 08:30:13PM -0800, Nathan Bossart wrote:
> I'm not sure why I thought time.h was no longer needed.  time() is clearly
> used elsewhere in this file.  Here's a new version with that added back.

Ah, I see.  The key point is that curtime and last_copy_time will most
likely be the same value as time() is second-based, so timeout is
basically always PGARCH_AUTOWAKE_INTERVAL.  There is no need to care
about time_to_stop, as we just go through and exit if it happens to be
switched to true.  Applied v3, keeping time_to_stop as it is in v2 and
v3 so as we don't loop again on a postmaster death.
--
Michael

Commits

  1. Simplify main waiting loop of the archiver process

  2. Remove promote_trigger_file.

  3. Suppress useless wakeups in walreceiver.

  4. Make archiver process an auxiliary process.