feat: core domain types and rocksdb storage layer#3
Merged
vieiralucas merged 4 commits intomainfrom Feb 11, 2026
Merged
Conversation
There was a problem hiding this comment.
1 issue found across 13 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="crates/fila-core/src/storage/keys.rs">
<violation number="1" location="crates/fila-core/src/storage/keys.rs:16">
P1: Unsafe truncating cast `s.len() as u16` — strings longer than 65535 bytes silently produce a corrupted length prefix, leading to key collisions and data corruption. Use `u16::try_from(s.len()).expect("queue/fairness key exceeds 64 KiB")` (or return a `Result`) to fail loudly instead of silently corrupting keys.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
6 tasks
vieiralucas
commented
Feb 11, 2026
d9f7556 to
f4d3033
Compare
5c62cd7 to
b468d09
Compare
f4d3033 to
490ef1c
Compare
add error types (FilaError with thiserror), message and queue domain types with serde support, binary key encoding for lexicographic ordering, storage trait abstraction, and rocksdb implementation with 5 column families and atomic write batch support.
replace `s.len() as u16` with `u16::try_from().expect()` to panic loudly instead of silently truncating strings longer than 64 KiB.
storage operations now return StorageResult<T> with only infrastructure errors (rocksdb, serialization). domain errors (queue not found, etc.) are scoped to FilaError at the broker/application layer.
per-command error types will be introduced as each command is added
a6cdccc to
899b27b
Compare
vieiralucas
added a commit
that referenced
this pull request
Mar 18, 2026
- apply_to_broker_storage now returns Result and propagates StorageError instead of silently swallowing storage failures (cubic #1) - add DeleteLeaseExpiry mutation in ack/nack replication paths to clean up orphaned lease expiry entries (cubic #3) - fix no-op leased_msg_keys.retain in recovery — now properly clears entries for the recovering queue before rebuild (cubic #4) - warn when create_group is called without broker_storage set (cubic #5) - check send_command result in watch_leader_changes — only update leading state on success so next poll retries on failure (cubic #6, #7) - trigger RecoverQueue on first-sight leader state to catch messages replicated between startup and first poll (cubic #8) - replace catch-all _ => {} with explicit variant listing in apply_to_broker_storage for compiler-enforced exhaustiveness
vieiralucas
added a commit
that referenced
this pull request
Mar 18, 2026
- apply_to_broker_storage now returns Result and propagates StorageError instead of silently swallowing storage failures (cubic #1) - add DeleteLeaseExpiry mutation in ack/nack replication paths to clean up orphaned lease expiry entries (cubic #3) - fix no-op leased_msg_keys.retain in recovery — now properly clears entries for the recovering queue before rebuild (cubic #4) - warn when create_group is called without broker_storage set (cubic #5) - check send_command result in watch_leader_changes — only update leading state on success so next poll retries on failure (cubic #6, #7) - trigger RecoverQueue on first-sight leader state to catch messages replicated between startup and first poll (cubic #8) - replace catch-all _ => {} with explicit variant listing in apply_to_broker_storage for compiler-enforced exhaustiveness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FilaError(withthiserror),Message, andQueueConfigwith serde serializationstorage::keys) with big-endian numerics and length-prefixed strings for correct lexicographic ordering in RocksDBStoragetrait abstraction withWriteBatchOpfor atomic multi-CF operationsRocksDbStoragewith 5 column families (messages, leases, lease_expiry, queues, state)Test plan
cargo clippy -- -D warningspassescargo fmt --checkpassescargo nextest runSummary by cubic
Adds core domain types and a RocksDB storage layer with atomic batches and lexicographic key encoding for durable, ordered message persistence. Implements Story 1.3 requirements for queues, messages, leases, and expiry scans.
New Features
Bug Fixes
Written for commit 899b27b. Summary will update on new commits.