Databases · Senior · Question 67 of 75
Long analytics queries on a streaming replica get cancelled with 'conflict with recovery'. Why?
- 1Replicas don't allow
SELECTqueries - 2The replica ran out of connections
- ✓Correct answer: Replaying WAL (e.g. VACUUM cleanup from the primary) needs to remove row versions the query still reads, so the replica cancels the query after a delay
Explanation
max_standby_streaming_delay or hot_standby_feedback reduce cancellations, at the cost of replication delay or bloat on the primary. A separate analytics replica or warehouse is cleaner.