Skip to content

Commit 769be67

Browse files
committed
Add information about "generation" when dropping twice pgstats entry
Dropping twice a pgstats entry should not happen, and the error report generated was missing the "generation" counter (tracking when an entry is reused) that has been added in 818119a. Like d92573a, backpatch down to v15 where this information is useful to have, to gather more information from instances where the problem shows up. A report has shown that this error path has been reached on a standby based on 17.3, for a relation stats entry and an OID close to wraparound. Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/CAN4RuQvYth942J2+FcLmJKgdpq6fE5eqyFvb_PuskxF2eL=Wzg@mail.gmail.com Backpatch-through: 15
1 parent a8b31b1 commit 769be67

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/utils/activity/pgstat_shmem.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,11 @@ pgstat_drop_entry_internal(PgStatShared_HashEntry *shent,
833833
*/
834834
if (shent->dropped)
835835
elog(ERROR,
836-
"trying to drop stats entry already dropped: kind=%s dboid=%u objoid=%u refcount=%u",
836+
"trying to drop stats entry already dropped: kind=%s dboid=%u objoid=%u refcount=%u generation=%u",
837837
pgstat_get_kind_info(shent->key.kind)->name,
838838
shent->key.dboid, shent->key.objoid,
839-
pg_atomic_read_u32(&shent->refcount));
839+
pg_atomic_read_u32(&shent->refcount),
840+
pg_atomic_read_u32(&shent->generation));
840841
shent->dropped = true;
841842

842843
/* release refcount marking entry as not dropped */

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