Skip to content

Model testing #160

@marvin-j97

Description

@marvin-j97

!!!

See the model-testing branch for basic setup

!!!

Run both normal and a key-value separated tree in model-based test, where:

  • random keys are written
  • random keys/ranges/prefixes are read (forwards and reverse ranges/prefixes!)
  • here and there a compaction is run; synchronously, so it's deterministic (Tree::flush_active_memtable); followed by a compaction as well (Tree::compact)
  • the state of the tree is compared to an in-memory BTreeMap after every operation
  • if the trees do not match -> fail

Considerations

  • IO errors should just stop execution (unwrap)
  • because at some point the trees and op log could become too large, we may need to nuke all data some times and start with a clean slate
  • all operations need to be logged, so we can see where something is going wrong (should probably be stored to disk)
  • keys need to be overwritten and deleted sometimes, so updates/tombstone shadowing are tested as well; and blob GC can also be invoked some times
  • test snapshots? may be harder - for now, just use an incrementing sequence number generator for both inserts and reads
  • Checking the entire tree after every operation is expensive - if we assume, let's say, an insert not to disrupt other, irrelevant data, we can only check for that key (and maybe some ranges that include it), and only do a full tree check here and there
  • especially the blob tree should sometimes receive large values for performing key-value separation with

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions