behavior.
* Added Atom Smasher test (scale baby, scale!)
* Servers are now sorted, meaning that servers are now ordered so that
clients with the same lists, will have same distribution. (Idea from
- Ross McFarland).
+ Ross McFarland). MEMCACHED_BEHAVIOR_SORT_HOSTS was added to enable
+ this support.
* Added MEMCACHED_BAD_KEY_PROVIDED error for auto, set, and get operations
when the library is compiled with --enable-debug. This additional code
will test for bad keys.
connection. Quiting the connection or closing down the connection will also
cause the buffered data to be pushed to the remote connection.
+=item MEMCACHED_BEHAVIOR_SORT_HOSTS
+
+Enabling this will cause hosts that are added to be placed in the host list in
+sorted order. This will defeat consisten hashing.
+
=back
=head1 RETURN
MEMCACHED_BEHAVIOR_DISTRIBUTION,
MEMCACHED_BEHAVIOR_BUFFER_REQUESTS,
MEMCACHED_BEHAVIOR_USER_DATA,
+ MEMCACHED_BEHAVIOR_SORT_HOSTS,
} memcached_behavior;
typedef enum {
MEM_USE_CACHE_LOOKUPS= (1 << 6),
MEM_SUPPORT_CAS= (1 << 7),
MEM_BUFFER_REQUESTS= (1 << 8),
+ MEM_USE_SORT_HOSTS= (1 << 9),
} memcached_flags;
/* Hashing algo */
case MEMCACHED_BEHAVIOR_KETAMA:
set_behavior_flag(ptr, MEM_USE_KETAMA, data);
break;
+ case MEMCACHED_BEHAVIOR_SORT_HOSTS:
+ set_behavior_flag(ptr, MEM_USE_SORT_HOSTS, data);
+ break;
case MEMCACHED_BEHAVIOR_USER_DATA:
ptr->user_data= data;
break;
case MEMCACHED_BEHAVIOR_KETAMA:
temp_flag= MEM_USE_KETAMA;
break;
+ case MEMCACHED_BEHAVIOR_SORT_HOSTS:
+ temp_flag= MEM_USE_SORT_HOSTS;
+ break;
case MEMCACHED_BEHAVIOR_USER_DATA:
return 0;
//return (unsigned long long)ptr->user_data;
uint8_t server_sort_test(memcached_st *ptr)
{
+ unsigned int setting;
memcached_server_st *server_list;
memcached_return rc;
+ setting= 1;
+ memcached_behavior_set(ptr, MEMCACHED_BEHAVIOR_SORT_HOSTS, &setting);
+
server_list= memcached_server_list_append(NULL, "arg", 0, &rc);
assert(server_list);