Commit f05ed5a
committed
Initialize atomic variable waitStart in PGPROC, at postmaster startup.
Commit 46d6e5f 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.com1 parent efbfb64 commit f05ed5aCopy full SHA for f05ed5a
File tree
Expand file treeCollapse file tree
2 files changed
+5
-10
lines changedOpen diff view settings
Filter options
- src/backend
- access/transam
- storage/lmgr
Expand file treeCollapse file tree
2 files changed
+5
-10
lines changedOpen diff view settings
Collapse file
src/backend/access/transam/twophase.c
Copy file name to clipboardExpand all lines: src/backend/access/transam/twophase.c+2-8Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
475 | 475 | |
476 | 476 | |
477 | 477 | |
| 478 | + |
478 | 479 | |
479 | 480 | |
480 | 481 | |
| ||
873 | 874 | |
874 | 875 | |
875 | 876 | |
876 | | - |
877 | 877 | |
878 | | - |
879 | | - |
880 | | - |
881 | | - |
882 | | - |
883 | | - |
884 | | - |
| 878 | + |
885 | 879 | |
886 | 880 | |
887 | 881 | |
|
Collapse file
src/backend/storage/lmgr/proc.c
Copy file name to clipboardExpand all lines: src/backend/storage/lmgr/proc.c+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
281 | 281 | |
282 | 282 | |
283 | 283 | |
| 284 | + |
284 | 285 | |
285 | 286 | |
286 | 287 | |
| ||
402 | 403 | |
403 | 404 | |
404 | 405 | |
405 | | - |
| 406 | + |
406 | 407 | |
407 | 408 | |
408 | 409 | |
| ||
581 | 582 | |
582 | 583 | |
583 | 584 | |
584 | | - |
| 585 | + |
585 | 586 | |
586 | 587 | |
587 | 588 | |
|
0 commit comments