pgsql: Pass correct count to WALRead(). - Mailing list pgsql-committers

From Jeff Davis
Subject pgsql: Pass correct count to WALRead().
Date
Msg-id E1rb3lP-006Zvf-NX@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Add assert to WALReadFromBuffers().
Next
From: Nathan Bossart
Date:
Subject: pgsql: Introduce overflow-safe integer comparison functions.