[Bucardo-general] Occasional deadlocks
Greg Sabino Mullane
greg at endpoint.com
Tue Dec 16 21:02:48 UTC 2014
On Mon, Dec 15, 2014 at 11:55:43AM -0800, Paul Theodoropoulos wrote:
> occasional/rare I mean perhaps a few days will pass, we'll have a
> deadlock and the master process will abort/crash and restart.
> Obviously we'd prefer not to have the minute or so of downtime as
> monit discovers the outage and restarts it.
> Is this a case where just increasing the kid_deadlock_sleep would
> help? Is there an upper bounds on the sleep that would tend to make
> things wonky? I currently have it set at one second.
No, that setting will not change anything - it just indicates how
long Bucardo should wait before trying the kid again when a deadlock
is detected. But it won't help prevent them in the first place. The
best you can do, other than making your application smart enough to
handle deadlocks on its own, is to keep your updates fast, commit often,
and make your syncs as long as possible. In other words, make sure
everybody gets in and out of the database as fast as possible to prevent
If it becomes a major problem, there are heavier solutions (e.g.
table- or advisory- level locks), but for the most part, it's just
a natural consequence of living in a MVCC world. :)
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 163 bytes
Desc: Digital signature
More information about the Bucardo-general