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

Implement simple durable Raft storage based on RocksDB #1825

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 204 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions crates/metadata-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ restate-rocksdb = { workspace = true }
restate-types = { workspace = true }

anyhow = { workspace = true }
assert2 = { workspace = true }
async-trait = { workspace = true }
bytes = { workspace = true }
bytestring = { workspace = true }
Expand All @@ -29,9 +30,12 @@ hyper = { workspace = true }
hyper-util = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
protobuf = "2.28.0"
raft = { version = "0.7.0" }
rocksdb = { workspace = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true }
slog = { version = "2.7.0" }
static_assertions = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
Expand All @@ -43,6 +47,8 @@ tonic-health = { workspace = true }
tower = { workspace = true }
tower-http = { workspace = true, features = ["trace"] }
tracing = { workspace = true }
tracing-slog = { version = "0.3.0" }
ulid = { workspace = true, features = ["serde"] }

[dev-dependencies]
restate-core = { workspace = true, features = ["test-util"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ use restate_core::network::net_util::create_tonic_channel_from_advertised_addres
use restate_types::net::AdvertisedAddress;
use restate_types::Version;

use crate::grpc::pb_conversions::ConversionError;
use crate::grpc_svc::metadata_store_svc_client::MetadataStoreSvcClient;
use crate::grpc_svc::{DeleteRequest, GetRequest, PutRequest};
use crate::local::grpc::pb_conversions::ConversionError;

/// Client end to interact with the [`LocalMetadataStore`].
/// Client end to interact with the metadata store.
#[derive(Debug, Clone)]
pub struct LocalMetadataStoreClient {
pub struct GrpcMetadataStoreClient {
svc_client: MetadataStoreSvcClient<Channel>,
}
impl LocalMetadataStoreClient {
impl GrpcMetadataStoreClient {
pub fn new(metadata_store_address: AdvertisedAddress) -> Self {
let channel = create_tonic_channel_from_advertised_address(metadata_store_address)
.expect("should not fail");
Expand All @@ -41,7 +41,7 @@ impl LocalMetadataStoreClient {
}

#[async_trait]
impl MetadataStore for LocalMetadataStoreClient {
impl MetadataStore for GrpcMetadataStoreClient {
async fn get(&self, key: ByteString) -> Result<Option<VersionedValue>, ReadError> {
let response = self
.svc_client
Expand Down
Loading
Loading