Intermittent errors creating a collection

Aperta
#187 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
database

Direzione di ricerca

Inizia con la riproduzione in main.rs e con la versione di qdrant-client in Cargo.toml; esegui la sequenza di creazione/eliminazione della collection con shard_number impostato su 4, quindi confrontala con 2. Esamina le risposte del client e lo stato risultante di qdrant_storage/MY_COLLECTION. Il lavoro è completato quando il timeout dipendente dallo shard e il comportamento della collection obsoleta sono spiegati ed è disponibile un fix verificato o una riproduzione documentata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi, I am getting intermittent, inconsistent errors creating a collection. Any insight or assistance appreciated. Thank you in advance for your assistance!

Update: The issue seems to go away when I change the shard number from 4 to 2.

Issues

When I first run the below script, when the collection does not exist, I get Error: Error in the response: The operation was cancelled Timeout expired. Despite that, the qdrant_storage/MY_COLLECTION folder exists, and it shows up in the dashboard.

When I run it again, I get

collection exists, deleting...
Error: Error in the response: The operation was cancelled Timeout expired

I have also encountered issues where the client does not think the collection exists (so does not try deleting it), but when it tries to create it, I get errors like

Error in the response: Client specified an invalid argument Wrong input: Can't create collection with name MY_COLLECTION. Collection data already exists at ./storage/collections/MY_COLLECTION

Sometimes, it works fine, but it's unclear what conditions lead to success.

Code

main.rs
use anyhow::{Context, Result};
use qdrant_client::qdrant::{
    CreateCollectionBuilder, Datatype, Distance, OptimizersConfigDiffBuilder, VectorParamsBuilder,
};
use qdrant_client::Qdrant;

const QDRANT_CONNECTION_URL: &str = "http://localhost:6334";

#[tokio::main]
async fn main() -> Result<()> {
    let client = Qdrant::from_url(QDRANT_CONNECTION_URL)
        .build()
        .context("Failed to build Qdrant Client")?;
    create_collection(&client, "MY_COLLECTION").await?;
    Ok(())
}

pub async fn create_collection(client: &Qdrant, name: &str) -> Result<()> {
    if client.collection_exists(name).await? {
        println!("collection exists, deleting...");
        client.delete_collection(name).await?;
    }

    client
        .create_collection(
            CreateCollectionBuilder::new(name)
                .vectors_config(
                    VectorParamsBuilder::new(1280, Distance::Cosine)
                        .datatype(Datatype::Float16)
                        .on_disk(true),
                )
                .optimizers_config(OptimizersConfigDiffBuilder::default().indexing_threshold(0))
                .shard_number(4),
        )
        .await?;

    Ok(())
}
Cargo.toml
[package]
name = "upload-issue"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.83"
qdrant-client = "1.11.2"
tokio = { version = "1.37.0", features = ["rt-multi-thread"] }
Lingua principale
Rust
Stelle
425
Fork
89
Merge medio
2h 48m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di qdrant/rust-client

Tutte le issue di qdrant/rust-client

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.