Intermittent errors creating a collection

オープン
#187 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
rust
領域
database

調査の方向性

main.rs の再現手順と Cargo.toml の qdrant-client のバージョンから始めます。shard_number を 4 に設定して collection の作成/削除シーケンスを実行し、その後 2 の場合と比較します。クライアントのレスポンスと、結果としての qdrant_storage/MY_COLLECTION の状態を調査します。shard に依存するタイムアウトと古い collection の挙動が説明され、検証済みの fix または文書化された再現手順が利用可能になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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"] }
主要言語
Rust
スター
425
フォーク
89
平均マージ
2時間 48分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

qdrant/rust-client のほかの issue

qdrant/rust-client の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。