]> granicus.if.org Git - postgresql/commit
Sync unlogged relations to disk after they have been reset.
authorAndres Freund <andres@anarazel.de>
Fri, 14 Nov 2014 17:21:30 +0000 (18:21 +0100)
committerAndres Freund <andres@anarazel.de>
Sat, 15 Nov 2014 00:22:32 +0000 (01:22 +0100)
commitd85b646d059d0a33b6de8b5eafbe978fca2c3426
tree37bb0b9784ed6c8432d129fb1477528526c7e5f0
parentfde9994bc99e701c2479a25bae6d2aaf622ec2fd
Sync unlogged relations to disk after they have been reset.

Unlogged relations are only reset when performing a unclean
restart. That means they have to be synced to disk during clean
shutdowns. During normal processing that's achieved by registering a
buffer's file to be fsynced at the next checkpoint when flushed. But
ResetUnloggedRelations() doesn't go through the buffer manager, so
nothing will force reset relations to disk before the next shutdown
checkpoint.

So just make ResetUnloggedRelations() fsync the newly created main
forks to disk.

Discussion: 20140912112246.GA4984@alap3.anarazel.de

Backpatch to 9.1 where unlogged tables were introduced.

Abhijit Menon-Sen and Andres Freund
src/backend/storage/file/reinit.c