summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrudhviraj K <pkarumanchi@netflix.com>2022-06-20 11:16:14 -0700
committerdormando <dormando@rydia.net>2022-07-24 23:06:56 -0700
commitf7d8dbdab9baacf425fba64f6786fd9f05fd2d5d (patch)
treeb54776cfac8fc38f9c0a5cadd584b455b6387ad7
parent57350fc925abd64fa4cdf36e2a76530e9e9d6f39 (diff)
downloadmemcached-f7d8dbdab9baacf425fba64f6786fd9f05fd2d5d.tar.gz
fix the hashstring size for evcache ketama
add proxy_debug flag for protocol handler in verbose printing
-rw-r--r--memcached.c4
-rw-r--r--proxy_ring_hash.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/memcached.c b/memcached.c
index 41518d2..fd36377 100644
--- a/memcached.c
+++ b/memcached.c
@@ -730,6 +730,10 @@ conn *conn_new(const int sfd, enum conn_states init_state,
fprintf(stderr, "<%d new ascii client connection.\n", sfd);
} else if (c->protocol == binary_prot) {
fprintf(stderr, "<%d new binary client connection.\n", sfd);
+#ifdef PROXY
+ } else if (c->protocol == proxy_prot) {
+ fprintf(stderr, "<%d new proxy client connection.\n", sfd);
+#endif
} else {
fprintf(stderr, "<%d new unknown (%d) client connection\n",
sfd, c->protocol);
diff --git a/proxy_ring_hash.c b/proxy_ring_hash.c
index e3fa3f3..c04e323 100644
--- a/proxy_ring_hash.c
+++ b/proxy_ring_hash.c
@@ -332,6 +332,9 @@ static int ketama_new(lua_State *L) {
_add_server_twemproxy(kt, hashstring_size, parts, bucket_size, id, &cont);
break;
case MODE_EVCACHE:
+ // EVCache uses the ipaddress couple of times, we need to factor that in
+ // when calculating the hashstring_size
+ hashstring_size += partlens[0];
_add_server_evcache(kt, hashstring_size, parts, bucket_size, id, &cont);
break;
}