Subtask #2805
Feature #2611: mon: Single-Paxos
Subtask #2621: mon: Single-Paxos: synchronize the MonitorDBStore of oblivious monitor
Subtask #2739: mon: Single-Paxos: Sync: Synchronize the store of a drifted monitor
mon: Single-Paxos: Sync: Create a test unit to verify the correctness of the whole-space and snapshot iterators
100%
Description
We have added support for a whole-space iterator and a snapshot iterator (task #2758) on KeyValueDB and LevelDB, and we extended KeyValueDB's in-memory mock (task #2756).
We must now create a test unit to verify if the iterator behaves according to what is expected, aside from the keyvaluedb-related tests that already exist.
An initial implementation is already done, and it focus on testing how the iterator deals with keys/values being removed while we are iterating over the store, either with or without using snapshots.
However, other tests should be created, such as:
- seeking to various prefixes
- obtaining lower/upper bounds
- stress testing the next() call
- stress testing the prev() call
Although the already existing tests use seeks, upper/lower bounds and next() calls, they do not use prev() calls, making it harder to assess if these behave as expected.
Also, this test should be created as a gtest. It already has such support, but such was done in a very unorthodox way and should be changed.
History
#1 Updated by Joao Eduardo Luis over 11 years ago
- % Done changed from 60 to 80
Current available test units:
- Removing keys:
- Using the whole-space iterator, both in LevelDBStore and KeyValueDBMemory;
- Using the whole-space snapshot iterator, following the same use case as above;
- Updating values:
- Using the whole-space iterator, updating values during iteration and matching expected results, both in LevelDBStore and KeyValueDBMemory;
- Using the whole-space snapshot iterator, following the same use case as above;
- Bounds:
- Using the whole-space iterator, checks if multiple usages of the lower_bound() function produces the correct results, both in LevelDBStore and KeyValueDBMemory;
- Following the same use case as above, but focusing on the upper_bound() function;
- Backwards iteration:
- Checks if seeking to the last position and then iterating backwards produces the expected results, both in LevelDBStore and KeyValueDBMemory;
Missing:
- Whole-space seeks and prefix-based seeks;
- Prefix-based lower/upper bounds;
#2 Updated by Joao Eduardo Luis over 11 years ago
- % Done changed from 80 to 100
Currently available tests:
- Removing keys:
- Using both the whole-space iterator and the whole-space snapshot iterator
- Tests key removal while iterating the store, either by prefix or by removing specific (prefix,key) pairs
- Setting keys:
- Using both the whole-space iterator and the whole-space snapshot iterator
- Tests key insertion while iterating the store
- Tests value update while iterating the store
- This use case has two disabled tests: one when setting keys, other when updating values, both on LevelDBStore and using the whole-space iterator; this is because they will fail, unlike when using the in-memory mock implementation, because leveldb implicitely creates an iterator that will read from a snapshot instead of directly from the underlying store.
- Using Upper/Lower Bounds:
- Using the whole-space iterator (we don't modify the store's state, so there is no need to also test the whole-space snapshot iterator)
- Tests upper/lower bounds when the key, the prefix or both are empty
- Tests upper/lower bounds when both the key and the prefix are set
- Seeking:
- Using the whole-space iterator (we don't modify the store's state, so there is no need to also test the whole-space snapshot iterator)
- Tests seeking to first and to last
- Tests seeking to first and to last using a prefix
- Key-Space Iteration:
- Using the whole-space iterator (we don't modify the store's state, so there is no need to also test the whole-space snapshot iterator)
- Tests forward and backward iteration over the key-space
- Empty Store:
- Using the whole-space iterator (we don't modify the store's state, so there is no need to also test the whole-space snapshot iterator)
- Tests seeking and using bounds functions when the store is empty
#3 Updated by Joao Eduardo Luis over 11 years ago
- Status changed from New to Fix Under Review
#4 Updated by Joao Eduardo Luis over 11 years ago
- Status changed from Fix Under Review to Resolved