From f6cbeb1a1c779d6604861458cfeb0923282f7b51 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:29:13 +0200 Subject: [PATCH] fix: files added to a knowledge base on Qdrant can end up with only part of their content (#31961) On Qdrant, uploading a file into a knowledge base or editing a file's content could leave the knowledge base with only part of the file, often exactly 64 chunks, while the file showed as completed and nothing was logged. The file's chunks were saved without waiting for Qdrant to make them searchable, and the knowledge base copied them straight after, so it only got the ones Qdrant had finished storing. Saving now waits until Qdrant has finished storing the chunks, so the knowledge base always gets the whole file. On a busy Qdrant this makes file processing somewhat slower, since each save now waits for the server. Fixes #31959 --- backend/open_webui/retrieval/vector/dbs/qdrant.py | 2 +- backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/retrieval/vector/dbs/qdrant.py b/backend/open_webui/retrieval/vector/dbs/qdrant.py index d1b302b34f..9ce432f86e 100644 --- a/backend/open_webui/retrieval/vector/dbs/qdrant.py +++ b/backend/open_webui/retrieval/vector/dbs/qdrant.py @@ -220,7 +220,7 @@ class QdrantClient(VectorDBBase): # Insert the items into the collection, if the collection does not exist, it will be created. self._create_collection_if_not_exists(collection_name, len(items[0]['vector'])) points = self._create_points(items) - self.client.upload_points(f'{self.collection_prefix}_{collection_name}', points) + self.client.upload_points(f'{self.collection_prefix}_{collection_name}', points, wait=True) def upsert(self, collection_name: str, items: list[VectorItem]): # Update the items in the collection, if the items are not present, insert them. If the collection does not exist, it will be created. diff --git a/backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py b/backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py index 6bf71717e2..bf2968dc99 100644 --- a/backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py +++ b/backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py @@ -332,7 +332,7 @@ class QdrantClient(VectorDBBase): dimension = len(items[0]['vector']) self._ensure_collection(mt_collection, dimension) points = self._create_points(items, tenant_id) - self.client.upload_points(mt_collection, points) + self.client.upload_points(mt_collection, points, wait=True) return None def insert(self, collection_name: str, items: List[VectorItem]):