]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix WAL format incompatibility introduced by backpatching of 52ac6cd2d0
authorAlexander Korotkov <akorotkov@postgresql.org>
Sun, 24 Mar 2019 12:26:45 +0000 (15:26 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Sun, 24 Mar 2019 13:31:23 +0000 (16:31 +0300)
commitd1166af192ed0bb40ed9dc53d4e799117403233b
tree78ce75cacd425ced050aab3e9b34829062cb22f1
parent432356a9def4e03cb96babd396e17bbf5a59b2b1
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
src/backend/access/gin/ginxlog.c
src/include/access/gin_private.h