Immediate standby promotion - Mailing list pgsql-hackers

From Fujii Masao
Subject Immediate standby promotion
Date
Msg-id CAHGQGwHtvyDqKZaYWYA9zyyLEcAKiF5P0KpcpuNE_tsrGTFtQw@mail.gmail.com
Whole thread Raw
Responses Re: Immediate standby promotion
Re: Immediate standby promotion
List pgsql-hackers
Hi,

I'd like to propose to add new option "--immediate" to pg_ctl promote.
When this option is set, recovery ignores any WAL data which have not
been replayed yet and exits immediately. Patch attached.

This promotion is faster than normal one but can cause data loss. So
it's useful if we want to switch the server to normal operation as
soon as possible at the expense of durability. Also imagine the case
where, while recovery is being delayed (by a time-delayed standby
which was introduced in 9.4) or paused (by pg_xlog_replay_pause),
you find that subsequent WAL data can cause a disaster to happen
(for example, WAL data indicating an unexpected deletion of
important database). In this case, this immediate promotion can be
used to ignore such problematic WAL data.

With the patch, "--immediate" option controls whether immediate
promotion is performed or not. OTOH, we can extend "-m" option
that pg_ctl stop has already used so that it controls also the mode of
promotion. But when we discussed this feature before, someone
disagreed to do that because shutdown mode and promotion mode
are different concepts. For example, if "smart" is specified as mode,
how should the promotion work? I agree with him, and just added
new separate option. Thought?

Regards,

--
Fujii Masao

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: WAL format and API changes (9.5)
Next
From: Michael Paquier
Date:
Subject: Re: WAL format and API changes (9.5)