Tuning Hot Standby
Imagine the case where the standby is replaying the block changes resulting from a DROP TABLE
on the master. If you're using Hot Standby to run queries on the standby, it's possible there's one using that table already running when these changes arrive. The server has two choices at this point—it can either apply the changes, or it can continue to let the query run; it can't do both.
While getting rid of a table is a rare situation, this is just the easiest to understand example from a class of problems where Hot Standby cannot replay some blocks without cancelling queries that expect them to be there. One of the most common sources for such changes happens when you vacuum the master database.
What the server should do when this happens really depends on the priorities of your standby server. There are three fundamental things you might want to do with your standby server:
- Prioritize keeping the standby current. Your goal is to have a seamless...