From: Trond Norbye Date: Sun, 3 May 2009 21:30:16 +0000 (-0700) Subject: Flush _all_ servers when we hit the prefetch limit X-Git-Tag: 0.29~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=e11b7835ec753555cc85cf9dd01f14b7818ce046;p=m6w6%2Flibmemcached Flush _all_ servers when we hit the prefetch limit --- diff --git a/libmemcached/memcached_get.c b/libmemcached/memcached_get.c index 4d5fe7ca..eb6877d7 100644 --- a/libmemcached/memcached_get.c +++ b/libmemcached/memcached_get.c @@ -311,14 +311,16 @@ static memcached_return binary_mget_by_key(memcached_st *ptr, if ((memcached_io_write(&ptr->hosts[server_key], request.bytes, sizeof(request.bytes), 0) == -1) || (memcached_io_write(&ptr->hosts[server_key], keys[x], - key_length[x], - flush || (x > 0 && x == ptr->io_key_prefetch)) == -1)) + key_length[x], flush) == -1)) { memcached_server_response_reset(&ptr->hosts[server_key]); rc= MEMCACHED_SOME_ERRORS; continue; } memcached_server_response_increment(&ptr->hosts[server_key]); + if ((x > 0 && x == ptr->io_key_prefetch) && + memcached_flush_buffers(ptr) != MEMCACHED_SUCCESS) + rc= MEMCACHED_SOME_ERRORS; } if (number_of_keys > 1)