On Sun, Jun 28, 2015 at 12:31 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
On 06/26/2015 10:53 PM, Jeff Janes wrote:
On Fri, Jun 26, 2015 at 11:40 AM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
The page is being split (that's evident from "info=48" above). ginPlaceToPage calls GinNewBuffer, which calls GetFreeIndexPage(). That finds a page that can be recycled, and marks it as used. RecordUsedIndexPage calls MarkBufferDirtyHint(), which in turn calls XLogSaveBufferForHint() to create a full-page image record of the page. That calls XLogBeginInsert() + XLogInsert(), and leaves the begininsert_called == false.
If you had assertions enabled, you'd see the assertion in XLogBeginInsert() to fail.
I'll look into that over the weekend..
Committed a fix, fortunately it was easy to rearrange that code so that XLogBeginInsert() is called after the GinNewBuffer() calls. Can you verify that it fixed your test case, please?
Now I'm getting a different error, with or without checksums.
ERROR: invalid page in block 0 of relation base/16384/16420
CONTEXT: automatic vacuum of table "jjanes.public.foo"
16420 is the gin index. I can't even get the page with pageinspect:
jjanes=# SELECT * FROM get_raw_page('foo_text_array_idx', 0);
ERROR: invalid page in block 0 of relation base/16384/16420