- Notifications
You must be signed in to change notification settings - Fork5
Commit08a7287
committed
Fix corrupt GIN_SEGMENT_ADDITEMS WAL records on big-endian hardware.
computeLeafRecompressWALData() tried to produce a uint16 WAL log field bymemcpy'ing the first two bytes of an int-sized variable. That accidentallyworks on little-endian hardware, but not at all on big-endian. Replay thenthinks it's looking at an ADDITEMS action with zero entries, and reads thefirst 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 surelybe incorrect. To fix, just declare the variable as uint16 instead.Per bug #14295 from Spencer Thomason (much thanks to Spencer for turninghis problem into a self-contained test case). This likely also explainsa previous report of the same symptom from Bernd Helmle.Back-patch to 9.4 where the problem was introduced (by commit14d02f0).Discussion: <20160826072658.15676.7628@wrigleys.postgresql.org>Possible-Report: <2DA7350F7296B2A142272901@eje.land.credativ.lan>1 parent73a802a commit08a7287
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
89 |
| - | |
| 89 | + | |
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
|
0 commit comments
Comments
(0)