On Thu, Jan 16, 2025 at 11:40:51AM +0300, Nazir Bilal Yavuz wrote: > I encountered another problem while rebasing the patch. The problem is > basically we do not expect any pending stats while restoring the stats > at the initdb. However, WAL IOs (WAL read and WAL init IOs for now) > may happen before restoring the stats, so we end up having pending > stats before restoring them and that causes initdb to fail.
On top of 4feba03d8b92, I've reused something close to the patch you have posted previously in case, and the issue with allocations for pending stats should be gone. Could it be possible to post a new version of the patch? You should be able to reuse pgstat_count_backend_io_op[_time]() for your work with WAL data in pg_stat_io if you need a low-level control of things, but I suspect that calling pgstat_count_io_op() & the other should be enough to get the job done with a new IOObject. -- Michael
signature.asc
Description: PGP signature