pgsql: Sync unlogged relations to disk after they have been reset.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Sync unlogged relations to disk after they have been reset.
Дата
Msg-id E1XpRJy-0002mF-D0@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/d85b646d059d0a33b6de8b5eafbe978fca2c3426

Modified Files
--------------
src/backend/storage/file/reinit.c |   47 +++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Sync unlogged relations to disk after they have been reset.
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Ensure unlogged tables are reset even if crash recovery errors o