| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Shinya Kato <shinya11(dot)kato(at)gmail(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Add wal_fpi_bytes_[un]compressed to pg_stat_wal |
| Date: | 2025-10-28 13:04:20 |
| Message-ID: | aQC_VKjVuaqnlc-c@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Oct 28, 2025 at 07:33:00PM +0900, Shinya Kato wrote:
> I investigated previous discussions and found [0]. This thread
> mentioned that XLogInsert() calls XLogRecordAssemble() multiple times
> in its do-while loop, so the value might be invalid.
>
> Based on the discussion above, it seems my previous patch also has the
> same issue.
>
> [0] https://www.postgresql.org/message-id/20200329121944.GA79261%40nol
Dammit, you are right. I didn't see through this one. Even on HEAD
it is true that we may trigger an early exit of XLogInsertRecord() and
call XLogRecordAssemble() multiple times with a different FPI setup.
So we cannot do direct manipulations of pgWalUsage in
XLogRecordAssemble(), we must do these once the record is inserted.
I'll clean up that tomorrow, which can be summarized as something like
the attached (quick fix, need to double-check).
--
Michael
| Attachment | Content-Type | Size |
|---|---|---|
| wal-fpi-fix.patch | text/x-diff | 3.2 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Daniil Davydov | 2025-10-28 13:09:59 | Re: POC: Parallel processing of indexes in autovacuum |
| Previous Message | Alexander Kukushkin | 2025-10-28 13:03:00 | Re: Issue with logical replication slot during switchover |