Обсуждение: Server writing short WAL files

Поиск
Список
Период
Сортировка

Server writing short WAL files

От
beamsplitter@gmail.com
Дата:
Hi,

I'm having trouble with WAL files. Every 4th WAL file written by the server
into pg_xlog is 24576 bytes instead of 16MB. A short WAL causes a fatal
error during recovery.

This behavior is perfectly consistent. For example, if archive_timeout is 5
mins, every 20 minutes the new WAL file is 24576 bytes, followed 5 mins later
by a 16MB one. By adjusting the archive_timeout, I can change the interval
-- e.g. every 3rd or 5th WAL file is short -- but the general behavior is the
same.

Here's my WAL config:

wal_level = archive
fsync = on
#synchronous_commit = on
#wal_sync_method = fsync
full_page_writes = on
wal_buffers = -1
#wal_writer_delay = 200ms
#commit_delay = 0
#commit_siblings = 5
checkpoint_segments = 10
checkpoint_timeout = 6min
checkpoint_completion_target = 0.6
#checkpoint_warning = 30s
archive_mode = on
archive_command = '/usr/local/sbin/postgresql_archive.sh %p %f'
archive_timeout = 5min

Does anyone know how to fix this?

Postgres version 9.1.4 on Amazon Linux, installed from the yum package
manager.

Thanks.

Re: Server writing short WAL files

От
Tom Lane
Дата:
beamsplitter@gmail.com writes:
> I'm having trouble with WAL files. Every 4th WAL file written by the server
> into pg_xlog is 24576 bytes instead of 16MB. A short WAL causes a fatal
> error during recovery.

Hm.  It's fairly hard to see how you could get into such a state to
start with, but once there was a short WAL file present in pg_xlog,
the server might keep on recycling it for re-use.  Try physically
deleting or padding out the short file.

            regards, tom lane