AI Infrastructure
A PostgreSQL Replica Commit Can Be Durable Before It Is Query-Visible
For the selected PostgreSQL 18 synchronous physical standby, synchronous_commit=on waits for durable WAL, while remote_apply additionally waits for replay that makes the transaction visible to new snapshots. Both answer the stipulated standby operating-system-crash durability requirement; remote_apply also answers the combined durability and new-read requirement. remote_write alone does not establish that durability boundary. The comparison depends on the actual transaction, selected standby and supported persistence behavior. A less demanding mode can happen to return after replay without promising to wait for it.
01
Follow the transaction through WAL storage and replay
An AI platform can keep a small but consequential decision in PostgreSQL: which label set is active for a consumer. If the writer reports a successful commit and the consumer reads a standby, two requirements may matter. Must that standby retain the transaction across an operating-system crash? Must its next new read already include the change?
Write-ahead logging, or WAL, records changes before the corresponding data-file changes reach permanent storage. PostgreSQL can recover changes from that log; durable commitment does not require flushing every changed table or index page at each commit. Physical replication carries WAL to a standby, where receiving and storing it are distinct from replaying it into the database state.
Durable WAL through the commit record supplies the persistence boundary. Replaying that commit supplies the visibility boundary for new standby snapshots. Recoverable information can therefore be present while the currently queryable state remains earlier. This is why a proposal saying the transaction reached the replica needs its acknowledged stage identified.
References: [PG18LOG] [PG18SYNC] [PG18HOT]
02
SYNC-68 fixes one transaction and one selected standby
SYNC-68 is a fictional comparison, with no database execution or observed result. Fix one supported PostgreSQL 18 primary, P, and one directly connected physical hot standby, S. S is the sole actual selected synchronous acknowledgement participant for the transaction. The selection is nonempty. Local and standby persistence mechanisms and underlying storage honor the applicable documented guarantees; corruption and whole-site loss are outside the case.
One ordinary row identifies active label-set L0. A single transaction changes it to L1, with no later row changes. Compare a successful top-level write-transaction commit in three separate supported offers: R uses remote_write, D uses on, and V uses remote_apply. The modes apply to this actual transaction.
In each comparison, the reader is a new successful ordinary Read Committed statement on S, starting after the client receives commit success. It has no earlier retained snapshot, external function or row filter. The executions share the supplied ordered stage history below. The labels identify states without assigning durations, byte counts or guaranteed reply instants.
03
P, W, F and A identify four different states
At stage P, the transaction's WAL is durable on the primary. S has not yet written the transaction's WAL to its operating system, made it durable or replayed its commit. A new snapshot on S still sees L0.
At W, S has written the received WAL, including the commit record, to its operating system. The supplied state expressly leaves standby WAL durability and commit replay unfinished. A new S snapshot still sees L0.
At F, S has made the transaction's WAL durable. Its commit has still not been replayed. A new S snapshot continues to see L0. This is the central distinction: the information needed to recover the committed change is durable, while the change is not yet visible to that reader.
At A, S has replayed the commit. The earlier primary durability, standby OS write and standby WAL durability remain established. A new S snapshot now sees L1. No later change can replace it in this example.
These states are supplied in P → W → F → A order. They isolate what changes between storage and visibility; they are not a benchmark or a prescribed execution schedule.
04
Map each offer to the stage success must wait for
PostgreSQL 18 defines synchronous_commit by the WAL work required before reporting success. With the actual selected S in SYNC-68, R's remote_write promise reaches the remote operating-system write boundary. It protects against a PostgreSQL-instance crash on the standby, but does not establish survival of a standby operating-system crash. Its earliest permitted gate in the case is W.
D's on promise requires S's durable WAL flush, making F its earliest permitted gate. V's remote_apply promise requires durable storage and commit replay on S, making A its earliest permitted gate. All three also require local WAL flush on P.
An earliest gate is the first supplied state at which the required work is complete. Client receipt of success can occur later. R need not actually reply during W, and D need not actually reply during F. Additional standby work may finish before either response reaches the client. Their minimum promises remain different even when a particular execution has progressed further.
References: [PG18WAL]
06
Choose against the two requirements
For a requirement limited to retaining the acknowledged transaction on S across a standby operating-system crash, D and V supply the required durable-WAL boundary under SYNC-68's assumptions. R alone does not. This conclusion concerns the protection promised at success; it reports no crash or lost data in an R execution.
If that is the buyer's complete requirement, D already answers it. Requiring V would add a replay condition the narrower request did not ask for. The example provides no price or transaction-latency evidence with which to rank that additional condition economically.
For a requirement combining that durability boundary with L1 being visible to the stipulated new S snapshot after success, V supplies both. D leaves the second condition unguaranteed, as the F-to-A counterexample demonstrates. R leaves both conditions unestablished by its minimum promise.
The useful response to an offered database service identifies the actual transaction's mode, the selected S and the required consumer view. A general synchronous-replication label cannot settle which of these two purchases is being offered. If the requirement adds the new view, obtain an explicit replay-before-success promise for that same standby.
07
Keep the selected server and the reader's snapshot attached
The remote-named value alone is insufficient. PostgreSQL 18 states that when synchronous_standby_names is empty, remote_write and remote_apply provide the same local synchronization level as on. There is then no selected remote acknowledgement behind those names. SYNC-68's remote conclusions require its expressly nonempty, actual S selection.
Likewise, the new-view conclusion belongs to S. A read sent to another, asynchronous replica cannot inherit S's replay acknowledgement. The receiving server must be the one the promise covers.
An earlier retained snapshot is another different condition. Replay makes the transaction eligible for new standby snapshots; it does not advance every existing view. The related PostgreSQL statement-snapshot guide explains that isolation decision. Here the case deliberately fixes a new ordinary Read Committed statement after success, so the comparison concerns replication progress rather than retaining an older transaction view.
08
Separate an acknowledged state from availability and recovery
Required standby feedback can remain unavailable, leaving a commit waiting without a success deadline. Conversely, a missing success response does not prove abort: PostgreSQL documents that transactions awaiting acknowledgement can be fully committed when the primary recovers. The successful returns compared above must not become an assumption that every attempted commit returns successfully.
Read availability also has its own conditions. Hot-standby recovery conflicts can delay replay or cancel queries. SYNC-68 stipulates successful reads to compare their visible values; it supplies no universal query-completion promise.
Durable or replayed WAL establishes no election, promotion, traffic-routing or complete application return. The active-label-set row also supplies no evidence about external artifacts, keys or other application dependencies. Use the related recovery-objectives guide for valid recovered state and usable-service timing, and the serving-release guide for the complete application combination. Acknowledging this transaction does not establish either wider result.
References: [PG18SYNC] [PG18HOT]
09
Scope a separate receiving or rack-assembly requirement
The database comparison creates no equipment-purchase requirement. If the wider project independently needs equipment receiving, preparation or rack assembly, Leviathan's Rack Assembly & Preparation service and contextual project inquiry below address that physical package.
Share a nonconfidential equipment summary, approved configuration, appointed suppliers, supplied integration state, proposed location and required physical handoff. Scope, resources and availability are agreed for the engagement. Replication, database administration, software hosting and commissioning, application validation and failover remain with the appointed database, software and application owners. This educational comparison provides no software or field-work approval.
References: [L1]
10Sources
Primary sources
- [PG18WAL]PostgreSQL 18: 19.5.1. WAL settings and Table 19.1Checked 2026-10-22. Defines success boundaries, local flush, empty synchronous-standby selection and transaction-specific applicability. Durability assumes the supported persistence and storage behavior stated in the example.
- [PG18SYNC]PostgreSQL 18: 26.2.8. Synchronous ReplicationChecked 2026-10-22. Explains directly connected selected participants, WAL feedback and commits awaiting acknowledgement. Supports interpreting returned promises without supplying a success deadline or full failover result.
- [PG18HOT]PostgreSQL 18: 26.4. Hot StandbyChecked 2026-10-22. Sections 26.4.1–26.4.2 connect commit replay to new snapshots and explain recovery conflicts. Applies to the identified standby and stipulated successful reads.
- [PG18LOG]PostgreSQL 18: 28.3. Write-Ahead LoggingChecked 2026-10-22. Explains recovery from durable WAL without flushing every changed data page at each commit. This log mechanism is distinct from current query visibility.
- [L1]Leviathan Systems: Rack Assembly & PreparationChecked 2026-10-22. Defines agreed receiving, equipment preparation, rack assembly and physical handoff. Relevant when the wider project has an independently identified physical equipment requirement.
11Related
Related Leviathan resources
PostgreSQL statement snapshots and retained reader views
RDMA completion and an application's durability promise
File and directory synchronization: identify the persisted objects
Recovery objectives and observed usable-service return
Model registry promotion and the complete serving release
Rack Assembly & Preparation for a separate equipment requirement
Discuss a separate receiving, preparation or rack-assembly project
Contact
Does the wider project need equipment preparation?
Share a nonconfidential equipment and configuration summary, supplied integration state, proposed location and physical handoff needs to discuss receiving, preparation or rack assembly.