Dept. of further reflection: I looked around to see if any other callers
authorTom Lane
Sun, 15 Aug 2004 23:44:46 +0000 (23:44 +0000)
committerTom Lane
Sun, 15 Aug 2004 23:44:46 +0000 (23:44 +0000)
commit1a3de15a3a4c1215acdc0409aa2776213b47ff3c
tree986f1560f490f42bbfec6c6fd5f2b3d8a5f23a3c
parent057ea3471f2e66da5e9d2c017a5484b885c44adf
Dept. of further reflection: I looked around to see if any other callers
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.
src/backend/access/nbtree/nbtsort.c
src/backend/commands/tablecmds.c
src/backend/storage/smgr/smgr.c