• Heikki Linnakangas's avatar
    The GiST scan algorithm uses LSNs to detect concurrent pages splits, but · 2edc5cd4
    Heikki Linnakangas authored
    temporary indexes are not WAL-logged. We used a constant LSN for temporary
    indexes, on the assumption that we don't need to worry about concurrent page
    splits in temporary indexes because they're only visible to the current
    session. But that assumption is wrong, it's possible to insert rows and
    split pages in the same session, while a scan is in progress. For example,
    by opening a cursor and fetching some rows, and INSERTing new rows before
    fetching some more.
    
    Fix by generating fake increasing LSNs, used in place of real LSNs in
    temporary GiST indexes.
    2edc5cd4
gistutil.c 15.6 KB