]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Shut down transaction tracking at startup process exit.
authorFujii Masao <fujii@postgresql.org>
Mon, 5 Apr 2021 17:25:37 +0000 (02:25 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 5 Apr 2021 17:27:48 +0000 (02:27 +0900)
commite3bf9621632cc369fbedd15743daf17e55f8db62
tree0b5fd072e9522a3b310e7cfa98b7e6a73a5e236a
parent605ef23c7c0fb44f841ec8f1f588325dd8fc951e
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
src/backend/postmaster/startup.c
src/backend/storage/ipc/standby.c