pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Shut down transaction tracking at startup process exit.
Date: Mon, 05 Apr 2021 17:29:00 +0000
Message-ID: <E1lTT24-0006de-Nx@gemulon.postgresql.org> (raw)

Shut down transaction tracking at startup process exit.

Maxim Orlov reported that the shutdown of standby server could result in
the following assertion failure. The cause of this issue was that,
when the shutdown caused the startup process to exit, recovery-time
transaction tracking was not shut down even if it's already initialized,
and some locks the tracked transactions were holding could not be released.
At this situation, if other process was invoked and the PGPROC entry that
the startup process used was assigned to it, it found such unreleased locks
and caused the assertion failure, during the initialization of it.

    TRAP: FailedAssertion("SHMQueueEmpty(&(MyProc->myProcLocks[i]))"

This commit fixes this issue by making the startup process shut down
transaction tracking and release all locks, at the exit of it.

Back-patch to all supported branches.

Reported-by: Maxim Orlov
Author: Fujii Masao
Reviewed-by: Maxim Orlov
Discussion: https://postgr.es/m/ad4ce692cc1d89a093b471ab1d969b0b@postgrespro.ru

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b59d3abaf4069454fc212660a00b0b1f45c77467

Modified Files
--------------
src/backend/postmaster/startup.c  | 19 +++++++++++++++++++
src/backend/storage/ipc/standby.c | 15 +++++++++++++++
2 files changed, 34 insertions(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1lTT24-0006de-Nx@gemulon.postgresql.org>
Permalink:  ../E1lTT24-0006de-Nx@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lTT24-0006de-Nx@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: Shut down transaction tracking at startup process exit.
  In-Reply-To: <E1lTT24-0006de-Nx@gemulon.postgresql.org>
  References: <E1lTT24-0006de-Nx@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox