On Thu, Sep 17, 2026 at 06:19:19AM +0000, Grigorev Jurij wrote:
> The check you proposed in the follow-up [1] looks right to me. A partial
> reference at this point cannot have shared_stats or pending data, and
> pgstat_release_entry_ref() can remove it without touching shared state.
> It handles the backend-local partial reference, while this patch prevents
> the same failure from leaving an inconsistent shared hash entry. I agree
> that the two changes should remain independent, as you suggested.
My second patch is an extra defense.. I guess that we should just do
that first.
> I have prepared and build-tested versions for the supported branches
> down to REL_15_STABLE, but I am not attaching them yet so that the HEAD
> change can be reviewed first. I can send them once the shape of this
> patch is agreed.
Something that I did not consider yet is how much we should worry
about the ABI change of pgstat_init_entry().. I could see nothing in
the open that uses it, but the risk seems non-zero. Perhaps we should
just limit that on HEAD.
> Do you think this warrants a deterministic test?
Nah. That feels like a waste of test cycles for what's already a very
narrow case.
--
Michael