Skip to content

Commit bd570a4

Browse files
committed
Clarify ClusterClient.put_kv contract
1 parent 78cce69 commit bd570a4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

quickwit/quickwit-search/src/cluster_client.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ impl ClusterClient {
193193

194194
/// Attempts to store a given key value pair within the cluster.
195195
///
196-
/// This function may fail silently, if no clients was available.
196+
/// Tries to replicate the pair to [`TARGET_NUM_REPLICATION`] nodes, but this function may fail
197+
/// silently (e.g if no client was available). Even in case of success, this storage is not
198+
/// persistent. For instance during a rolling upgrade, all replicas will be lost as there is no
199+
/// mechanism to maintain the replication count.
197200
pub async fn put_kv(&self, key: &[u8], payload: &[u8], ttl: Duration) {
198201
let clients: Vec<SearchServiceClient> = self
199202
.search_job_placer
@@ -216,8 +219,8 @@ impl ClusterClient {
216219
// course, this may still result in the replication over more nodes, but this is not
217220
// a problem.
218221
//
219-
// The requests are made in a concurrent manner, up to two at a time. As soon as 2 requests
220-
// are successful, we stop.
222+
// The requests are made in a concurrent manner, up to TARGET_NUM_REPLICATION at a time. As
223+
// soon as TARGET_NUM_REPLICATION requests are successful, we stop.
221224
let put_kv_futs = clients
222225
.into_iter()
223226
.map(|client| replicate_kv_to_one_server(client, key, payload, ttl));

0 commit comments

Comments
 (0)