Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08a7287

Browse files
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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/access/gin/gindatapage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ typedef struct
8686
charaction;
8787

8888
ItemPointerData*modifieditems;
89-
intnmodifieditems;
89+
uint16nmodifieditems;
9090

9191
/*
9292
* The following fields represent the items in this segment. If 'items' is

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp