pgsql: Pass correct count to WALRead().

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Pass correct count to WALRead().
Date: 2024-02-16 19:20:47
Message-ID: E1rb3lP-006Zvf-NX@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Pass correct count to WALRead().

Previously, some callers requested XLOG_BLCKSZ bytes
unconditionally. While this did not cause a problem, because the extra
bytes are ignored, it's confusing and makes it harder to add safety
checks. Additionally, the comment about zero padding was incorrect.

With this commit, all callers request the number of bytes they
actually need.

Author: Bharath Rupireddy
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/CALj2ACWBRFac2TingD3PE3w2EBHXUHY3=AEEZPJmqhpEOBGExg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/73f0a1326608ac3a7d390706fdeec59fe4dc42c0

Modified Files
--------------
src/backend/access/transam/xlogutils.c | 7 +------
src/backend/postmaster/walsummarizer.c | 7 +------
src/backend/replication/walsender.c | 2 +-
3 files changed, 3 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2024-02-16 19:38:40 pgsql: Introduce overflow-safe integer comparison functions.
Previous Message Jeff Davis 2024-02-16 18:48:06 pgsql: Add assert to WALReadFromBuffers().