pgsql: Remove read_archive_file()'s "count" parameter.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove read_archive_file()'s "count" parameter.
Date: 2026-03-24 16:17:21
Message-ID: E1w54RV-001G7p-02@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove read_archive_file()'s "count" parameter.

Instead, always try to fill the allocated buffer completely.
The previous coding apparently intended (though it's undocumented)
to read only small amounts of data until we are able to identify the
WAL segment size and begin filtering out unwanted segments. However
this extra complication has no measurable value according to simple
testing here, and it could easily be a net loss if there is a
substantial amount of non-WAL data in the archive file before the
first WAL file.

Discussion: https://postgr.es/m/3341199.1774221191@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ca1f1ade3f64f53c5319ee2c7db71a669a38cc83

Modified Files
--------------
src/bin/pg_waldump/archive_waldump.c | 27 +++++++++------------------
src/bin/pg_waldump/pg_waldump.h | 3 ---
2 files changed, 9 insertions(+), 21 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Álvaro Herrera 2026-03-24 16:32:40 pgsql: Avoid including clog.h in proc.h
Previous Message Álvaro Herrera 2026-03-24 16:11:50 pgsql: Don't include storage/lock.h in so many headers