pgsql: Improve representation of 'moved partitions' indicator ondelete

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Improve representation of 'moved partitions' indicator ondelete
Дата
Msg-id E1fDbxT-00050z-UR@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Improve representation of 'moved partitions' indicator on deleted tuples.

Previously a tuple that has been moved to a different partition (see
f16241bef7c), set the block number on the old tuple to an invalid
value to indicate that fact. But the tuple offset was left
untouched. That turned out to trigger a wal_consistency_checking
failure as reported by Peter Geoghegan, as the offset wasn't
always overwritten during WAL replay.

Heikki observed that we're wasting valuable data by not putting
information also in the offset. Thus set that to
MovedPartitionsOffsetNumber when a tuple indicates it has moved.

We continue to set the block number to MovedPartitionsBlockNumber, as
that seems more likely to cause problems for code not updated to know
about moved tuples.

As t_ctid's offset number is now always set, this refinement also
fixes the wal_consistency_checking issue.

This technically is a minor disk format break, with previously created
moved tuples not being recognized anymore. But since there not even
has been a beta release since f16241bef7c...

Reported-By: Peter Geoghegan
Author: Heikki Linnakangas, Amul Sul
Discussion: https://postgr.es/m/CAH2-Wzm9ty+1BX7-GMNJ=xPRg67oJTVeDNdA9LSyJJtMgRiCMA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1667148a4dd98cea28b8b53d57dbc1eece1b0b5c

Modified Files
--------------
src/include/access/htup_details.h | 29 ++++++++++++-----------------
src/include/storage/itemptr.h     | 29 +++++++++++++++++++++++++++--
2 files changed, 39 insertions(+), 19 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Clean up warnings from -Wimplicit-fallthrough.