aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/utils/activity/pgstat.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/utils/activity/pgstat.c b/src/backend/utils/activity/pgstat.c
index 6f8d2378266..18b7d9b47d6 100644
--- a/src/backend/utils/activity/pgstat.c
+++ b/src/backend/utils/activity/pgstat.c
@@ -1655,7 +1655,15 @@ pgstat_write_statsfile(XLogRecPtr redo)
CHECK_FOR_INTERRUPTS();
- /* we may have some "dropped" entries not yet removed, skip them */
+ /*
+ * We should not see any "dropped" entries when writing the stats
+ * file, as all backends and auxiliary processes should have cleaned
+ * up their references before they terminated.
+ *
+ * However, since we are already shutting down, it is not worth
+ * crashing the server over any potential cleanup issues, so we simply
+ * skip such entries if encountered.
+ */
Assert(!ps->dropped);
if (ps->dropped)
continue;