Replication & HA🔒 Pro lessonSource-grounded1 real lab transcript

Synchronous Replication and Quorum Commit

By default a primary says 'committed' as soon as its own log is safe, without waiting for any replica.

If it then dies, the last few transactions the replica never received are simply gone. Synchronous replication makes the primary wait for a replica to confirm first, closing that data-loss gap in exchange for slightly slower commits.

ProLesson body

Pro members see the rest of this lesson

  • A 4-step state diagram: Flush → Wait → Confirm → Starve
  • The full mechanism: what PostgreSQL does internally, in source terms
  • 1 SQL query you can run, each labelled by how it was verified
  • 1 transcript captured on PostgreSQL 17.10
  • The closing insight, the mistake it prevents, and what it changes in your work

Card required. Cancel before day 7 and you are not charged.

Compare plans

Want to read a full lesson first? Five are free end to end, one from each major track. Start with MVCC internals.
Check it against the source2 citations in postgres/postgres · file, symbol and line verified on REL_17_STABLE
src/backend/replication/syncrep.cVerified · REL_17_STABLE

Primary symbol: SyncRepWaitForLSN · line 148

src/backend/replication/walsender.cVerified · REL_17_STABLE

Primary symbol: WalSndLoop · line 2831

Anchored to postgres/postgres on REL_17_STABLE and cross-checked against the manual for PostgreSQL 15–18. Every query here was run and its output captured on a throwaway PostgreSQL 17.10 lab; corrections are noted inline. §27.2.8 Synchronous Replication in the official docs →

ShareLinkedInX

Finished a free lesson?

Pro opens the rest of the engine course

You felt one mechanism. Pro is the full bodies, interview depth, and the tracks that build on this session.

FollowSubstackLinkedInnew errors · lab notes · hiring loops