News for hackers. Stuff that matters.
Re:Dragonflydb – A modern replacement for Redis and Memcached by anitil on Tuesday May 31, 2022 @12:05AM (#31566005)
Do you know what tooling is available for testing atomicity guarantees?
Re:Dragonflydb – A modern replacement for Redis and Memcached by romange on Wednesday June 01, 2022 @03:05AM (#31578988)
The best tool out there is probably jepsen.io but it requires domain knowledge to properly operate it. The guy behind it is a beast!

Anyway, I wrote lots of unit tests to cover those atomicity issues. You can also write a custom python/nodejs/golang/... scripts that simultenusly write and read from the same multiple keys in such way that some invariant is preserved. For example, "mset x {i}, y {i}" for random `i` and in parallel do "mget x y" and to check that the response returns same values. You can also test this for other families using transactions like "MULTI; lpush x ${foo}; lpush y ${foo}; EXEC" .. and then similarly test that x and y have exactly the same lists.

Re:Dragonflydb – A modern replacement for Redis and Memcached by anitil on Thursday June 02, 2022 @08:14AM (#31593881)
Ah thanks I had heard of and then forgotten about jepsen. I had considered what you described but I thought there might be a more targeted approach where you can specify your invariants (like "x can only be in one of two states" or "pushing alway increases the length of a list and popping always reduces it if it's non-empty") and get the tool to try to break them.

I wonder if there could be a tool that instruments in the same way that afl does to try to detect races or inconsistent states.