On Sat, Dec 07, 2024 at 12:31:46PM +0300, Anton A. Melnikov wrote: > Completely agree that the original comment needs to be revised, > since it implies that it is normal for deleted entries to be here, > but it is not the case.
Yep, so applied v2-0001 to document that, and backpatched it as it is
kind of important to know about.
> Maybe it's worth adding a warning as well,
> similar to the one a few lines below in the code?
Assert(!ps->dropped);
if (ps->dropped)
+ {
+ PgStat_HashKey key = ps->key;
+ elog(WARNING, "found non-deleted stats entry %u/%u/%llu"
+ "at server shutdown",
+ key.kind, key.dboid,
+ (unsigned long long) key.objid);
continue;
+ }
/*
* This discards data related to custom stats kinds that are unknown
Not sure how to feel about this suggestion, though. This would
produce a warning when building without assertions, but the assertion
would likely let us more information with a trace during development,
so..
--
Michael
signature.asc
Description: PGP signature
