0

I have wal_keep_segments set to 3000. But directory pg_xlog contains more than 6000 WAL segments. Interesting thing that there are ~ 3000 files dated after Aug 14, so files dated before Aug 14 should not be exists, I guess. Also these files have an executable bit set.

$ ls -al pg_xlog | grep -A2 -B2 00000001000034DB0000003B
-rwx------  1 postgres postgres 16777216 Jul 19 07:58 00000001000034DB00000039
-rwx------  1 postgres postgres 16777216 Jul 19 07:58 00000001000034DB0000003A
-rwx------  1 postgres postgres 16777216 Jul 19 07:58 00000001000034DB0000003B
-rw-------  1 postgres postgres 16777216 Aug 14 19:17 0000000100003826000000EA
-rw-------  1 postgres postgres 16777216 Aug 14 19:17 0000000100003826000000EB

```

This cluster has no replication slots, archive_mode is enabled but archive_command is set to /bin/true. I think the new WAL segments are recycled and total amount is about 6000 but postgres does not delete the old files for some reason. Any ideas?

1
  • A found .ready files for those one which are not deleted in archive_status directory.
    – pensnarik
    Aug 15, 2018 at 4:33

1 Answer 1

0

PostgreSQL is not in the habit of setting executable flags on WAL segments.

Besides, it looks like there is a gap in the numbering.

These files must be there by accident, you can delete them.

2
  • I blame barman in this. Understand, that I can remove them but I'm trying to understand what was the reason of this.
    – pensnarik
    Aug 15, 2018 at 4:42
  • I don't know barman, so I cannot answer that. It is often difficult to reconstruct what happened. Aug 15, 2018 at 4:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.