Skip to content

Commit f93133a

Browse files
committed
Print lwlock stats also for aux processes, when built with LWLOCK_STATS
InitAuxiliaryProcess() closely resembles InitProcess(), but it didn't call InitLWLockAccess(). But because InitLWLockAccess() is a no-op unless compiled with LWLOCK_STATS, and everything works even if it's not called, the only consequence was that the stats were not printed for aux processes. This was an oversight in commit 1c6821b, in version 9.5, so it is missing in all supported branches. But since it only affects developers using LWLOCK_STATS and no one has complained, no backpatching. Discussion: https://www.postgresql.org/message-id/20231130202648.7k6agmuizdilufnv@awork3.anarazel.de
1 parent ae2ccf6 commit f93133a

File tree

1 file changed

+7
-0
lines changed
  • src/backend/storage/lmgr

1 file changed

+7
-0
lines changed

src/backend/storage/lmgr/proc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,13 @@ InitAuxiliaryProcess(void)
614614
* Arrange to clean up at process exit.
615615
*/
616616
on_shmem_exit(AuxiliaryProcKill, Int32GetDatum(proctype));
617+
618+
/*
619+
* Now that we have a PGPROC, we could try to acquire lightweight locks.
620+
* Initialize local state needed for them. (Heavyweight locks cannot be
621+
* acquired in aux processes.)
622+
*/
623+
InitLWLockAccess();
617624
}
618625

619626
/*

0 commit comments

Comments
 (0)