On Thu, Aug 5, 2021 at 6:28 AM Simon Riggs <simon.ri...@enterprisedb.com> wrote: > Hmm, there is no information in WAL to describe the line pointers > being truncated by PageTruncateLinePointerArray(). We just truncate > every time we see a XLOG_HEAP2_VACUUM record and presume it does the > same thing as the original change. > > If that is safe, then we don't need to put the truncation on a WAL > record at all, we just truncate after every XLOG_HEAP2_PRUNE record.
I agree that that's how we'd do it. This approach is no different to assuming that PageRepairFragmentation() reliably produces a final defragmented page image deterministically when called after we prune. These days we automatically verify assumptions like this via wal_consistency_checking. It would absolutely be able to catch any bugs in PageTruncateLinePointerArray(), since the truncate code path has plenty of coverage within the regression tests. -- Peter Geoghegan