ジョー
Writing
Projects
About
← Back to the article
3 questions
Super fun replication quiz
01
You use synchronous replication. Does that mean replica lag is impossible?
A
Yes - a successful commit means every replica is fully caught up
B
No - a replica can acknowledge WAL before replaying it
C
No - but only when the primary has crashed
02
The primary executes an INSERT containing NOW(). The replica receives the change two seconds later. How does physical replication preserve the original timestamp?
A
The replica runs the SQL with its clock adjusted
B
The replica replays WAL containing the value computed on the primary
C
Postgres waits until both servers can execute the SQL simultaneously
03
The primary stops responding to heartbeats. You promote the most up-to-date replica. Is it safe to let it accept writes immediately?
A
Yes, the replica has the most recent data.
B
Yes, missing heartbeats prove the old primary has stopped.
C
Not necessarily. The old primary could still accept writes, causing split-brain.