WAL history files - Pgsql 9.2

Started by Patrick Bover 9 years ago5 messagesgeneral
Jump to latest
#1Patrick B
patrickbakerbr@gmail.com

Hi guys,

Are the history files copied with the wal_files? Or I have to do it
separated?

00000003.history': No such file or directory

I'm using PostgreSQL 9.2.
Cheers
Patrick

#2Venkata B Nagothi
nag1010@gmail.com
In reply to: Patrick B (#1)
Re: WAL history files - Pgsql 9.2

On Mon, Dec 12, 2016 at 7:48 AM, Patrick B <patrickbakerbr@gmail.com> wrote:

Hi guys,

Are the history files copied with the wal_files? Or I have to do it
separated?

00000003.history': No such file or directory

I'm using PostgreSQL 9.2.

Can you please explain the scenario you are referring to ? during streaming
replication ? or during standby promotion ?

Regards,

Venkata B N
Database Consultant

#3Patrick B
patrickbakerbr@gmail.com
In reply to: Venkata B Nagothi (#2)
Re: WAL history files - Pgsql 9.2

2016-12-12 12:00 GMT+13:00 Venkata B Nagothi <nag1010@gmail.com>:

On Mon, Dec 12, 2016 at 7:48 AM, Patrick B <patrickbakerbr@gmail.com>
wrote:

Hi guys,

Are the history files copied with the wal_files? Or I have to do it
separated?

00000003.history': No such file or directory

I'm using PostgreSQL 9.2.

Can you please explain the scenario you are referring to ? during
streaming replication ? or during standby promotion ?

Sure...

I've got:

Master01 (sending wal_files to the slaves)
slave01 (streaming replication from master01 + wal_files)
slave02 (streaming replication from master01 + wal_files)

I'll turn slave01 into a master; on recovery.conf:

trigger_file = '/tmp/pg_failover_trigger';touch /tmp/pg_failover_trigger

Then, the new scenario will be:

slave01 (*NEW MASTER*)
slave02 (streaming replication from slave01 + wal_files)

Will slave02 be able to switch the timeline using wal_files provided by the
new master?
Thanks

#4Patrick B
patrickbakerbr@gmail.com
In reply to: Patrick B (#3)
Re: WAL history files - Pgsql 9.2

2016-12-12 12:09 GMT+13:00 Patrick B <patrickbakerbr@gmail.com>:

2016-12-12 12:00 GMT+13:00 Venkata B Nagothi <nag1010@gmail.com>:

On Mon, Dec 12, 2016 at 7:48 AM, Patrick B <patrickbakerbr@gmail.com>
wrote:

Hi guys,

Are the history files copied with the wal_files? Or I have to do it
separated?

00000003.history': No such file or directory

I'm using PostgreSQL 9.2.

Can you please explain the scenario you are referring to ? during
streaming replication ? or during standby promotion ?

Sure...

I've got:

Master01 (sending wal_files to the slaves)
slave01 (streaming replication from master01 + wal_files)
slave02 (streaming replication from master01 + wal_files)

I'll turn slave01 into a master; on recovery.conf:

trigger_file = '/tmp/pg_failover_trigger';touch /tmp/pg_failover_trigger

Then, the new scenario will be:

slave01 (*NEW MASTER*)
slave02 (streaming replication from slave01 + wal_files)

Will slave02 be able to switch the timeline using wal_files provided by
the new master?
Thanks

No.. it didn't copy. i tested here. I had to manually copy the history file
from /var/lib/pgsql/9.2/data/pg_xlogs from the new master to the same
directory on the slaves.

#5Michael Paquier
michael@paquier.xyz
In reply to: Patrick B (#4)
Re: WAL history files - Pgsql 9.2

On Mon, Dec 12, 2016 at 9:31 AM, Patrick B <patrickbakerbr@gmail.com> wrote:

No.. it didn't copy. i tested here. I had to manually copy the history file
from /var/lib/pgsql/9.2/data/pg_xlogs from the new master to the same
directory on the slaves.

An archive command is able to properly fetch the history files to
define a new timeline. If you rely only on streaming replication, only
9.3 and newer versions are able to do that: the replication protocol
has been extended at this point to allow a standby to fetch from a
primary history files.
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general