recovery_min_apply-delay and remote_apply

Started by Bernd Helmleover 9 years ago3 messageshackers
Jump to latest
#1Bernd Helmle
mailings@oopsware.de

Current PostgreSQL Documentation on recovery.conf has this about
recovery_min_apply_delay[1]<https://www.postgresql.org/docs/devel/static/standby-settings.html&gt;:

---<---

This parameter is intended for use with streaming replication deployments;
however, if the parameter is specified it will be honored in all cases.
Synchronous replication is not affected by this setting because there is
not yet any setting to request synchronous apply of transaction commits.

--->---

If i understand correctly, this is not true anymore with 9.6, where
remote_apply will have exactly the behavior the paragraph above wants to
contradict: any transaction executed with synchronous_commit=remote_apply
will wait at least recovery_min_apply_delay to finish. Given that
synchronous_commit can be controlled by any user, this might be dangerous
if someone doesn't take care enough.

I think we need a doc patch for that at least, see attached patch against
master, but 9.6 should have a corrected one, too.

[1]: <https://www.postgresql.org/docs/devel/static/standby-settings.html&gt;

--
Thanks

Bernd

Attachments:

recovery-config-doc.patchapplication/octet-stream; name=recovery-config-doc.patchDownload+9-9
#2Thomas Munro
thomas.munro@gmail.com
In reply to: Bernd Helmle (#1)
Re: recovery_min_apply-delay and remote_apply

On Sat, Sep 17, 2016 at 8:45 AM, Bernd Helmle <mailings@oopsware.de> wrote:

Current PostgreSQL Documentation on recovery.conf has this about
recovery_min_apply_delay[1]:

---<---

This parameter is intended for use with streaming replication deployments;
however, if the parameter is specified it will be honored in all cases.
Synchronous replication is not affected by this setting because there is
not yet any setting to request synchronous apply of transaction commits.

--->---

If i understand correctly, this is not true anymore with 9.6, where
remote_apply will have exactly the behavior the paragraph above wants to
contradict: any transaction executed with synchronous_commit=remote_apply
will wait at least recovery_min_apply_delay to finish. Given that
synchronous_commit can be controlled by any user, this might be dangerous
if someone doesn't take care enough.

Yes, I missed that sentence. Thanks.

I think we need a doc patch for that at least, see attached patch against
master, but 9.6 should have a corrected one, too.

+1

--
Thomas Munro
http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Robert Haas
robertmhaas@gmail.com
In reply to: Thomas Munro (#2)
Re: recovery_min_apply-delay and remote_apply

On Fri, Sep 16, 2016 at 5:55 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:

On Sat, Sep 17, 2016 at 8:45 AM, Bernd Helmle <mailings@oopsware.de> wrote:

Current PostgreSQL Documentation on recovery.conf has this about
recovery_min_apply_delay[1]:

---<---

This parameter is intended for use with streaming replication deployments;
however, if the parameter is specified it will be honored in all cases.
Synchronous replication is not affected by this setting because there is
not yet any setting to request synchronous apply of transaction commits.

--->---

If i understand correctly, this is not true anymore with 9.6, where
remote_apply will have exactly the behavior the paragraph above wants to
contradict: any transaction executed with synchronous_commit=remote_apply
will wait at least recovery_min_apply_delay to finish. Given that
synchronous_commit can be controlled by any user, this might be dangerous
if someone doesn't take care enough.

Yes, I missed that sentence. Thanks.

I think we need a doc patch for that at least, see attached patch against
master, but 9.6 should have a corrected one, too.

+1

Committed with a bit of adjustment, and back-patched to 9.6.

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers