-
Notifications
You must be signed in to change notification settings - Fork 111
[storage] Introduce store
#1327
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
Conversation
👀 👀 👀 |
e742649
to
0022902
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original ambition with this issue (#1206) was to actually create a totally unrelated implementation to adb
(with variable-sized operations)...something like archive
but "mutable" (and where each key wasn't associated with some "index").
This PR has made me second guess that original effort given how straightforward your abstraction seems to integrate into the adb
s (especially because it is a "known useful" pattern rather than just something I thought may be useful).
The code you've provided looks pretty solid (I just left comments primarily around how it is presented).
Thanks for putting this up! We'll get back to you tomorrow with direction on what route we prefer 👍
If decoupled from ADB, we don't need to support by-index lookups, and could therefore support variable length items without the additional log structure used by adb::immutable. I'm leaning towards keeping this "non authenticated" store independent of ADB and giving it variable-length record capability to make it more flexible? |
Agreed. Let's keep store as a standalone thing for now (at least until we get further along the adb optimization path). We should support variable length as well (you can look at |
Sounds good - thanks y'all 😄 I should have some time mid-week to revisit. |
Rewrote + simplified the store - now allows for variable-length values and is more separate from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your "historical functionality" introduced some unintended behavior (based on a smal misunderstanding of how Index
works).
If you revert those, I think it should be pretty close!
Adding some sort of historical query pattern is an interesting idea (and as you are likely well-aware is commonly used to power archive state stores these days) but have typically found that to require some sort of "range query" functionality that isn't present in any of our DBs (so far 😉 ).
Thanks @patrick-ogrady - good catch! I fooled myself on the underlying behavior of
The code for the historical retrieval + allowing the index to expand with the number of ops was added in 5be4491, and prior to that change (a3a3e55), the store does handle conflicts within the cursor correctly (as suggested in #1327 (comment).) The downside to that version is that it does not support a form of pruning inactive operations in the log, which I attempted to give purpose to in 5be4491 by adding the option to access historical values that the key has taken on. Would you prefer to keep it simple, and just revert to a3a3e55, or is there more functionality you'd like to see here (i.e. pruning)? |
👍
Like with monorepo/storage/src/adb/any/mod.rs Lines 744 to 793 in 65ee8a7
You may definitely feel you are duplicating a good bit of logic and (as discussed previously) I'm ok with that for this early phase. We are planning to do a "deduplication effort" once the core storage primitives are complete (and prefer keeping them un-entangled for faster experimentation). Hope that helps! |
Reverted the changes in 5be4491, and added pruning logic to the |
71ac6a6
to
aa42c41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added deletion support + fixed an issue with conflicting keys in the snapshot building process, one last todo.
Introduces a new module in `commonware-storage` that provides an unauthenticated key-value store, supporting variable-sized values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~5 minutes away from merge!
🚀 🚀 🚀 |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1327 +/- ##
==========================================
+ Coverage 91.24% 91.32% +0.08%
==========================================
Files 262 265 +3
Lines 65310 66018 +708
==========================================
+ Hits 59590 60291 +701
- Misses 5720 5727 +7
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Overview
Introduces a new
store
module that contains a simple, unauthenticatedStore
K/V DB.closes #1206