- make block_put call uninterruptible by client
- used meta_replication_factor instead of data_replication_factor
- listen on ipv6
This commit is contained in:
Alex Auvolat
2020-04-12 12:10:33 +02:00
parent 9c931f5eda
commit 419c70e506
3 changed files with 27 additions and 11 deletions
+4 -4
View File
@@ -24,7 +24,7 @@ pub async fn run_api_server(
garage: Arc<Garage>,
shutdown_signal: impl Future<Output = ()>,
) -> Result<(), Error> {
let addr = ([0, 0, 0, 0], garage.system.config.api_port).into();
let addr = ([0, 0, 0, 0, 0, 0, 0, 0], garage.system.config.api_port).into();
let service = make_service_fn(|conn: &AddrStream| {
let garage = garage.clone();
@@ -215,12 +215,12 @@ async fn put_block(garage: Arc<Garage>, hash: Hash, data: Vec<u8>) -> Result<(),
.ring
.borrow()
.clone()
.walk_ring(&hash, garage.system.config.meta_replication_factor);
.walk_ring(&hash, garage.system.config.data_replication_factor);
rpc_try_call_many(
garage.system.clone(),
&who[..],
&Message::PutBlock(PutBlockMessage { hash, data }),
(garage.system.config.meta_replication_factor + 1) / 2,
(garage.system.config.data_replication_factor + 1) / 2,
DEFAULT_TIMEOUT,
)
.await?;
@@ -362,7 +362,7 @@ async fn get_block(garage: Arc<Garage>, hash: &Hash) -> Result<Vec<u8>, Error> {
.ring
.borrow()
.clone()
.walk_ring(&hash, garage.system.config.meta_replication_factor);
.walk_ring(&hash, garage.system.config.data_replication_factor);
let resps = rpc_try_call_many(
garage.system.clone(),
&who[..],