Re: WAL logging problem in 9.4.3?
От | Andres Freund |
---|---|
Тема | Re: WAL logging problem in 9.4.3? |
Дата | |
Msg-id | 20150703170229.GJ3291@awork2.anarazel.de обсуждение исходный текст |
Ответ на | Re: WAL logging problem in 9.4.3? (Andres Freund <andres@anarazel.de>) |
Ответы |
Re: WAL logging problem in 9.4.3?
|
Список | pgsql-hackers |
On 2015-07-03 18:49:31 +0200, Andres Freund wrote: > But the more interesting question is why that's not hhappening > today. RelationTruncateIndexes() does call the index_build() which > should end up WAL logging the index creation. So that's because there's an XLogIsNeeded() preventing it. Maybe I'm just daft right now (35C outside, 32 inside, so ...), but I'm right now missing how the whole "skip wal logging if relation has just been truncated" optimization can ever actually be crashsafe unless we use a new relfilenode (which we don't!). Sure, we do an heap_sync() at the the end of the transaction. That's nice and all. But it doesn't help if we crash and re-start WAL apply from a checkpoint before the table was created. Because that'll replay the truncation. That's much worse than just the indexes - the rows added by a COPY without WAL logging will also be truncated away, no?
В списке pgsql-hackers по дате отправления: