Re: hot_standby_feedback vs excludeVacuum and snapshots

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Greg Stark <stark(at)mit(dot)edu>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: hot_standby_feedback vs excludeVacuum and snapshots
Date: 2018-09-19 04:37:49
Message-ID: CAEepm=0fuhgLjiwGSvS9Np6a7DyAV54pPkUMbWeZxS4wjp+=cA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 14, 2018 at 6:09 PM Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> At Sat, 4 Aug 2018 14:09:18 +1200, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> wrote in
> > Does anyone know why StandbyReleaseLocks() releases all locks if
> > passed InvalidTransactionId? When would that happen?
>
> AFAICS, it used to be used at shutdown time since hot standby was
> introduced by efc16ea520 from
> ShutdownRecoveryTransactionEnvironment/StandbyReleaseAllLocks.
>
> c172b7b02e (Jan 23 2012) modified StandbyReleaseAllLocks not to
> call StandbyReleaseLocks with InvalidTransactionId and the
> feature became useless, and now it is.
>
> So I think the feature has been obsolete for a long time.

Thank you for this analysis. It looks like dead code that we should
remove in master at least.

> As a similar thing, the following commands leaves AEL even though
> the savepoint is rollbacked.
>
> BEGIN; SAVEPOINT s; LOCK foo; CHECKPOINT; ROLLBACK TO SAVEPOINT s;
>
> This is because the checkpoint issues XLOG_STANDBY_LOCK on foo
> with the top-transaciton XID.
>
> Every checkpoint issues it for all existent locks so
> RecoveryLockList(s) can be bloated with the same lock entries and
> increases lock counts. Although it doesn't seem common to sustain
> AELs for a long time so that the length harms, I don't think such
> duplication is good. Patch attached.

I noticed that too. It seems like it would take a very long time to
cause a problem.

--
Thomas Munro
http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-09-19 04:38:25 Re: [HACKERS] Horrible CREATE DATABASE Performance in High Sierra
Previous Message Kyotaro HORIGUCHI 2018-09-19 04:03:44 Re: Something fishy happening on frogmouth