Re: max_worker_processes on the standby

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-docs <pgsql-docs(at)postgresql(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Petr Jelínek <petr(at)2ndquadrant(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: max_worker_processes on the standby
Date: 2015-08-08 14:02:38
Message-ID: CA+TgmoZjXJZZL4GYvamFZZYnO6H9d8oST1b2y=rDaYHdWS1c4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Tue, Aug 4, 2015 at 6:13 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>> I think it's totally reasonable for the standby to follow the master's
>> behavior rather than the config file. That should be documented, but
>> otherwise, no problem. If it were technologically possible for the
>> standby to follow the config file rather than the master in all cases,
>> that would be fine, too. But the current behavior is somewhere in the
>> middle, and that doesn't seem like a good plan.
>
> So I discussed this with Petr. He points out that if we make the
> standby follows the master, then the problem would be the misbehavior
> that results once the standby is promoted: at that point the standby
> would no longer "follow the master" and would start with the feature
> turned off, which could be disastrous (depending on what are you using
> the commit timestamps for).

That seems like an imaginary problem. If it's critical to have commit
timestamps, don't turn them off on the standby.

> To solve that problem, you could suggest that if we see the setting
> turned on in pg_control then we should follow that instead of the config
> file; but then the problem is that there's no way to turn the feature
> off. And things are real crazy by then.

There's no existing precedent for a feature that lets the standby be
different from the master *in any way*. So I don't see why we should
start here. I think the reasonable definition is that the GUC
controls whether the master tries to update the SLRU (and generate
appropriate WAL records, presumably). The standby should not get a
choice about whether to replay those WAL records.

Note that if you do allow the standby to decide not to replay the WAL
records for this feature, then the data on the standby could be
partially there but not completely there after promotion, because the
DBA might have flipped the switch on and off at different times.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2015-08-09 00:41:06 Re: Minor typo in rules.sgml
Previous Message Ross Reedstrom 2015-08-07 17:15:57 Re: Earliest Postgres credit patch

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-08-08 14:04:04 Re: Patch for ginCombineData
Previous Message Robert Haas 2015-08-08 13:57:58 Re: statement_timeout affects query results fetching?