Read Concern Majority Test.
OVERVIEW:
readConcern majority should provide the guarantee that any data returned is the result of committed operations, i.e. operations that are present on a majority of the nodes in the replica set, and therefore should never be rolled back. To check this, we verify the following property, which should hold given the restriction that we consider only document insert operations; no updates or deletes.
If R is a readConcern majority read that occurs at time T (from the perspective of a fixed client) and reads the set of documents D from a collection C, then any read R' that occurs at time T’ >= T, should read a set of documents D' such that D is a subset of D', i.e. every document that exists in D should exist in D'.
TEST SETUP:
In order to check the above property, this test continually inserts unique documents, on potentially many writer threads, while a single thread periodically reads the full state of the collection. When the test completes, we verify that the set of documents returned by every read R is a subset of the documents returned by the subsequent read, R'. Note that 'subsequent' in this context has a well defined meaning since reads occur within a single thread of execution.
e.g.
Reader/Writer Threads:
Writer-1 –––––––––––––––––––––––––––––––––––––> Writer-2 ––––––––––––––––––––––––––––––––––––––> Writer-3 –––––––––––––––––––––––––––––––––––––> . . . Writer-N ––––––––––––––––––––––––––––––––––––––> Reader –––––––R–––––––––R–––––––––R–––––––––R–––>
Read Concern Majority Test. OVERVIEW: readConcern majority should provide the guarantee that any data returned is the result of committed operations, i.e. operations that are present on a majority of the nodes in the replica set, and therefore should never be rolled back. To check this, we verify the following property, which should hold given the restriction that we consider only document insert operations; no updates or deletes. If R is a readConcern majority read that occurs at time T (from the perspective of a fixed client) and reads the set of documents D from a collection C, then any read R' that occurs at time T’ >= T, should read a set of documents D' such that D is a subset of D', i.e. every document that exists in D should exist in D'. TEST SETUP: In order to check the above property, this test continually inserts unique documents, on potentially many writer threads, while a single thread periodically reads the full state of the collection. When the test completes, we verify that the set of documents returned by every read R is a subset of the documents returned by the subsequent read, R'. Note that 'subsequent' in this context has a well defined meaning since reads occur within a single thread of execution. e.g. Reader/Writer Threads: * = insert operation R = read operation Writer-1 ––*––––––––––*––––––––––*–––––*––––––––––> Writer-2 –––––––*––––––––––––*–––––––––––––*––––––> Writer-3 ––*–––––––––*––––––––––––––*––––––––*––––> . . . Writer-N ––––––––––*––––––––––*––––––––––––*––––––> Reader –––––––R–––––––––R–––––––––R–––––––––R–––>
(client opts)
A read concern majority test client.
A read concern majority test client.
(rcmajority-checker)
Given a set of :add operations interspersed with periodic :read ops, verify that for every read R that reads a set of elements D, any later read R' reads elements D', where D is a subset of D'.
Given a set of :add operations interspersed with periodic :read ops, verify that for every read R that reads a set of elements D, any later read R' reads elements D', where D is a subset of D'.
(read-gen mean-delay)
Read workload generator.
Read workload generator.
(subset-chain? sets)
Determine if a sequence of sets form an ordered chain of subsets.
(subset-chain? [#{1 2 3} #{1 2 3 4} #{1 2 3 4 5 6}]) == true
(subset-chain? [#{4 5} #{4 5 6} #{4 5 8}]) == false
(subset-chain? []) == true
(subset-chain? [#{1 2}]) == true
An empty sequence or a sequence with a single set are both considered trivially valid subset chains.
Determine if a sequence of sets form an ordered chain of subsets. (subset-chain? [#{1 2 3} #{1 2 3 4} #{1 2 3 4 5 6}]) == true (subset-chain? [#{4 5} #{4 5 6} #{4 5 8}]) == false (subset-chain? []) == true (subset-chain? [#{1 2}]) == true An empty sequence or a sequence with a single set are both considered trivially valid subset chains.
(test opts)
A read concern majority test. We continuously insert documents on many threads while periodically reading the full state of the collection with a single, dedicated reader thread, in order to ensure that our reads are causally ordered.
A read concern majority test. We continuously insert documents on many threads while periodically reading the full state of the collection with a single, dedicated reader thread, in order to ensure that our reads are causally ordered.
(write-gen mean-delay)
Write workload generator.
Write workload generator.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close