PostgreSQL 9.x – pg_basebackup: could not get transaction log end position from server: FATAL: archive member “core.56229” too large for tar format
While I was trying to re-deploy a PostgreSQL streaming replication slave from the master node, I hit the following error:
[root@node2~]# su - postgres -bash-4.1$ /usr/pgsql-9.2/bin/pg_basebackup -D /data/var/lib/pgsql/9.2/data -h node1 --xlog -P -v transaction log start point: 70/CD000020 166537602/235436024 kB (100%), 2/2 tablespaces pg_basebackup: could not get transaction log end position from server: FATAL: archive member "core.56229" too large for tar format
From node1, I found the following files in the $PGDATA:
4.2G ./core.53808 4.2G ./core.55595 4.2G ./core.55698 4.2G ./core.56229
The above was the core dump from previous PostgreSQL DB crashes. By default, PostgreSQL does not create files larger than 1G, so I figured this is not the datafiles. I asked Uncle Google and found out that it’s the core dump by PostgreSQL DB crashes.
Once I removed the files from the $PGDATA directory. The pg_basebackup command executes successfully. The interesting thing that I learnt is, pg_basebackup uses tar in the backend to compress and send the files over to the slave database.