pgsql: Initialize atomic variable waitStart in PGPROC, at postmaster st

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: Initialize atomic variable waitStart in PGPROC, at postmaster st

Fujii Masao-3
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@...

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(-)