Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Allow setting synchronous_commit for Postgres #33897

Merged
merged 1 commit into from Aug 17, 2020

Conversation

mfn
Copy link
Contributor

@mfn mfn commented Aug 15, 2020

See https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT

Specifies whether transaction commit will wait for WAL records to be written to disk before the command returns a “success” indication to the client. Valid values are on, remote_apply, remote_write, local, and off

So, turning synchronous_commit off can be a useful alternative when performance is more important than exact certainty about the durability of a transaction.


My use-case is exact the last paragraph, so I can turn it off.

PR for showing the setting in the config => laravel/laravel#5375

See https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT
> Specifies whether transaction commit will wait for WAL records to be written to disk before the command returns a “success” indication to the client. Valid values are on, remote_apply, remote_write, local, and off
> …
> So, turning synchronous_commit off can be a useful alternative when performance is more important than exact certainty about the durability of a transaction.
@mfn mfn force-pushed the mfn-pgsql-sync-commit branch from 742f4a8 to 53aea3d Compare Aug 15, 2020
mfn added a commit to mfn/laravel that referenced this issue Aug 15, 2020
It's deliberately not enabled but provided commented out so developers can easily
discover that the setting is available.

The default `on` is _probably_ safe (Postgres default), but a server might
have a different default value and blindly setting it to `on` may cause problems.

Connected to laravel/framework#33897
@taylorotwell taylorotwell merged commit b1f9fc5 into laravel:7.x Aug 17, 2020
10 checks passed
@mfn mfn deleted the mfn-pgsql-sync-commit branch Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants