"Troy Wolf" <[EMAIL PROTECTED]> writes: > I'm looking for suggestions as to the best way to verify that my > single > slave is in sync with my master. We've had a couple of situations (self > induced) where we've created problems for slony and therefore would like > to provide a warm and fuzzy feeling that slony is current. > > > I thought I was clever and built a script that selects the most recent > timestamp from the event tables on both and compares to see that they are > within 10 seconds. It took me about 45 days to learn the hard way that this > is not enough. > > So I got stupid-brute-force. I created a cron job that updates a value in a > slony'd table's column every minute to the current_timestamp. My > "health" check simply queries the subscriber's value for this column to see > if it is within the last 2 minutes. For me, I had an appropriate > table of "parameters" where I could just create a "slony_ts" parameter and > update its value. You may not have this, so maybe you'd create a > special table just for this purpose.
There is value to both approaches: - Checking sl_status to see if Slony-I thinks it's behind will work fairly well both when things are working well, and when your underlying system *isn't* busy (e.g. - when it's not doing any "real work." - There is also value to having an "end-to-end" test that looks for some application data. We have a "transaction table" which is normally updated quite frequently, 24 hours a day. Looking at the youngest transaction in that table is a pretty good test; if there's no new-looking data, then there's probably a problem with the *application*, even if replication's working fine. -- (reverse (concatenate 'string "ofni.secnanifxunil" "@" "enworbbc")) http://linuxfinances.info/info/spiritual.html The meta-Turing test counts a thing as intelligent if it seeks to apply Turing tests to objects of its own creation. _______________________________________________ Slony1-general mailing list [email protected] http://lists.slony.info/mailman/listinfo/slony1-general
