commit dfda6ebaec67 versus wal_keep_segments - Mailing list pgsql-hackers

From Jeff Janes
Subject commit dfda6ebaec67 versus wal_keep_segments
Date
Msg-id CAMkU=1wGY3KyXXLij2QZeUvU_hG6UqanUD=c84UCebSewVcLag@mail.gmail.com
Whole thread Raw
Responses Re: commit dfda6ebaec67 versus wal_keep_segments
List pgsql-hackers
This commit introduced a problem with wal_keep_segments:

commit dfda6ebaec6763090fb78b458a979b558c50b39b
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:   Sun Jun 24 18:06:38 2012 +0300

    Don't waste the last segment of each 4GB logical log file.


in a side window do: watch "ls -lrt /tmp/data/pg_xlog" 

dfda6ebaec/bin/initdb -D /tmp/data
dfda6ebaec/bin/pg_ctl -D /tmp/data -l logfile restart -o "--fsync=off --wal_keep_segments=20"
createdb 
pgbench -i -s10
pgbench -T3600

xlogs accumulate until there are about 26 of them.  Then all of a sudden they drop down to 11 of them.  Then it builds back up to around 26, and seems to stay there permanently.

At some point when it is over-pruning and recycling, it recyles the log files that are still needed for recovery, and if the database crashes at that point it will not recover because it can't find either the primary secondary checkpoint records.

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: psql crash fix
Next
From: Amit Kapila
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]