pgsql: Fix WAL format incompatibility introduced by backpatching of52a - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Fix WAL format incompatibility introduced by backpatching of52a
Date
Msg-id E1h82j7-0002lx-0P@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix WAL format incompatibility introduced by backpatching of 52ac6cd2d0

52ac6cd2d0 added new field to ginxlogDeletePage and was backpatched to 9.4.
That led to problems when patched postgres instance applies WAL records
generated by non-patched one.  WAL records generated by non-patched instance
don't contain new field, which patched one is expecting to see.

Thankfully, we can distinguish patched and non-patched WAL records by their data
size.  If we see that WAL record is generated by non-patched instance, we skip
processing of new field.  This commit comes with some assertions.  In
particular, if it appears that on some platform struct data size didn't change
then static assertion will trigger.

Reported-by: Simon Riggs
Discussion: https://postgr.es/m/CANP8%2Bj%2BK4whxf7ET7%2BgO%2BG-baC3-WxqqH%3DnV4X2CgfEPA3Yu3g%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Simon Riggs, Alvaro Herrera
Backpatch-through: 9.4

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/89f39736f4845e81f350893dd59fd52cedab8b39

Modified Files
--------------
src/backend/access/gin/ginxlog.c | 19 ++++++++++++++++++-
src/include/access/ginxlog.h     | 10 ++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Make current_logfiles use permissions assigned to files indata
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Fix WAL format incompatibility introduced by backpatching of52a