Intermittent errors creating a collection
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with the reproduction in main.rs and the qdrant-client version in Cargo.toml; run the collection create/delete sequence with shard_number set to 4, then compare it with 2. Inspect the client responses and resulting qdrant_storage/MY_COLLECTION state. Done means the shard-dependent timeout and stale collection behavior are explained and a verified fix or documented reproduction is available.
Written by the indexing model from the issue text.
Description
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"] }
- Dominant language
- Rust
- Stars
- 425
- Forks
- 89
- Avg merge
- 2h 48m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qdrant/rust-client
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
qdrant/rust-client#320 ·
-
upsert_points deep-clones the whole request on every call, not only on retryMay be free again @NullSense claimed this 7 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
qdrant/rust-client#316 · 3 comments ·
-
Option to set TLS domain name and :authority origin (client behind a tunnel/proxy)May be free again @inamdarmihir claimed this 37 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
qdrant/rust-client#306 · 1 comment ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 38/100
qdrant/rust-client#289 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
qdrant/rust-client#272 · 2 reactions ·
All issues in qdrant/rust-client
Similar issues
-
autofix:working
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
libracoder/kiri#1138 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
roc-lang/basic-webserver#277 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
samkerrcode/opengent#113 ·
Maintainers usually reply within 1 day
-
app bug session
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day