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))))
- {
- // We have sent the message to the server successfully
- }
- else
+ if (memcached_failed((vdo_rc= memcached_vdo(instance, vector, 3, true))))
{
return vdo_rc;
}
{
// 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:
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