Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction logic testing tool / load testing tool #31

Open
rdaum opened this issue Sep 30, 2023 · 3 comments
Open

Transaction logic testing tool / load testing tool #31

rdaum opened this issue Sep 30, 2023 · 3 comments
Labels
help wanted Extra attention is needed priority-high

Comments

@rdaum
Copy link
Owner

rdaum commented Sep 30, 2023

I would like a suite of tests to check for correctness of concurrent behaviour; linearizability, consistency, serialization conflicts, etc.

Still very vague in my mind, but probably a suite of Jepsen tests and/or Stateright (https://github.com/stateright/stateright).

Essentially, instantiating kernel + db with a predefined simple set of objects and then perform concurrent evaluations of mutations to provoke serialization conflicts, retries, and verify correct behaviour under concurrent load.

This will be essential in the short run run for a) finishing the transactional layer (retries on conflict) and b) making sure the Rocks etc layer works as hopes and in the medium/long run for swapping in alternative world state storage models.

@rdaum rdaum added help wanted Extra attention is needed priority-high labels Sep 30, 2023
@rdaum
Copy link
Owner Author

rdaum commented Sep 30, 2023

Stateright is more immediately easier to integrate into a Rust automated testing workflow, and their examples show how to do that. However its examples and focus is primarily on distributed systems testing, so teasing out how to do a good test of e.g. MVCC behaviour is something that would have to be learned.

Jepsen is the gold standard for database / distributed systems correctness testing, and it is likely that there's more concrete examplars to follow in this regard for testing on a single-node system for transaction correctness. Basically need to take a look at existing DB jepsen tests that test serialization conflict, and work from there to adapt for Moor. However it has its own external dependencies, runs in Java, etc. and is much more complicated to set up. Maybe running in a docker container? (see https://github.com/jepsen-io/jepsen/blob/main/docker/README.md)

@rdaum
Copy link
Owner Author

rdaum commented Dec 29, 2023

rdaum added a commit that referenced this issue Dec 1, 2024
#31

A program which runs a series of concurrent workloads of reading and
appending to lists on a set of random properties, in a number of
concurrent transactions. It then logs them into an "EDN" format file
that the `elle` tool from `jepsen` can read and check for
transactional isolation inconsistencies.

With this we are able to prove whether or not `moor` enforces strict
serializable isolation. At least in this (for now) limited use case.

Using this tool I was able to test the conflict-retry logic under
load, as well as find some bugs in it.

Testing shows that with the fjall-db backend and for this list-append
workload, moor behaves correctly with `serializable` isolation, but does
not conform to elle's definition of `strict-serializable`
@rdaum
Copy link
Owner Author

rdaum commented Dec 1, 2024

Ok so updating this, the above comments being very old and obsolete...

I now have a separate (model-checker) tool which puts the whole system under concurrent load doing property updates to append values to lists on a few properties.

It then outputs the read/append results to an EDN-format file that Jepsen's elle tool can read. Elle is then able to verify the transaction isolation model.

Using this I was able to prove that moor running with the fjall-db backend behaves properly with serializable transaction isolation and snapshot isolation levels. It does not however satisfy jepsen's strict-serializable model, though I'm unclear how that differs.

@rdaum rdaum changed the title Jepsen and/or Stateright tests Transaction logic testing tool / load testing tool Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed priority-high
Projects
None yet
Development

No branches or pull requests

1 participant