Postgresql hard
A cluster is configured with `synchronous_commit = remote_apply`. What guarantee is provided to the client application once a COMMIT returns successfully?
- A The transaction in the WAL buffer has been verified using a cryptographic checksum on the primary.
- B The data is written to the primary's WAL and is visible to local read queries on the leader node.
- C The changes have been replayed and applied to the replica, making them visible to standby readers.
- D The replica has acknowledged receipt of the TCP packet containing the transaction log segment.
Answer: C. The changes have been replayed and applied to the replica, making them visible to standby readers.
Standard synchronous replication only waits for the replica to *receive* and *write* the WAL. `remote_apply` is stronger—it waits for the replica to *process* the WAL, ensuring strict 'Read-Your-Writes' consistency across the cluster.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a PostgreSQL environment, what functional characteristic distinguishes a `MATERIALIZED VIEW` from a standard `VIEW`?
- Which standard PostgreSQL utility is designed to extract a single database into a script or archive file for backup purposes?
- Why would PostgreSQL reject a `DELETE` operation on a record despite the user having full administrative privileges?
- The 'Heap Only Tuples' (HOT) optimization improves UPDATE performance. Which specific set of conditions must be met for a HOT update to occur?
- Which native command-line utility is used to execute SQL queries and manage PostgreSQL databases from a terminal session?
- What is the specific purpose of 'Freezing' a row (modifying its `xmin` status) during a major VACUUM operation?