• Tom Lane's avatar
    Dept. of further reflection: I looked around to see if any other callers · 1a3de15a
    Tom Lane authored
    of XLogInsert had the same sort of checkpoint interlock problem as
    RecordTransactionCommit, and indeed I found some.  Btree index build
    and ALTER TABLE SET TABLESPACE write data outside the friendly confines
    of the buffer manager, and therefore they have to take their own
    responsibility for checkpoint interlock.  The easiest solution seems to
    be to force smgrimmedsync at the end of the index build or table copy,
    even when the operation is being WAL-logged.  This is sufficient since
    the new index or table will be of interest to no one if we don't get
    as far as committing the current transaction.
    1a3de15a
smgr.c 25 KB