• Heikki Linnakangas's avatar
    Fix double-XLogBeginInsert call in GIN page splits. · a45c70ac
    Heikki Linnakangas authored
    If data checksums or wal_log_hints is on, and a GIN page is split, the code
    to find a new, empty, block was called after having already called
    XLogBeginInsert(). That causes an assertion failure or PANIC, if finding the
    new block involves updating a FSM page that had not been modified since last
    checkpoint, because that update is WAL-logged, which calls XLogBeginInsert
    again. Nested XLogBeginInsert calls are not supported.
    
    To fix, rearrange GIN code so that XLogBeginInsert is called later, after
    finding the victim buffers.
    
    Reported by Jeff Janes.
    a45c70ac
ginentrypage.c 18.5 KB