aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/ginxlog.h
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2019-03-24 15:26:45 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2019-03-24 15:26:45 +0300
commit89f39736f4845e81f350893dd59fd52cedab8b39 (patch)
treeffe9f96b5751cde9b0a81a49b4936938fa8bbe9a /src/include/access/ginxlog.h
parent7d7435c5c5050f280692d87f250fabd7eabc4af4 (diff)
downloadpostgresql-89f39736f4845e81f350893dd59fd52cedab8b39.tar.gz
postgresql-89f39736f4845e81f350893dd59fd52cedab8b39.zip
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
Diffstat (limited to 'src/include/access/ginxlog.h')
-rw-r--r--src/include/access/ginxlog.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/access/ginxlog.h b/src/include/access/ginxlog.h
index b2f3126aa8a..87b1e7bbda3 100644
--- a/src/include/access/ginxlog.h
+++ b/src/include/access/ginxlog.h
@@ -161,6 +161,16 @@ typedef struct ginxlogDeletePage
TransactionId deleteXid; /* last Xid which could see this page in scan */
} ginxlogDeletePage;
+/*
+ * Previous version of ginxlogDeletePage struct, which didn't have deleteXid
+ * field. Used for size comparison (see ginRedoDeletePage()).
+ */
+typedef struct ginxlogDeletePageOld
+{
+ OffsetNumber parentOffset;
+ BlockNumber rightLink;
+} ginxlogDeletePageOld;
+
#define XLOG_GIN_UPDATE_META_PAGE 0x60
/*