All five wakeup call sites duplicate WaitLSNWakeup()'s internal fast-path minWaitedLSN check and add an unnecessary NULL check on waitLSNState. Remove the inline pre-checks and call WaitLSNWakeup() directly. The fast-path check inside WaitLSNWakeup() already returns early when no waiter's target has been reached, so there is no performance difference. The waitLSNState NULL checks are also unnecessary: shared memory is fully initialized before any backend or auxiliary process starts, so waitLSNState is always non-NULL at these call sites. Reported-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/jzq5shdewncpxc35r3s2mcfsmo4bjovkza5mnqf5bdfumhfi3g%40bglckf7dxmw5 Author: Xuneng Zhou <xunengzhou@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Alexander Korotkov <aekorotkov@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/.