bdr: Improve sequencer locking and pgstat reporting.
authorAndres Freund <andres@anarazel.de>
Mon, 25 May 2015 01:43:15 +0000 (03:43 +0200)
committerAndres Freund <andres@anarazel.de>
Mon, 25 May 2015 01:54:47 +0000 (03:54 +0200)
commit303a03bd363dc038396342fbdd6392e11c5ee5d1
treef40a0a391a7665b7b4096add71578d4b96092c02
parente52ca15c27193c14121189d65381ca9135d42035
bdr: Improve sequencer locking and pgstat reporting.

Up to now the sequencer locked its relations exclusively to prevent an
interlock with apply. That was problematic, because it would often
prevent auto vacuum/analyze from running, or interrupt it.

Instead of locking the underlying relations lock the bdr seqam object
and add code to apply to also acquire that lock. That allow autovacuum
to run undisturbed.

Testing brought an additional problem to light, namely that pgstat
records weren't sent in the sequencer until shutdown, which means that
in many situations autovacuum won't be trigger in time. This is a more
widespread problem than just the sequencer, but here only the sequencer
is fixed.
bdr.c
bdr.h
bdr_apply.c
bdr_seq.c