Add more debugging information when dropping twice pgstats entry
authorMichael Paquier <[email protected]>
Fri, 7 Jun 2024 09:46:30 +0000 (18:46 +0900)
committerMichael Paquier <[email protected]>
Fri, 7 Jun 2024 09:46:30 +0000 (18:46 +0900)
commit83f415e2d92e7a6f28fd816cd23f09d24801bd3c
treef0936e9f2f4db89d820d0b2500816f0a617273fd
parent8405d5a37a25c53e568b2bf290a0ba5189940190
Add more debugging information when dropping twice pgstats entry

Floris Van Nee has reported a bug in the pgstats facility where a stats
entry already dropped would get again dropped.  This case should not
happen, still the error generated did not offer any details about the
stats entry getting dropped.

This commit improves the error message generated to inform about the
stats entry kind, database OID, object OID and refcount, which should
help to debug more the problem reported.  Bertrand Drouvot has been
independently able to reach this error path while writing a new feature,
and more details about the failure would have been helpful for
debugging.

Author: Andres Freund, Bertrand Drouvot
Discussion: https://postgr.es/m/20240505160915[email protected]
Discussion: https://postgr.es/m/ZkM30paAD8Cr/[email protected]
Backpatch-through: 15
src/backend/utils/activity/pgstat_shmem.c