Skip to content

Commit

Permalink
Stop on fail consensus recovery (qdrant#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
agourlay authored and generall committed Feb 6, 2023
1 parent f5924e0 commit 6669f95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl Consensus {
RECOVERY_RETRY_TIMEOUT * (RECOVERY_MAX_RETRY_COUNT - tries) as u32;
sleep(exp_timeout).await;
}
log::error!("Failed to recover from any peer");
return Err(anyhow::anyhow!("Failed to recover from any known peers"));
}

Ok(())
Expand Down
6 changes: 5 additions & 1 deletion tests/consensus_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ def get_cluster_info(peer_api_uri: str) -> dict:

def print_clusters_info(peer_api_uris: [str]):
for uri in peer_api_uris:
print(json.dumps(get_cluster_info(uri), indent=4))
try:
# do not crash if the peer is not online
print(json.dumps(get_cluster_info(uri), indent=4))
except requests.exceptions.ConnectionError:
print(f"Can't retrieve cluster info for offline peer {uri}")


def get_collection_cluster_info(peer_api_uri: str, collection_name: str) -> dict:
Expand Down

0 comments on commit 6669f95

Please sign in to comment.