Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.

Lists: pgsql-committerspgsql-hackers
From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 09:49:09
Message-ID: 20100212094909.3C3377541C5@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Log Message:
-----------
Reduce the chatter to the log when starting a standby server. Don't
echo all the recovery.conf options. Don't emit the "initializing
recovery connections" message, which doesn't mean anything to a user.
Remove the "starting archive recovery" message and replace the
"automatic recovery in progress" message with a more informative message
saying whether the server is doing PITR, normal archive recovery, or
standby mode.

Modified Files:
--------------
pgsql/src/backend/access/transam:
xlog.c (r1.372 -> r1.373)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.372&r2=1.373)


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(at)postgresql(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 14:42:58
Message-ID: 1265985778.7341.4143.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Fri, 2010-02-12 at 09:49 +0000, Heikki Linnakangas wrote:
> Log Message:
> -----------
> Reduce the chatter to the log when starting a standby server. Don't
> echo all the recovery.conf options. Don't emit the "initializing
> recovery connections" message, which doesn't mean anything to a user.
> Remove the "starting archive recovery" message and replace the
> "automatic recovery in progress" message with a more informative message
> saying whether the server is doing PITR, normal archive recovery, or
> standby mode.

Not happy with these changes without discussion.

* "entering standby mode" isn't a more informative message. Two people
have already said on-list that "standby mode" name might need to be
changed. More informative, for me, would be something like "entering
streaming replication mode" and having a parameter called replication
would also make that clearer.

* If you change the HS startup messages you need to change the docs also

--
Simon Riggs www.2ndQuadrant.com


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 14:55:40
Message-ID: 4B756BEC.4040209@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Simon Riggs wrote:
> * "entering standby mode" isn't a more informative message. Two people
> have already said on-list that "standby mode" name might need to be
> changed.

Well, I'm all ears for better suggestions.

> More informative, for me, would be something like "entering
> streaming replication mode" and having a parameter called replication
> would also make that clearer.

That doesn't accurately describe what the standby_mode setting does. It
doesn't imply streaming replication. It means that the server doesn't
end recovery when it reaches end of WAL, but keeps trying.

> * If you change the HS startup messages you need to change the docs also

Thanks, fixed.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 15:14:41
Message-ID: 603c8f071002120714q69ea4656rbb82eb3b2cb8e6c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Fri, Feb 12, 2010 at 9:55 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> That doesn't accurately describe what the standby_mode setting does. It
> doesn't imply streaming replication. It means that the server doesn't
> end recovery when it reaches end of WAL, but keeps trying.

I think I'm going to add my name to the list of people who are unhappy
with standby_mode as a parameter name. I really like the design of
the feature, but the name is just not that clear. You can't read that
parameter name and immediately know what it's trying to do.
Furthermore, if you're wanting to use pg_standby, you might be
forgiven for thinking that you should set standby_mode = on; but in
fact that's exactly the wrong thing to do.

One possibility that occurs to me is that we could call it something
like integrated_standby; but I'm not attached to that.

...Robert


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 15:27:20
Message-ID: 4B757358.1020007@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Robert Haas wrote:
> Furthermore, if you're wanting to use pg_standby, you might be
> forgiven for thinking that you should set standby_mode = on; but in
> fact that's exactly the wrong thing to do.

Yeah, I think that's the main weakness of the name "standby_mode". It's
pretty descriptive otherwise, we call that mode of operation "standby"
everywhere, and always have.

I'm not sure I dare to say this out loud after Simon's previous
outburst, but removing or renaming pg_standby would help with that...

> One possibility that occurs to me is that we could call it something
> like integrated_standby; but I'm not attached to that.

Anything with the word 'standby' in it suffers from the same problem,
maybe not as badly but still.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 15:28:33
Message-ID: 603c8f071002120728s674b9e79lef18534e37077abb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Fri, Feb 12, 2010 at 10:27 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Robert Haas wrote:
>> Furthermore, if you're wanting to use pg_standby, you might be
>> forgiven for thinking that you should set standby_mode = on; but in
>> fact that's exactly the wrong thing to do.
>
> Yeah, I think that's the main weakness of the name "standby_mode". It's
> pretty descriptive otherwise, we call that mode of operation "standby"
> everywhere, and always have.
>
> I'm not sure I dare to say this out loud after Simon's previous
> outburst, but removing or renaming pg_standby would help with that...

Not really. People aren't going to forget about it just because we
remove it from CVS HEAD.

>> One possibility that occurs to me is that we could call it something
>> like integrated_standby; but I'm not attached to that.
>
> Anything with the word 'standby' in it suffers from the same problem,
> maybe not as badly but still.

Well, let's come up with something else then.

...Robert


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 15:37:51
Message-ID: 3f0b79eb1002120737m417d16b9uca601b7fabdfa23a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Sat, Feb 13, 2010 at 12:28 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Well, let's come up with something else then.

continuous_recovery ?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Richard Huxton <dev(at)archonet(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 19:33:12
Message-ID: 4B75ACF8.2080101@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 12/02/10 15:37, Fujii Masao wrote:
> On Sat, Feb 13, 2010 at 12:28 AM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
>> Well, let's come up with something else then.
>
> continuous_recovery ?

One problem with the otherwise entirely wonderful HS/SR pairing is the
whole business of the config parameters. They feel too bottom-up.
Individually, each one makes sense but if you look at them on a page
they don't say master/slave replication to me.

What about something like:

# Primary
archive_mode = producer
archive_producer_command = 'cp "%p" .../"%f"'
max_consumers = 5

# Standby
archive_mode = producer, consumer
archive_producer_command = 'cp "%p" .../"%f"'
archive_consumer_command = 'cp "%p" .../"%f"'
consume_from = 'host=... user=...'

Three other points that struck me:
1. Why have a separate recovery.conf file rather than just put the
commands inline? We can use the include directive to have them in a
separate file if required.
2. Why have a finish.replication file, rather than "SELECT
pg_finish_replication()"?

--
Richard Huxton
Archonet Ltd


From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-12 19:53:25
Message-ID: m27hqiw7re.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> Robert Haas wrote:
>> Furthermore, if you're wanting to use pg_standby, you might be
>> forgiven for thinking that you should set standby_mode = on; but in
>> fact that's exactly the wrong thing to do.
>
> Yeah, I think that's the main weakness of the name "standby_mode". It's
> pretty descriptive otherwise, we call that mode of operation "standby"
> everywhere, and always have.
>
> I'm not sure I dare to say this out loud after Simon's previous
> outburst, but removing or renaming pg_standby would help with that...

Well seen from here it's quite logical: when replaying WALs, you are
either in recovery mode and the server gets back as soon as possible, or
you are setting up a standby server, which will keep recovering until
told to stop doing so.

Now you have 2 main options for keeping your server in standby mode,
either the integrated one (standby_mode = on) or another one. If you
choose to have your standby state managed by an external tool, of course
the first thing to do is tell the server not to maintain itself the
state, so you switch standby_mode to off.

Then you can either use the included contrib pg_standby to achieve the
result, or some other solution, such as Skytools and walmgr.py or CMD
pitrtools.

The fact that the parameter and the external script share the name is a
hint that they're competing for solving the same problem (in different
ways).

Regards,
--
dim


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-15 07:23:13
Message-ID: 3f0b79eb1002142323q48092e57i45467169757dc20c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Sat, Feb 13, 2010 at 4:33 AM, Richard Huxton <dev(at)archonet(dot)com> wrote:
> 2. Why have a finish.replication file, rather than "SELECT
> pg_finish_replication()"?

I thought that the trigger file method was more easy-to-use for the
existing users since it had been used in pg_standby for a long time
so far. So I used it. But I agree that activating the standby via
SQL would be useful for some cases.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Reduce the chatter to the log when starting a standby server.
Date: 2010-02-15 07:33:22
Message-ID: 4B78F8C2.602@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Fujii Masao wrote:
> On Sat, Feb 13, 2010 at 4:33 AM, Richard Huxton <dev(at)archonet(dot)com> wrote:
>> 2. Why have a finish.replication file, rather than "SELECT
>> pg_finish_replication()"?
>
> I thought that the trigger file method was more easy-to-use for the
> existing users since it had been used in pg_standby for a long time
> so far. So I used it.

Also, you might not want to open the standby for connections (ie.
recovery_connections='off'). And even if you wanted, it might not open
because of some of the corner-case limitations in Hot Standby, so you
wouldn't be able to failover.

> But I agree that activating the standby via
> SQL would be useful for some cases.

Yeah.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com