Skip to content

ebi-state: persistent database and service rework#15

Merged
yamabiiko merged 13 commits intomasterfrom
redb-database
Dec 23, 2025
Merged

ebi-state: persistent database and service rework#15
yamabiiko merged 13 commits intomasterfrom
redb-database

Conversation

@yamabiiko
Copy link
Copy Markdown
Member

  • Implement database persistent for state modification through State service and full loading from a saved redb instance through full_load
  • ebi-database crate rename into ebi-state and related renames
  • rework StateChain: add committed and received operations CRDT stub, rename hist to synced
  • initial config stub

nerla-alessandro and others added 13 commits December 13, 2025 15:03
- implement `Storable` for `Shelf, Workspace` in `ebi-types`
- wrap `ChaCha12Rng` into crate-owned `SeededChacha12Rng` in
  `ebi-filesystem`
- move redb logic of `ebi-database` into own module
- redefine `StatefulRef` as `Inner<ArcSwap<T>, I>` implementing `Ref` trait
- remove `RwLock` and inner state update execution in `stateful_rcu`, now
  return the to be executed state update `Future` instead
- rename `StateService` to `StateDatabase`
- now service API can be scoped to workspace by calling
  `state_db.workspace(id).workspace_related_call(...)`
- move `EditShelf`, `EditWorkspace`, `CreateTag` and `DeleteTag`
  workspace-related logic inside `StateDatabase`
- rename `ResponseMetada` to `Status` in `ebi-proto`
- add new `MessageType` variant: `ResponseError`
- return `Status` from `RpcService` instead of unit () error, making
  error handling cleaner
- create and update entries to persisent redb database according to
  `StateDatabase` service calls
- implement `full_load` for `StateDatabase`, which tries to load
  a stored database reconstructing references from `Storable` types

- add test for db loading correctness `save_restore_db`
…estore_db` test

- add `sync_state` handling commiting a staged state of the history for `StateDatabase`
- `PartialEq` impls for info fields in `ebi-types`
- expand `save_restore_db` test to check for post state-sync correctness
- tests for creating/deleting tags
- tests for creating/deleting workspaces
- tests for assigning/unassgning shelves
- rename `ebi-database` to `ebi-state`
- rename `History` to `StateChain`
- rename `GroupState` to `StateView`
- rename `StateDatabase` to `State`
- rename `ScopedDatabase` to `WorkspaceState`
- change `synced` to `commited/received` in `StateChain`
- rename `hist` to `confirmed` in `StateChain`
@yamabiiko yamabiiko merged commit 022139d into master Dec 23, 2025
3 checks passed
@yamabiiko yamabiiko deleted the redb-database branch December 23, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants