Christopher Browne cbbrowne at ca.afilias.info
Thu Nov 18 08:32:16 PST 2010
Vick Khera <vivek at khera.org> writes:
> On Wed, Nov 17, 2010 at 5:06 PM, Christopher Browne
> <cbbrowne at ca.afilias.info> wrote:
>> For instance if it takes 20 minutes for SUBSCRIBE SET to complete, it's
>> pretty likely that you want to wait for that to be complete before
>> proceeding with other configuration that depends on it.
>
> None of my scripts ever have a WAIT in them.  I break up my scripts to
> be pretty atomic, and I rarely do anything after the subscribe except
> sit and wait hours for the copy to happen.
>
> The one thing I'd like to have is a warning when issuing shape
> changing commands such as move set if the backlog of events is very
> high (say, more than 5 or 10).  On occasion, I've forgotten to check
> and issued the move when there was a 10 minute backlog.  I ended up
> waiting that out, but it was tense. ;)

Interesting.

That suggests to me there being some value to having some sort of "fail
if not sufficiently up to date" command.

Perhaps something like:

try {
   ABORT (origin=1, confirmed=2, events behind=10);
} on error {
   echo 'Node 2 behind node 1 by more than 10 events - aborting!';
   exit -1;
} on success {
   echo 'Node 2 sufficiently up to date';
}

Or

try {
   ABORT (origin=1, confirmed=2, events behind by='30 seconds');
} on error {
   echo 'Node 2 behind node 1 by more than 30 seconds - aborting!';
   exit -1;
} on success {
   echo 'Node 2 sufficiently up to date';
}

That seems likely to be an easy addition, and possibly quite handy.

That's pretty specific to "replication being behind" - a different
flavour of useful might be to have have a series of "fail if condition
not met" evaluators to check things like:

  - Is a node there?
  - Is a replication set there?
  - Is a particular subscription configured?
  - Run a bit of SQL, and fail if it errors out.
  - Has a node successfully processed events within [time interval]?
  - Is a node presently processing a particular event?

That last item is suggestive of another branch in the whole "stream of
consciousness"...

It sure would be nice if each slon would note somewhere, in a way that
can be queried by others, what it's working on.  That would be useful
for the common scenario we have where beginners (and sometimes even
experienced folk!) say "I don't quite know if replication is working.
How can I find that out???"

BTW, the larger goal here isn't merely to draw out how we might handle
an "implicit WAIT FOR EVENT" - we (where "we" is initially consisting of
Jan, Steve, and myself as 'core') are trying to figure out what sorts of
enhancements would be worth introducing.  

And your comments have introduced at least two additional ideas to my
list, which I appreciate considerably!
-- 
output = reverse("ofni.sailifa.ac" "@" "enworbbc")
Christopher Browne
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"


More information about the Slony1-general mailing list