X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fdump.cc;h=f74f3ed1f564ce22fb53bdb09478ac5bf210a168;hb=1d0993d84fd87ef620f60380745914bac3e77d34;hp=35da13f58db11adb32346d03cddb686de5514b97;hpb=326e812b0ca940bf90aaadf69312a0316091d0cb;p=awesomized%2Flibmemcached diff --git a/libmemcached/dump.cc b/libmemcached/dump.cc index 35da13f5..f74f3ed1 100644 --- a/libmemcached/dump.cc +++ b/libmemcached/dump.cc @@ -68,7 +68,7 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac // Send message to all servers for (uint32_t server_key= 0; server_key < memcached_server_count(memc); server_key++) { - org::libmemcached::Instance* instance= memcached_instance_fetch(memc, server_key); + memcached_instance_st* instance= memcached_instance_fetch(memc, server_key); memcached_return_t vdo_rc; if (memcached_success((vdo_rc= memcached_vdo(instance, vector, 3, true)))) @@ -82,7 +82,7 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac } // Collect the returned items - org::libmemcached::Instance* instance; + memcached_instance_st* instance; memcached_return_t read_ret= MEMCACHED_SUCCESS; while ((instance= memcached_io_get_readable_server(memc, read_ret))) { @@ -114,7 +114,7 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac { // All items have been returned } - else if (response_rc == MEMCACHED_SERVER_ERROR or response_rc == MEMCACHED_CLIENT_ERROR or response_rc == MEMCACHED_ERROR) + else if (response_rc == MEMCACHED_SERVER_ERROR) { /* If we try to request stats cachedump for a slab class that is too big * the server will return an incorrect error message: @@ -126,6 +126,18 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac assert(response_rc == MEMCACHED_SUCCESS); // Just fail return response_rc; } + else if (response_rc == MEMCACHED_CLIENT_ERROR) + { + /* The maximum number of slabs has changed in the past (currently 1<<6-1), + * so ignore any client errors complaining about an illegal slab id. + */ + if (0 == strncmp(buffer, "CLIENT_ERROR Illegal slab id", sizeof("CLIENT_ERROR Illegal slab id") - 1)) { + memcached_error_free(*instance); + memcached_error_free(*memc); + } else { + return response_rc; + } + } else { // IO error of some sort must have occurred