Skip to content
Browse files

MB-3799 - moxi default libmemcached hashing is now ketama_weighted

Change-Id: I84c498913f9f816ecd4a084375cccbe67b556967
Reviewed-on: http://review.membase.org/6537
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
1 parent 27d6397 commit 00a655803c845dc73cb8d78c448b39d8896774f4 @steveyen steveyen committed May 25, 2011
Showing with 13 additions and 13 deletions.
  1. +1 −1 mcs.c
  2. +12 −12 t/issue-MB-3076.sh
View
2 mcs.c
@@ -310,7 +310,7 @@ mcs_st *lmc_create(mcs_st *ptr, const char *config,
memcached_st *mst = memcached_create(NULL);
if (mst != NULL) {
- memcached_behavior_t b = MEMCACHED_BEHAVIOR_KETAMA;
+ memcached_behavior_t b = MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED;
uint64_t v = 1;
if (opts != NULL) {
View
24 t/issue-MB-3076.sh
@@ -127,18 +127,18 @@ echo starting memcached simulant 11277...
./moxi -d -P /tmp/moxi-3076-test-memcached.pid -p 11277
sleep 1
echo -e "set a 0 0 1\r\na\r" | nc 127.0.0.1 11277
-echo -e "set x 0 0 1\r\nb\r" | nc 127.0.0.1 11277
+echo -e "set b 0 0 1\r\nb\r" | nc 127.0.0.1 11277
echo get a x | nc 127.0.0.1 11266
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1
else
echo "OK expected some VALUE's"
fi
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1
@@ -153,17 +153,17 @@ echo starting memcached simulant 11288...
./moxi -d -P /tmp/moxi-3076-test-memcached.pid -p 11288
sleep 1
echo -e "set a 0 0 1\r\nA\r" | nc 127.0.0.1 11288
-echo -e "set x 0 0 1\r\nB\r" | nc 127.0.0.1 11288
+echo -e "set b 0 0 1\r\nB\r" | nc 127.0.0.1 11288
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1
else
echo "OK expected some VALUE's"
fi
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1
@@ -184,17 +184,17 @@ echo starting memcached simulant 11277...
./moxi -d -P /tmp/moxi-3076-test-memcached.pid -p 11277
sleep 1
echo -e "set a 0 0 1\r\na\r" | nc 127.0.0.1 11277
-echo -e "set x 0 0 1\r\nb\r" | nc 127.0.0.1 11277
+echo -e "set b 0 0 1\r\nb\r" | nc 127.0.0.1 11277
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1
else
echo "OK expected some VALUE's"
fi
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1
@@ -215,17 +215,17 @@ echo starting memcached simulant 11288...
./moxi -d -P /tmp/moxi-3076-test-memcached.pid -p 11288
sleep 1
echo -e "set a 0 0 1\r\nA\r" | nc 127.0.0.1 11288
-echo -e "set x 0 0 1\r\nB\r" | nc 127.0.0.1 11288
+echo -e "set b 0 0 1\r\nB\r" | nc 127.0.0.1 11288
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1
else
echo "OK expected some VALUE's"
fi
-count=$(echo get a x | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
+count=$(echo get a b | nc 127.0.0.1 11266 | grep "VALUE" | wc -l)
if [[ $count -ne 1 ]] ; then
echo "FAIL expected some VALUE's"
ret=1

0 comments on commit 00a6558

Please sign in to comment.
Something went wrong with that request. Please try again.