aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index a29fa0b3e6a..86d193c89fc 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -1262,6 +1262,23 @@ ShutdownPostgres(int code, Datum arg)
* them explicitly.
*/
LockReleaseAll(USER_LOCKMETHOD, true);
+
+ /*
+ * temp debugging aid to analyze 019_replslot_limit failures
+ *
+ * If an error were thrown outside of a transaction nothing up to now
+ * would have released lwlocks. We probably will add an
+ * LWLockReleaseAll(). But for now make it easier to understand such cases
+ * by warning if any lwlocks are held.
+ */
+#ifdef USE_ASSERT_CHECKING
+ {
+ int held_lwlocks = LWLockHeldCount();
+ if (held_lwlocks)
+ elog(WARNING, "holding %d lwlocks at the end of ShutdownPostgres()",
+ held_lwlocks);
+ }
+#endif
}