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

Snapshotting Storage #97

Merged
merged 9 commits into from
Jan 5, 2024
Merged

Snapshotting Storage #97

merged 9 commits into from
Jan 5, 2024

Conversation

mariari
Copy link
Member

@mariari mariari commented Dec 22, 2023

Create snapshot functionality

With this, we have a very slow way of effectively slowly snapshotting the database.

Very slow, someone should do a better method than what I'm doing here

@mariari mariari force-pushed the mariari/snapshot branch 5 times, most recently from 64a772f to a1088a4 Compare December 26, 2023 09:03
This serves as the basis for what a real order would expect the format
to be.

Making this an explicit type makes it easy to refactor the intenral
representation without having to go and change every instance of it
We remove all known warnings, this makes it nice as `mix test` and
other commands will not spit any wanrings anymore
This ensures that the db is initialized before we run any tests. This
matters in a lot of topics that require the DB to be online
This module consists of two parts:
1. An ordering map which tells of the latest order in the
   qualification map
2. A qualification map which maps from a qualified key to the stored
   value

Further we provide types for everything so the code can be somewhat
grocked by looking at the types
We test:

1. reads
2. blocking_reads
3. puts
4. blocking_reads with data not in yet
The intended strategy is to hold a current order and cache of ids to
orders, to better get timestamps of the keyspace

This is highly inefficient but is the best we can do without
partitioning the key_space explicitly somehow
As we can see by running:

mix test --cover

we end up testing most of the module, with just a few basic calls, the
ordering system is quite simple, and one can just take a number to
figure out where they are next in line

Percentage | Module
-----------|--------------------------
    60.00% | Anoma.Node.Storage
    92.86% | Anoma.Node.Storage.Communicator
    96.43% | Anoma.Node.Storage.Ordering
With this, we have a very slow way of effectively slowly snapshotting
the database.

Very slow, someone should do a better method than what I'm doing here
@juped juped merged commit f30d183 into base Jan 5, 2024
2 checks passed
@mariari mariari deleted the mariari/snapshot branch July 20, 2024 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants