From e96f7e024e860a67424282efd6dcc11cbb2b681d Mon Sep 17 00:00:00 2001 From: lingsheng Date: Fri, 30 Oct 2020 16:00:14 +0800 Subject: [PATCH] Ignore specific errors from memcached_dump https://github.com/php-memcached-dev/php-memcached/pull/315 Signed-off-by: lingsheng --- clients/memdump.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clients/memdump.cc b/clients/memdump.cc index 48c35d3..5c6d693 100644 --- a/clients/memdump.cc +++ b/clients/memdump.cc @@ -123,7 +123,13 @@ int main(int argc, char *argv[]) memcached_return_t rc= memcached_dump(memc, callbacks, NULL, 1); int exit_code= EXIT_SUCCESS; - if (memcached_failed(rc)) + /* Ignore two errors. libmemcached has a hardcoded loop of 200 slab + * classes that matches memcached < 1.4.24, at which version the server + * has only 63 slabs and throws an error when requesting the 64th slab. + * + * In multi-server some non-deterministic number of elements will be dropped. + */ + if (rc != MEMCACHED_CLIENT_ERROR && rc != MEMCACHED_SERVER_ERROR && memcached_failed(rc)) { if (opt_verbose) { -- 2.23.0