Running queries on a hot standby server is a bit more complicated - it may fail, because during the request some necessary lines can be updated or deleted on the primary one. As the primary one does not know that the request is being run a second time, he thinks that he can clear (vacuum) the old versions of his lines. Then the secondary must repeat this cleanup and is forced to cancel all requests that can use these lines.
Longer requests will be canceled more often.
You can get around this by starting a recurring read transaction on a primary basis that executes a dummy request and then sits idle while the real request runs on the secondary. His presence will prevent the vacuum cleaners of older versions of strings on the primary.
For more information on this topic and other workarounds, see the "Hot Standby - Processing Request Conflicts" section of the documentation.
Tometzky Jan 29 '13 at 23:51 2013-01-29 23:51
source share