Tomasz Grabiec
e3fa358075
test: memcache: flush all keys after each test
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
6ed212e7c6
tests: memcache: add tests for 'stats' command
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
7ae9178439
memcache: introduce 'stats' command
...
Our version prints only a subset of statistics printed by stock memcache.
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
4edfc4f0c2
core: implement to_sstring(const char*)
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
287ad01f76
memcache: make cache::size() return only live items
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
51f52ed2b5
tests: memcache: make tests more robust
...
By automatically detecting when memcache is up and running.
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
e07e6ccbef
tests: memcache: add tests for 'cas' and 'gets'
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
7c9e31a0b2
memcache: add 'cas' and 'gets' commands
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
f134fe1a94
tests: memcache: add tests for 'add' and 'replace'
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
5c649c54fb
memcache: add support for 'add' and 'replace' commands
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
d5a0e9654e
tests: memcache: add tests for 'noreply' variant of 'set' and 'delete'
...
This also extracts some code to a common base class.
2014-10-18 12:59:59 +02:00
Tomasz Grabiec
f3ebe8abe9
memcache: support 'noreply' on 'set' and 'delete'
2014-10-18 12:59:58 +02:00
Tomasz Grabiec
a1848ca6a7
tests: memcache: add test for 'version' command
2014-10-18 12:59:58 +02:00
Tomasz Grabiec
84d5b7098f
memcache: implement 'version' command
2014-10-18 12:59:58 +02:00
Tomasz Grabiec
e30b097867
tests: memcache: fix assertion so that it works with stock memcached too
2014-10-18 12:59:58 +02:00
Tomasz Grabiec
3347a78289
tests: memcache: add tests for 'flush_all' command
2014-10-18 12:59:58 +02:00
Tomasz Grabiec
fdc4e7bbf5
tests: memcache: cleanup: rename methods
2014-10-18 12:59:58 +02:00
Tomasz Grabiec
f2b1d16ce5
memcache: implement 'flush_all' command
2014-10-18 12:59:58 +02:00
Tomasz Grabiec
09faeff196
tests: distinguish between fast and slow tests
...
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
2014-10-18 12:59:50 +02:00
Tomasz Grabiec
db5cdc3918
tests: memcache: add test exploiting string_builder issue
2014-10-16 12:35:09 +02:00
Tomasz Grabiec
5d6eaaea33
ragel: reset string builder on init
...
Otherwise it will contain stale data from previous unsuccessful pass.
2014-10-16 12:24:30 +02:00
Tomasz Grabiec
6b970957d9
core: never throw from keep_doing()
...
Exception thrown from async action should be returned in a failed
future rather than thrown to the caller of keep_doing().
2014-10-16 11:45:32 +02:00
Tomasz Grabiec
c1dc3b0d53
memcache: handle end of stream properly on TCP
2014-10-16 11:45:32 +02:00
Tomasz Grabiec
2e5c3c3317
memcache: tests: add tests for error recovery
2014-10-16 11:45:30 +02:00
Tomasz Grabiec
cf2d72a360
memcache: recover from errors in the TCP stream
...
This is mostly to make memcapable from libmemcached happy.
When client issued a bad command, we should discard all data we have
so that the next command on that connection can succeed.
2014-10-16 09:11:11 +02:00
Tomasz Grabiec
45772b9ab7
test.py: run memcache with --smp 1
...
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.
2014-10-16 09:11:08 +02:00
Raphael S. Carvalho
9ef466bae2
blkdiscard_test: switch to app-template
...
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com >
2014-10-15 21:22:48 +03:00
Avi Kivity
7f33a52cf8
Merge branch 'memcache' of github.com:cloudius-systems/seastar-dev
...
Initial version of memcached on seastar from Tomasz:
"Supports subset of ASCII protocol, commands: get, set and delete.
Both UDP and TCP are supported."
2014-10-15 19:20:39 +03:00
Avi Kivity
e6834b9fb3
virtio: remove allocations from transmit path
...
Instead of allocating a buffer vector, construct a "virtual vector"
that transforms packet fragments as needed.
2014-10-15 17:17:01 +03:00
Avi Kivity
ba5447871b
virtio: switch to allocating virtio decriptors front-to-back
...
Simplifies requirements on callers.
2014-10-15 17:17:01 +03:00
Avi Kivity
a331b5a129
virtio: move vring::buffer::completed to vring::buffer_chain
...
We aren't interested in completion of a buffer, just a buffer_chain (aka
request). Move it there to simplify things.
2014-10-15 17:17:01 +03:00
Avi Kivity
6f1dab52fe
virtio: reduce rx allocations when preparing buffers (part 2)
...
Instead of producing a range of buffer chains, produce a range
of buffer arrays (std::array<buffer>). These do not require any
allocations.
2014-10-15 17:17:01 +03:00
Avi Kivity
7684f00ebe
virtio: reduce rx allocations when preparing buffers (part 1)
...
Instead of returning a vector of buffer chains, return an iterator
range that will produce those vectors on the fly, removing the vector
allocation.
2014-10-15 17:17:01 +03:00
Avi Kivity
de4de65d46
virtio: convert vring::post() to accept an iterator to a range
...
Instead of an iterator to a vector of buffers, accept an iterator
to a container of buffers, increasing flexibility for callers.
2014-10-15 17:17:01 +03:00
Avi Kivity
d63489d6b8
util: add transform_iterator
...
Like boost's - an iterator that applies a function to the result
of an underlying iterator. Unlike boost, it supports using lambdas
for the function.
2014-10-15 17:16:55 +03:00
Tomasz Grabiec
bb5d1164b1
tests: memcache: test both TCP and UDP
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
ec42ca860a
memcache: add TCP server
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
319ae0b530
core: add shared_ptr::operator=(T&&)
...
Allows to move an item directly into existing shread_ptr.
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
a4eba9b031
posix: suppress SIGPIPE
...
When socket was closed by the other side and we try to write into it
the process gets SIGPIPE. We should suppress it, so that failure is
handled locally. Now the failure will percolate up as an exception.
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
d575ad2dfb
memcache: introduce periodic stats printer
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
50feeef580
tests: memcache: introduce end-to-end tests
...
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.
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
6a31f3762c
tests: memcache: add test for ASCII parser
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
97a16c16fd
core: add operator<< which can print any vector
...
Useful in tests.
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
88537320f3
memcache: initial version
...
Supports UDP and subset of ASCII protocol with the following commands:
get, set and delete.
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
454ee88bb6
core: make keep_doing() propagate failure
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
ca077f33ef
core: introduce or_terminate()
...
Calls std::terminate() when future fails. It can be used like this:
do_something([] {}).or_terminate();
2014-10-15 15:59:41 +02:00
Tomasz Grabiec
277535ca75
core: introduce vector_data_sink
2014-10-15 15:59:41 +02:00
Tomasz Grabiec
dec042f9c2
core: introduce do_for_each()
...
Useful when composing iteration with async operations.
2014-10-15 15:59:41 +02:00
Tomasz Grabiec
ceeda85080
core: add more overloads of output_stream::write()
2014-10-15 15:59:41 +02:00
Avi Kivity
4c64750f76
util: add function_input_iterator
...
Like boost's template of the same name, but works with lambdas.
2014-10-15 16:57:18 +03:00