postgresql/src
Andres Freund 1667148a4d Improve representation of 'moved partitions' indicator on deleted tuples.
Previously a tuple that has been moved to a different partition (see
f16241bef7), 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
2018-05-01 13:30:12 -07:00
..
backend Fix interaction of foreign tuple routing with remote triggers. 2018-05-01 13:21:46 -04:00
bin Ignore file generated during pg_upgrade testing 2018-04-30 12:39:29 -04:00
common Enlarge find_other_exec's meager fgets buffer 2018-04-19 10:45:15 -03:00
fe_utils Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
include Improve representation of 'moved partitions' indicator on deleted tuples. 2018-05-01 13:30:12 -07:00
interfaces perltidy: Add option --nooutdent-long-comments 2018-04-27 11:37:43 -04:00
makefiles Remove Windows module-list-dumping code. 2018-04-30 13:20:13 -04:00
pl Remove plperl isnan hack 2018-04-30 14:34:05 -04:00
port Preliminary work for pgindent run. 2018-04-26 14:45:04 -04:00
template Force "restrict" not to be used when compiling with xlc. 2017-10-13 12:15:06 -07:00
test Document that subscription tests require hstore 2018-05-01 10:33:02 -04:00
timezone Update time zone data files to tzdata release 2018d. 2018-04-29 15:50:08 -04:00
tools Remove Windows module-list-dumping code. 2018-04-30 13:20:13 -04:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Un-break contrib install with llvm. 2018-04-28 14:45:39 -04:00
Makefile.shlib Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00