Hi Bertrand,
> I wonder if we should pass the copied PID to ProcNumberGetTransactionIds() and
> validate it under ProcArrayLock, following the same idea as
> pgstat_fetch_stat_backend_by_pid()?
Yes, done in v9-0002, a new patch. pgstat_read_current_status() passes the
PID it copied, and ProcNumberGetTransactionIds() reports nothing when the
PGPROC entry holds another PID. It changes an exported function, so I
would keep it for HEAD.
> I think it would make sense to add pid at the end in the backbranches (if we
> back patch it), as suggested in [1].
0001 fixes a misreport in 18, so I think it should go there too. v9 puts
the PID at the end of PgStat_Backend, and 0003 puts the user ID after it,
so the existing offsets do not change.
0003 is v8-0002 with only that move.'
Thanks,
Shihao