The pg_xlog
directory for my master cluster looks like this:
-rw------- 1 postgres postgres 16M Jun 21 21:42 000000010000000000000001
-rw------- 1 postgres postgres 16M Jun 21 22:42 000000010000000000000002
-rw------- 1 postgres postgres 16M Jun 21 23:42 000000010000000000000003
-rw------- 1 postgres postgres 16M Jun 22 00:42 000000010000000000000004
-rw------- 1 postgres postgres 16M Jun 22 01:42 000000010000000000000005
-rw------- 1 postgres postgres 16M Jun 22 01:49 000000010000000000000006
-rw------- 1 postgres postgres 16M Jun 22 01:55 000000010000000000000007
-rw------- 1 postgres postgres 16M Jun 22 02:05 000000010000000000000008
-rw------- 1 postgres postgres 16M Jun 22 02:30 000000010000000000000009
-rw------- 1 postgres postgres 16M Jun 22 02:50 00000001000000000000000A
The pg_xlog/archive_status
directory looks like this:
-rw------- 1 postgres postgres 0 Jun 22 01:49 000000010000000000000006.done
-rw------- 1 postgres postgres 0 Jun 22 01:55 000000010000000000000007.done
-rw------- 1 postgres postgres 0 Jun 22 02:05 000000010000000000000008.done
-rw------- 1 postgres postgres 0 Jun 22 02:30 000000010000000000000009.done
When I first turned on archiving 006
was the current segment, but why weren't 001
-005
archived anyway? Last time I set up archiving on an existing cluster (which was yesterday - I've been experimenting), all log segments were archived when I turned archiving on, despite the pg_xlog
directory containing more than 50 previous log segments.
Relevant settings:
wal_level = hot_standby
archive_mode = on
wal_keep_segments = 2048 # I know, right :)
archive_timeout = 3600
archive_command = 'rsync -aq --delay-updates --ignore-existing %p postgres@db-slave:/mnt/pgsql/'
Note: I did change all of these settings (including was_level
, which was minimal
previously) when I turned on archiving earlier. Could it be that my wal level wasn't sufficient to warrant archiving, or because there is a mismatch between the prior level and the current level?