memcached_dump: ignore CLIENT_ERROR Illegal slab id
authorMichael Wallner <mike@php.net>
Fri, 10 Jan 2020 16:35:12 +0000 (17:35 +0100)
committerMichael Wallner <mike@php.net>
Fri, 10 Jan 2020 16:35:12 +0000 (17:35 +0100)
libmemcached/dump.cc

index fcb66604e41eb072089842b9345ab07d97074a63..f74f3ed1f564ce22fb53bdb09478ac5bf210a168 100644 (file)
@@ -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