Scale-out storage: sharded blob, in-memory and lookup stores; configured read replicas reported (ST-1 to ST-4, ST-16 to ST-30)
A Sharded blob store places each blob on xxh3(key) mod N, over the whole key; reads fall back to the other members, so blobs placed under an earlier member list stay readable, and deletes find them wherever they are. The member list is recorded in the data store (secrets left out): added or reordered members are a warning, a missing one refuses to open. Blobs are compressed and marked before they reach a member. A Sharded in-memory or lookup store sends each key to its home Redis member, and prefix deletes and purges to all; a node whose member list differs from the recorded one logs an error and runs on. Members are checked for duplicates and must all open. Until read-replica routing is built, each configured replica is reported at startup instead of being silently ignored, and nothing connects to it. The new scaleout_blob_tests covers tests 2 to 7, and the existing blob suite passes against three FileSystem members (BLOB_STORE=Sharded).
This commit is contained in:
@@ -39,6 +39,20 @@ impl BlobStore {
|
||||
structs::BlobStore::FileSystem(file_system_store) => {
|
||||
FsStore::open(file_system_store).await
|
||||
}
|
||||
// inbuxa: ST-16 to ST-22
|
||||
structs::BlobStore::Sharded(sharded) => {
|
||||
let mut warnings = Vec::new();
|
||||
let result = crate::backend::scaleout::ShardedBlobStore::open(
|
||||
sharded,
|
||||
&bp.data_store,
|
||||
&mut warnings,
|
||||
)
|
||||
.await;
|
||||
for warning in warnings {
|
||||
bp.build_warning(ObjectType::BlobStore.singleton(), warning);
|
||||
}
|
||||
result
|
||||
}
|
||||
_ => Err("Binary was not compiled with the selected blob store backend".to_string()),
|
||||
};
|
||||
|
||||
|
||||
@@ -49,6 +49,21 @@ impl LookupStores {
|
||||
LookupStore::RedisCluster(redis_cluster_store) => {
|
||||
crate::backend::redis::RedisStore::open_cluster(redis_cluster_store).await
|
||||
}
|
||||
// inbuxa: ST-28
|
||||
LookupStore::Sharded(sharded) => {
|
||||
let mut warnings = Vec::new();
|
||||
let result = crate::backend::scaleout::ShardedInMemoryStore::open(
|
||||
sharded,
|
||||
store.namespace.as_str(),
|
||||
&bp.data_store,
|
||||
&mut warnings,
|
||||
)
|
||||
.await;
|
||||
for warning in warnings {
|
||||
bp.build_warning(id, warning);
|
||||
}
|
||||
result
|
||||
}
|
||||
_ => Err(
|
||||
"Binary was not compiled with the selected lookup store backend".to_string(),
|
||||
),
|
||||
|
||||
@@ -26,6 +26,21 @@ impl InMemoryStore {
|
||||
structs::InMemoryStore::RedisSentinel(redis_sentinel_store) => {
|
||||
crate::backend::redis::RedisStore::open_sentinel(redis_sentinel_store).await
|
||||
}
|
||||
// inbuxa: ST-23 to ST-29
|
||||
structs::InMemoryStore::Sharded(sharded) => {
|
||||
let mut warnings = Vec::new();
|
||||
let result = crate::backend::scaleout::ShardedInMemoryStore::open(
|
||||
sharded,
|
||||
"",
|
||||
&bp.data_store,
|
||||
&mut warnings,
|
||||
)
|
||||
.await;
|
||||
for warning in warnings {
|
||||
bp.build_warning(ObjectType::InMemoryStore.singleton(), warning);
|
||||
}
|
||||
result
|
||||
}
|
||||
_ => Err("Binary was not compiled with the selected in-memory backend".to_string()),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user