There are certain situations in which getAuth() may want to be overridden by a
backend for performance reasons. The attached patch converts getAuth() into a
virtual backend function. The default is for no change in functionality. In my
tests this leads to very significant performance improvements under certain
situations

fixes PowerDNS/pdns#581
fixes PowerDNS/pdns/657

I noticed this as a result of the changes in 3.2 whereby each receiver gets its own distributor - whenever the dynhandler calls ->getBackend() it will only find the one in its' current thread, so reload won't propergate to backends within other threads.

However, I suspect this condition has always been around as a race - if I have multiple distributors and I call reload; one thread is issuing reloads while all the other backend threads are currently executing (potentially). I guess if you call reload in previous versions on a highly loaded server with multiple backends you could probably get it to crash.

The attached patch changes it so that each backend has a variable which is changed to signal that a reload or rediscover has been requested. When processing gets to an appropriate point ie before it next queries the backend database, such an operation will be run. Note that it is not run in ::get as we don't want a backend to be reloaded between performing a lookup and getting the records.

This patch means that reload/reinitialize are not done straight away as in previous versions, but on a moderately loaded server this should not be a problem as they will be performed the next time a backend is called.
merge in fix-reload branch as dep
Merge branch 'backend-cache-optimization' into backend-getauth
Terminate pdns process after SIGINT
Align with pipebackend as per #1137 and #661
Implementation for multi-ip master
SQL statements required by multi-ip master
Remove unnecessary if block
Add comments
Merge pull request #1160 from cmouse/remotebackend-pipe-connector-1137

Align with pipebackend as per #1137 and #661
Check that the domain isn't already served by the new master
Sets d_server to NULL on failed initialization
Merge pull request #1161 from cmouse/gsql-supermaster-dualstack

WIP: Gsql supermaster dualstack
Enable zeromq for remotebackend
Fix typo in TEST_ENVIRONMENT to allow zeromq test suite to run
Merge pull request #1162 from cmouse/nullify-webserver-d_server

Sets d_server to NULL on failed initialization
Add primary key to schemas
Fixed goracle schema white space
Wait until processes die before exiting