diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-12 12:10:33 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-12 12:10:33 +0200 |
commit | 419c70e50613faf5b450b9555aec32cb19226153 (patch) | |
tree | ea12fd902d50e5cb5dd5ffd544a7bc816866c134 /src/api_server.rs | |
parent | 9c931f5edacbaaab746ecf180fac2dd7062d0336 (diff) | |
download | garage-419c70e50613faf5b450b9555aec32cb19226153.tar.gz garage-419c70e50613faf5b450b9555aec32cb19226153.zip |
fixes
- make block_put call uninterruptible by client
- used meta_replication_factor instead of data_replication_factor
- listen on ipv6
Diffstat (limited to 'src/api_server.rs')
-rw-r--r-- | src/api_server.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api_server.rs b/src/api_server.rs index 52f33969..13fd5038 100644 --- a/src/api_server.rs +++ b/src/api_server.rs @@ -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[..], |