Skip to content

Commit baa2e44

Browse files
committed
check for max_prepared_xacts == 0 before locking GXact
1 parent 52677a6 commit baa2e44

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/access/transam/twophase.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,14 @@ LockGXact(const char *gid, Oid user)
631631
before_shmem_exit(AtProcExit_Twophase, 0);
632632
twophaseExitRegistered = true;
633633
}
634+
635+
/* here we know in advance that there are no prepared transactions */
636+
if (max_prepared_xacts == 0)
637+
ereport(ERROR,
638+
(errcode(ERRCODE_UNDEFINED_OBJECT),
639+
errmsg("prepared transaction with identifier \"%s\" does not exist",
640+
gid)));
641+
634642
MyLockedGxact = NULL;
635643
i = string_hash(gid, 0) % max_prepared_xacts;
636644
Retry:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy