Re: archive_command not being executed

From: Eric D <ericd81(at)hotmail(dot)com>
To: Jeremy Schneider <schneider(at)ardentperf(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: archive_command not being executed
Date: 2017-11-15 03:22:47
Message-ID: MWHPR12MB19336044317087CEBE61ED49BF290@MWHPR12MB1933.namprd12.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Jeremy,

Thanks for the info on 9.3 vs 9.5. While searching for Paul's suggestion I'd seen the same thing, but didn't "reply all" so my response didn't make it into the mailing list.

Regarding your question, as I understand the process, you need to get the WAL files being shipped over to the standby before you start streaming replication. The sequence of events I think is supposed to happen is:

1. Start WAL file shipping from master->standby
2. Run pg_basebackup from master->standby
3. With a recovery.conf in place, start the standby. The recovery.conf needs the connection info for the master for the streaming replication, but it also needs the location of the WAL files, to replay what's been going on during the pg_basebackup.

I don't think streaming replication has a way to pick up the activity covered in the WAL files.

________________________________
From: Jeremy Schneider <schneider(at)ardentperf(dot)com>
Sent: Monday, November 13, 2017 3:56 PM
To: ericd81(at)hotmail(dot)com
Cc: PostgreSQL General; Paul Jungwirth
Subject: Re: [GENERAL] archive_command not being executed

Hi Eric,

Thanks for using PostgreSQL!

On Fri, Nov 10, 2017 at 9:26 AM, Paul Jungwirth
<pj(at)illuminatedcomputing(dot)com> wrote:
> Oh this has happened to me before. :-) On SB1 you need to set
> archive_mode to always (not on). Otherwise it is ignored when running as a
> standby.

It looks to me like this feature was not added until 9.5 and Eric is
running 9.3 :(

> On 11/10/2017 09:10 AM, Eric D wrote:
>> I have a standby db server (SB1) that will soon become the master. SB1
>> is set up with streaming replication from the current master. I'm
>> trying to set up a third server (SB2) as a slave/standby to SB1, so that
>> when SB1 becomes the master, there will be a standby for it. First step
>> is to get WAL files shipped from SB1->SB2.

Eric,

From my reading of the docs and commit logs, standby databases
couldn't archive their WALs until 9.5.

https://www.postgresql.org/message-id/CANkGpBs7qgAkgQ-OPZY0EsaM6+WUE5MgpyeHCGo_eOQ7tJVyyg@mail.gmail.com
http://paquier.xyz/postgresql-2/postgres-9-5-feature-highlight-archive-mode-always/
Postgres 9.5 feature highlight - archive_mode = always<http://paquier.xyz/postgresql-2/postgres-9-5-feature-highlight-archive-mode-always/>
paquier.xyz
Postgres 9.5 feature highlight - archive_mode = always

There is a section in the 9.3 docs about cascading replication:
https://www.postgresql.org/docs/9.3/static/warm-standby.html#CASCADING-REPLICATION
PostgreSQL: Documentation: 9.3: Log-Shipping Standby Servers<https://www.postgresql.org/docs/9.3/static/warm-standby.html#CASCADING-REPLICATION>
www.postgresql.org
25.2. Log-Shipping Standby Servers. Continuous archiving can be used to create a high availability (HA) cluster configuration with one or more standby servers ready ...

It seems to me this is based on streaming replication only. Looks
like it's not designed (in 9.3) to start archiving until it becomes a
primary. "You will also need to set primary_conninfo in the
downstream standby to point to the cascading standby."

Are you able to configure a cascading replica by using streaming
replication on your 9.3 system, without WAL archiving on the standby?

-Jeremy

--
http://about.me/jeremy_schneider
[https://aboutme.imgix.net/background/users/j/e/r/jeremy_schneider_1364416900_46.jpg?q=80&dpr=1&auto=format&fit=max&w=250&h=140&rect=0,0,1396,732]<http://about.me/jeremy_schneider>

Jeremy Schneider on about.me<http://about.me/jeremy_schneider>
about.me
I am an Engineer, consultant, and Trainer in the United States. Read my blog.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ronen Nofar 2017-11-15 09:17:17 Query on pg_settings view
Previous Message John R Pierce 2017-11-14 23:38:06 Re: jsonb