Self-test
Check your understanding
Self-test9 questions
How does Patroni use the leader key in etcd to make sure only one node is primary?
A clean docker stop failed over in 3.2 s, kill -9 in 23 s. Where does the difference come from?
Clients saw 15 s of errors after a 1.4 s leader change. What caused it, and what fixed it?
Killing the primary with replicas 50 ms behind lost between 0 and 56 acknowledged writes under async (seven runs) and 0 under synchronous_mode. Why did the async loss vary so much, and what did synchronous_mode cost?
What does an "in doubt" write mean, and why can no database setting remove them?
Why did 499 of 500 reads on an async replica miss a row written a moment before, but only 0 to 14 of 500 when each read opened a new connection?
With replicas 5 ms away, sync commits took 18.7 ms instead of about 10. Where did the rest come from?
Name two things that break under PgBouncer's transaction pooling, and the safe alternative for each.
- Design question
Your RPO is zero for payments but the rest of the app can lose a second of data. Design the replication settings, including what happens when a sync replica fails.