A failure in allocating a new cache entry in the backend-level hash table holding references to shared stats entries would leave the table in an inconsistent state, crash or FATAL at session exit, depending on if there are pending stats. Rather than leaving things in an inconsistent state on OOM, the code is switched to use MemoryContextAllocExtended(MCXT_ALLOC_NO_OOM), so as an allocation failure leads to a cleanup of the hash table before issuing the allocation error. The problem is unlikely going to show up in practice, so no backpatch is done. Note that shared memory is not impacted, only a backend-level hash table. Reported-by: Alex Masterov <amasterov@gmail.com> Discussion: https://postgr.es/m/CA+8z=zumV9sscgK=j1Es+-564maVoO9CMDdB9CsW9=FCziCj3w@mail.gmail.com
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.