Don't wake up to check trigger file if none is configured

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Don't wake up to check trigger file if none is configured
Date: 2018-11-24 16:29:22
Message-ID: CAMkU=1y4fJ8YvKpkuw=yTOLAW9_86vyrt2ggMuUBPKOV_zYh-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

A streaming replica waiting on WAL from the master will wake up every 5
seconds to check for a trigger file. This is pointless if no trigger file
has been configured.

The attached patch suppresses the timeout when there is no trigger file
configured.

A minor thing to be sure, but there was a campaign a couple years ago to
remove such spurious wake-ups, so maybe this change is worthwhile.

I noticed that the existing codebase does not have a consensus on what to
pass to WaitLatch for the timeout when the timeout isn't relevant. I picked
0, but -1L also has precedent.

Cheers,

Jeff

Attachment Content-Type Size
WAL_sleep_not_triggered.patch application/octet-stream 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-11-24 16:57:54 Re: [HACKERS] pgbench - allow to store select results into variables
Previous Message Malik Rumi 2018-11-24 16:00:51 Re: could not connect to server, in order to operate pgAdmin/PostgreSQL