-
Notifications
You must be signed in to change notification settings - Fork 111
[storage] Introduce ordinal
+ Ensure destroy()
Deletes Entire Partition
#1173
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
ordinal
ordinal
+ Ensure destroy()
Deletes Entire Partition
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.
Pull Request Overview
This PR introduces a new ordinal
storage engine for sparse, fixed‐size records and updates existing storage modules so that calling destroy()
removes the entire partition. It also adds benchmark support for the new engine.
- Add
ordinal
module with anOrdinal
type supporting put/get/has/prune/sync/close/destroy - Ensure
destroy()
removes the entire partition inordinal
,metadata
, and bothjournal
implementations - Wire up benchmarks for
ordinal
inCargo.toml
and add bench code understorage/src/ordinal/benches
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
storage/src/ordinal/storage.rs | New Ordinal implementation with full lifecycle and partition destroy |
storage/src/ordinal/mod.rs | Module docs, type exports, config and error definitions |
storage/src/ordinal/benches/utils.rs | Benchmark helpers for ordinal |
storage/src/ordinal/benches/restart.rs | Restart benchmark |
storage/src/ordinal/benches/put.rs | Put benchmark |
storage/src/ordinal/benches/get.rs | Get benchmark |
storage/src/ordinal/benches/bench.rs | Criterion runner setup |
storage/src/metadata/storage.rs | Added partition-wide remove in metadata's destroy |
storage/src/journal/variable.rs | Added partition-wide remove in variable-journal's destroy |
storage/src/journal/fixed.rs | Added partition-wide remove in fixed-journal's destroy |
storage/src/lib.rs | Exposed new ordinal module |
storage/Cargo.toml | Registered ordinal benchmarks |
Comments suppressed due to low confidence (3)
storage/src/ordinal/mod.rs:80
- The example calls the async
put
method without.await
. Update tostore.put(0, value1).await.unwrap();
(and similarly for the otherput
calls) so the snippet compiles correctly.
//! store.put(0, value1).unwrap();
storage/src/journal/variable.rs:682
- The code references
RError
but there’s nouse commonware_runtime::Error as RError;
import in this file, causing a compilation error. Please add the import alongside othercommonware_runtime
imports.
Err(RError::PartitionMissing(_)) => {
storage/src/journal/fixed.rs:520
- This block uses
RError::PartitionMissing
but the aliasRError
isn’t imported here. Adduse commonware_runtime::Error as RError;
with the other imports.
match self.context.remove(&self.cfg.partition, None).await {
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #1173 +/- ##
==========================================
+ Coverage 91.28% 91.40% +0.11%
==========================================
Files 216 218 +2
Lines 58364 59510 +1146
==========================================
+ Hits 53278 54393 +1115
- Misses 5086 5117 +31
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Related: #1135
Changes
sync