From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Re: [COMMITTERS] pgsql: Make CheckRequiredParameterValues() depend upon correct |
Date: | 2010-04-27 11:56:51 |
Message-ID: | z2z603c8f071004270456l5daaf3eewa673880c102f09e5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers pgsql-hackers |
On Tue, Apr 27, 2010 at 7:24 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Tue, Apr 27, 2010 at 7:50 PM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>> It's OK in pg_start_backup(), but seems NG in pg_stop_backup() since
>>> it waits until some WAL files have been archived by the archiver. No?
>>
>> Good point, that logic would need to be changed too. Should it simply
>> return immediately if archive_mode=off?
>
> What if we wrongly set archive_mode to on and wal_mode to minimal?
> I think that checking XLogArchivingActive() in pg_stop_backup() is
> adequate.
That case should be rejected at primary startup.
>>>>> + /*
>>>>> + * For Hot Standby, the WAL must be generated with 'hot_standby' mode,
>>>>> + * and we must have at least as many backend slots as the primary.
>>>>> + */
>>>>> + if (InArchiveRecovery && XLogRequestRecoveryConnections)
>>>>> + {
>>>>> + if (ControlFile->wal_mode < WAL_MODE_HOT_STANDBY)
>>>>> + ereport(ERROR,
>>>>> + (errmsg("recovery connections cannot start because
>>>>> wal_mode was not set to 'hot_standby' on the WAL source server")));
>>>>>
>>>>> This seems to always prevent the server from doing an archive recovery
>>>>> since wal_mode is expected to be WAL_MODE_ARCHIVE in that case.
>>>> No, it doesn't prevent archive recovery. It only prevents hot standby if
>>>> wal_mode was not 'hot_standby' in the master. I think you missed the "&&
>>>> XLogRequestRecoveryConnections" condition above.
>>>
>>> Even if we do only archive recovery, XLogRequestRecoveryConnections
>>> might be TRUE. Or we need to ensure that the recovery_connection is
>>> FALSE in the postgresql.conf before starting archive recovery?
>>
>> Umm, yes, if you have recovery_connnections=on, it means you want hot
>> standby. And for that you need wal_mode='hot_standby'.
>
> Since the default value of recovery_connections is TRUE, I think that
> the trouble which I encountered would often happen. We should disable
> recovery_connections by default? Furthermore should move it from
> postgresql.conf to recovery.conf?
>
> On the other hand, I feel that recovery_connections=on in an archive
> recovery is valid configuration *until* any read only connections are
> requested. How about moving the above check to postmaster or backend?
Or just not starting recovery connections, but still doing archive
recovery? I think in this case a WARNING might be adequate.
...Robert
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2010-04-27 14:32:40 | pgsql: Reformat code examples in plpgsql docs for better readability in |
Previous Message | Fujii Masao | 2010-04-27 11:24:30 | Re: Re: [COMMITTERS] pgsql: Make CheckRequiredParameterValues() depend upon correct |
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2010-04-27 12:58:49 | Re: Wierd quirk of HS/SR, probably not fixable |
Previous Message | Andrew Dunstan | 2010-04-27 11:40:37 | Re: pg_migrator |