mirror of
https://github.com/postgres/postgres.git
synced 2025-10-28 11:55:03 +03:00
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 in818119afcc. Liked92573adcb, 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
This commit is contained in:
@@ -874,11 +874,12 @@ pgstat_drop_entry_internal(PgStatShared_HashEntry *shent,
|
|||||||
*/
|
*/
|
||||||
if (shent->dropped)
|
if (shent->dropped)
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"trying to drop stats entry already dropped: kind=%s dboid=%u objid=%" PRIu64 " refcount=%u",
|
"trying to drop stats entry already dropped: kind=%s dboid=%u objid=%" PRIu64 " refcount=%u generation=%u",
|
||||||
pgstat_get_kind_info(shent->key.kind)->name,
|
pgstat_get_kind_info(shent->key.kind)->name,
|
||||||
shent->key.dboid,
|
shent->key.dboid,
|
||||||
shent->key.objid,
|
shent->key.objid,
|
||||||
pg_atomic_read_u32(&shent->refcount));
|
pg_atomic_read_u32(&shent->refcount),
|
||||||
|
pg_atomic_read_u32(&shent->generation));
|
||||||
shent->dropped = true;
|
shent->dropped = true;
|
||||||
|
|
||||||
/* release refcount marking entry as not dropped */
|
/* release refcount marking entry as not dropped */
|
||||||
|
|||||||
Reference in New Issue
Block a user