postgresql/src
Tom Lane 36646d3aff Fix corrupt GIN_SEGMENT_ADDITEMS WAL records on big-endian hardware.
computeLeafRecompressWALData() tried to produce a uint16 WAL log field by
memcpy'ing the first two bytes of an int-sized variable.  That accidentally
works on little-endian hardware, but not at all on big-endian.  Replay then
thinks it's looking at an ADDITEMS action with zero entries, and reads the
first two bytes of the first TID therein as the next segno/action,
typically leading to "unexpected GIN leaf action" errors during replay.
Even if replay failed to crash, the resulting GIN index page would surely
be incorrect.  To fix, just declare the variable as uint16 instead.

Per bug #14295 from Spencer Thomason (much thanks to Spencer for turning
his problem into a self-contained test case).  This likely also explains
a previous report of the same symptom from Bernd Helmle.

Back-patch to 9.4 where the problem was introduced (by commit 14d02f0bb).

Discussion: <20160826072658.15676.7628@wrigleys.postgresql.org>
Possible-Report: <2DA7350F7296B2A142272901@eje.land.credativ.lan>
2016-09-03 13:28:53 -04:00
..
backend Fix corrupt GIN_SEGMENT_ADDITEMS WAL records on big-endian hardware. 2016-09-03 13:28:53 -04:00
bin Fix initdb misbehavior when user mis-enters superuser password. 2016-08-30 15:25:01 -04:00
common pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fe_utils Fix assorted places in psql to print version numbers >= 10 in new style. 2016-08-16 15:58:46 -04:00
include Update comments to reflect code rearrangement. 2016-08-31 12:39:58 +05:30
interfaces Add a nonlocalized version of the severity field to client error messages. 2016-08-26 16:20:24 -04:00
makefiles Fix typos in comments and doc 2016-01-28 16:47:36 +09:00
pl Translation updates 2016-08-29 12:00:00 -04:00
port Promote pg_dumpall shell/connstr quoting functions to src/fe_utils. 2016-08-08 10:07:46 -04:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Don't require dynamic timezone abbreviations to match underlying time zone. 2016-09-02 17:29:31 -04:00
timezone Update time zone data files to tzdata release 2016f. 2016-08-05 12:59:29 -04:00
tools Final pgindent + perltidy run for 9.6. 2016-08-15 13:42:51 -04:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create src/fe_utils/, and move stuff into there from pg_dump's dumputils. 2016-03-24 15:55:57 -04:00
Makefile.global.in Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
Makefile.shlib Make the AIX case of Makefile.shlib safe for parallel make. 2016-07-23 20:30:03 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00