Asynchronous commit
Asynchronous commit is an acknowledgment mode that can report a transaction as successful before its recovery log has reached durable storage.
In PostgreSQL 18, synchronous_commit=off can lose recently acknowledged transactions after a crash while retaining consistent recovery, assuming the remaining safety mechanisms and storage behave correctly. This is not fsync=off. [1] The setting in effect at commit controls ordinary transaction acknowledgment; PostgreSQL forces utility commands such as DROP TABLE and two-phase-commit commands such as PREPARE TRANSACTION to commit synchronously. [1] Local persistence and standby progress are separate: asynchronous replication does not by itself imply asynchronous local commit. [2] Group commit with commit_delay remains a synchronous optimization; commit_delay is ignored for asynchronous commits. [1]
Relations
- related
- write-ahead-log, group-commit
Advantages
- Can reduce response latency by removing the immediate WAL synchronization wait. [1]
Limitations
- A successful response is not proof that the transaction will survive a crash. [1]
- An external action triggered by success cannot be undone by database recovery. [1]