Commit 405f3ea8c3 changed reactor so
that _network_stack is no longer default initialized to POSIX but to
nullptr. This caused tests to segfault, becayse they are not using
application template which takes care of configuration.
The fix is to call configure() so that netwrok stack will be set to
POSIX.
Improves memaslap UDP posix throughput on my laptop by 40% (from 73k to 105k).
When item is created we cache flags and size part of the response so
that there's no need to call expensive string formatting in get(). The
down side is that this pollutes "item" object with protocol-specific
field, but since ASCII is the only protocol which is supported now and
it's not like we can't fix it later, I think it's fine.
There is a separate DB per core, each serving a subset of the key
space. From the outside in appears to behave as one DB.
item_key type was changed to include the hash so that we calculate the
hash only once. The same hash is used for sharding and hashing. No
need for store_hash<> option on unordered_set<> any more.
Some seastar-specific and hashtable-specific stats were moved from the
general "stats" command into "stats hash", which shows per-core
statistics.
Some packets, like arp replies, are broadcast to all cpus for handling,
but only packet structure is copied for each cpu, the actual packet data
is the same for all of them. Currently networking stack mangles a
packet data during its travel up the stack while doing ntoh()
translations which cannot obviously work for broadcaster packets. This
patches fixes the code to not modify packet data while doing ntoh(), but
do it in a stack allocated copy of a data instead.
Currently, it is a ping/pong sever. When the client sends a ping, the
server responds a pong. We can add more tests to extend.
This is useful for testing TCP_RR.
Some versions of python do not tolerate this regex:
r'(\w*)?'
ERROR: test_incr (__main__.TestCommands)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/memcached/test_memcached.py", line 464, in test_incr
self.assertRegexpMatches(call('incr key 1\r\n').decode(), r'0(\w*)?\r\n')
File "/usr/lib64/python3.3/unittest/case.py", line 1178, in deprecated_func
return original_func(*args, **kwargs)
File "/usr/lib64/python3.3/unittest/case.py", line 1153, in assertRegex
expected_regex = re.compile(expected_regex)
File "/usr/lib64/python3.3/re.py", line 214, in compile
return _compile(pattern, flags)
File "/usr/lib64/python3.3/re.py", line 281, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib64/python3.3/sre_compile.py", line 498, in compile
code = _code(p, flags)
File "/usr/lib64/python3.3/sre_compile.py", line 483, in _code
_compile(code, p.data, flags)
File "/usr/lib64/python3.3/sre_compile.py", line 75, in _compile
elif _simple(av) and op is not REPEAT:
File "/usr/lib64/python3.3/sre_compile.py", line 362, in _simple
raise error("nothing to repeat")
sre_constants.error: nothing to repeat
The protocol is called the "memcache protocol" but the server should
follow the same naming convention as httpd does.
It should not be a big deal but it annoys the hell out of simple people
like myself who have their brain hard-wired to type the final "d"...
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Most of the tests are fast and they cover most of the
functionality. The slow minority of tests takes significantly more
time to run. Developers should run tests frequently in order to get
feedback on correctness of their changes. The test runner
distinguishes now between fast and slow tests. When given '--fast'
switch it skips tests marked as slow.
$ time ./test.py
[8/8] PASSED tests/memcache/test.py --mode release
OK.
real 0m33.084s
user 0m0.501s
sys 0m0.271s
$ time ./test.py --fast
[8/8] PASSED tests/memcache/test.py --mode release --fast
OK.
real 0m1.012s
user 0m0.464s
sys 0m0.247s
It doesn't support more than one CPU yet. The symptom is that TCP
connections will have a chance of hanging when they're routed to the
CPU on which memcache doesn't run.
These tests exercise memcache instance using a real client. The
test_memcache.py suite can be run against any memcache instance which
conforms to the ASCII protocol.
Asynchronous test cases can be delared using SEASTAR_TEST_CASE macro,
which is equivalent to BOOST_AUTO_TEST_CASE, but the function body is
run inside a reactor and can returns a future<> which resolves when
the test is done.