fix return value of commands that clear_cache

The MogileFS::Admin test case cares about the return value from
the library when using "create_domain", even if mogadm does not.
provide a server setting cache via monitor worker
Use cached server settings in more places

primarily the "read only" paths of slave lists and memcached lists.

secondarily a few random places in JobMaster to avoid poking the DB when we
don't have to.
Kill some dead code from Fsck worker
validate_dbh now immediately pings dbh

Change all callers to sleep unless having a valid dbh, in case of the master
DB going down. This avoids crash spam, but it'll spam error messages as of
this commit.
don't spew errors if the master goes down

complain if the server had gone away after a ping test. workers will also
crash if the server dies in the middle of its routine, but not continue to
spam.

We were also uselessly selecting slave info from the master and slave
constantly :( Both of those things are probably also jobs for the monitor
worker.
version the slave settings instead of time-refresh

should avoid reparsing the slave settings so often when people typically don't
edit them much.

the gross hack required for easily adding the version means the number will
jump a few times per edit, but that doesn't hurt anything.
improve slave handling code

add new hook "slave_list_filter" for ZoneLocal/etc to use for narrowing to
local_network slaves.

Improve slave handling code; use a random slave each time, but avoid
reconnecting all slaves if one dies. Avoid retrying dead slaves for
slave_dead_retry_timeout seconds (15s default).

Do reconnect all slaves if the configuration changes.
Destroy mogdeps

Modules are years out of date, and tend to hurt more than they help now.

We should figure out carton/etc.
kill a little more dead fsck/Checker code

I think "Checker" was renamed to Fsck long before I even worked on this
project.
Revert part of f63f630a

use'ing MogileFS::Server everywhere seems to occasionally cause dep implosion
(like testing MogileFS::Network)

Might need to put the Mgd:: aliases into a separate dependency and test it
better :/ For now I've removed enough to make the tests work again. None of
these files call anything other than ::log or ::error so they're safe enough.
allow server setting to un-molest slave list

in case you really want trackers in all DC's to talk to all slaves

also, don't hide the slave connection error.
ensure dead slaves get retried

previous code would not retry unless a current slave died, list was empty, or
config changed.
sqlite: consider SQLITE_BUSY and SQLITE_LOCKED deadlocks

This appears to work for me and allows JobMaster to not
die during fsck.
Ping parent as needed to stop watchdog timeouts of monitor job.

This fixes the watchdog repeatedly shooting the monitor job when you have
a lot of devices and things are a little slow.
fix "set_weight" command

The sub we previously depended on was removed in
commit ebf8a5a8dc9b4452671f7816b99583bf7934e9b1
fix potential hang in JobMaster

$dbh->err gets reset after every request, so when I added the queue
lock/unlock I think it masked the deadlock errors. Which means transactions
would occasionally start then never finish.

Rewired the error detection to mostly work, then added a catchall at the
bottom just in case. needs more work in the future.
Add connect timeouts

This should work with the primarily supported databases.

Mainly this is for slave setups, so slaves which are broken but not
immediately RST'ing or error'ing get backed off from.

You'll still get some watchdog hits when a slave first dies, but it'll handle
it properly from there with minimal delays.
Checking in changes prior to tagging of version 2.56.

Changelog diff is:

diff --git a/CHANGES b/CHANGES
index ccb3122..6423acc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,33 @@
+2012-01-27: Release version 2.56
+
+   * Add database connect timeouts (dormando <dormando@rydia.net>)
+
+   * fix potential hang in JobMaster added in 2.55 (dormando <dormando@rydia.net>)
+
+   * fix "set_weight" command (Eric Wong <normalperson@yhbt.net>)
+
+   * sqlite: consider SQLITE_BUSY and SQLITE_LOCKED deadlocks (Eric Wong <normalperson@yhbt.net>)
+
+   * kill a little more dead fsck/Checker code (dormando <dormando@rydia.net>)
+
+   * Destroy mogdeps (dormando <dormando@rydia.net>)
+
+   * improve slave handling code (dormando <dormando@rydia.net>)
+
+   * don't spew errors if the master goes down (dormando <dormando@rydia.net>)
+
+   * provide an async server setting cache via monitor worker (dormando <dormando@rydia.net>)
+
+   * fix return value of commands that clear_cache (Eric Wong <normalperson@yhbt.net>)
+
+   * make reaper wait less time in test mode (dormando <dormando@rydia.net>)
+
+   * queryworker: reimplement "clear_caches" command (Eric Wong <normalperson@yhbt.net>)
+
+   * worker: use timeout with read_from_parent() instead of sleep (Eric Wong <normalperson@yhbt.net>)
+
    * Fixed issue where too many devices being active could cause the monitor job
-     to be timed out by the watchdog.
+     to be timed out by the watchdog. (Tomas Doran)

 2011-11-14: Release version 2.55
Need a hook to be able to check the slave list during startup.