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: Initialize atomic variable waitStart in PGPROC, at postmaster st
Date: Mon, 22 Feb 2021 09:26:12 +0000
Message-ID: <E1lE7To-00087c-3r@gemulon.postgresql.org> (raw)

Initialize atomic variable waitStart in PGPROC, at postmaster startup.

Commit 46d6e5f567 added the atomic variable "waitStart" into PGPROC struct,
to store the time at which wait for lock acquisition started. Previously
this variable was initialized every time each backend started. Instead,
this commit makes postmaster initialize it at the startup, to ensure that
the variable should be initialized before any use of it.

This commit also moves the code to initialize "waitStart" variable for
prepare transaction, from TwoPhaseGetDummyProc() to MarkAsPreparingGuts().
Because MarkAsPreparingGuts() is more proper place to do that since
it initializes other PGPROC variables.

Author: Fujii Masao
Reviewed-by: Atsushi Torikoshi
Discussion: https://postgr.es/m/1df88660-6f08-cc6e-b7e2-f85296a2bdab@oss.nttdata.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/twophase.c | 10 ++--------
src/backend/storage/lmgr/proc.c       |  5 +++--
2 files changed, 5 insertions(+), 10 deletions(-)



Message-ID: <E1lE7To-00087c-3r@gemulon.postgresql.org>
Permalink:  ../E1lE7To-00087c-3r@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lE7To-00087c-3r@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: Initialize atomic variable waitStart in PGPROC, at postmaster st
  In-Reply-To: <E1lE7To-00087c-3r@gemulon.postgresql.org>
  References: <E1lE7To-00087c-3r@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