<div dir="ltr">For years, I have run slony (currently version 2.1.3) with one origin and one replica. Every night at midnight, I run vacuum analyze on the whole DB.  I still run autovacuum with its default settings. The midnight vacuum takes approximately 4.5 hours to run.<div>
<br></div><div style>All was well until I upgraded the DB from 8.4 to 9.2.x. (at the same time I upgraded slony from 2.0).  Now, every night, the replication basically stalls mid-way through the vacuum.</div><div style><br>
</div><div style>Here is what I observe:</div><div style><br></div><div style>midnight - vacuum starts on origin and replica</div><div style>3:12am - replication delay reaches &gt; 7 minutes</div><div style>3:15am - replication delay = 624 seconds</div>
<div style>3:30am - replication delay = 1524 seconds</div><div style>3:45am - replication delay = 2423 seconds</div><div style>... basically replication has stopped</div><div style>4:30am - replication delay = 5124 seconds</div>
<div style>4:40am - vacuum ends on replica<br></div><div style>4:41am - vacuum ends on origind</div><div style>4:45am - replication delay = 1018 seconds</div><div style>4:49am - replication lag drops to under 5 minutes (I consider this recovered)</div>
<div style><br></div><div style><br></div><div style>At no other time during the day, even when the DB is very very busy doing lots of writes and a fair number of reads, does the replication lag more than 5 or 10 seconds.</div>
<div style><br></div><div style>I have another DB on another pair of machines that is reasonably large as well, that does nightly vacuum similarly. It is running slony 2.1 also, but the DB version it replicates from is 8.3 to a 9.1. I never see any massive delay in replication on there.</div>
<div style><br></div><div style>So my instinct is that there is some change in 9.2 that slony is tripping over that is causing it to lock something for way too long. I would appreciate any guidance on figuring out what that is, so I can avoid having long delays in my replication while vacuum is running.</div>
</div>