- decoded = XLogReadRecordAlloc(state,
- total_len,
- false /*
allow_oversized */ );
+ if (have_decomp_len)
+ decoded = XLogReadRecordAlloc(state,
+
total_len_decomp,
+ false
/* allow_oversized */ );
+
Won't this result in a performance regression with the additional
blocks when the header crosses multiple pages?
+/* Read length of a record, accounting for possible compression */
+static uint32
+XLogGetRecordTotalLen(XLogRecord *record)
+{
+ if (record->xl_info & XLR_COMPRESSED)
Shouldn't this flag be unset after decompression? Or alternatively
some existing code needs fixing, for example replorigin_identity
doesn't do any masking (but above it replorigin_desc does, so that by
itself seems somewhat inconsistent)
And: it seems like that the patchset tries to compress incompressible
FPI records twice (first record, then whole page, failing both times)?