Issue #3462456 by o'briat, japerry: fix: make failed-server removal actually...

The README recipe documented for OPT_REMOVE_FAILED_SERVERS never removed anything. The module opens a new, non-persistent \Memcached on every request, libmemcached counts at most one failure per operation and will not retry a server until OPT_RETRY_TIMEOUT seconds have passed, so with OPT_SERVER_FAILURE_LIMIT of 2 or more the dead server stays in the ring: each request pays a connect timeout and every key that hashes to that server fails for the whole request. With a limit of 1 the server is dropped on the first failure and its keys are served by the survivors. Document that, and the stale-data trade-off it comes with.

\Memcached::getStats() returns FALSE for the whole pool as soon as one server does not answer, which left the memcache_admin statistics page with nothing but a generic configuration error. Fall back to asking each server on its own, and flag the ones that do not answer. The existing "Failed to connect" message was unreachable and used a ':' placeholder, which stripped the host as an unknown URL scheme.

Covered by a kernel test for the pool behaviour with and without removal and a functional test for the statistics page.

Closes #3462456

Merge request reports

Loading
Loading