{"record":{"id":"df9816736b1a004e","repo":"spring-projects/spring-ai","slug":"failed-to-delete-documents-by-filter-df9816","errorCode":null,"errorMessage":"Failed to delete documents by filter: ","messagePattern":"Failed to delete documents by filter: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"vector-stores/spring-ai-qdrant-store/src/main/java/org/springframework/ai/vectorstore/qdrant/QdrantVectorStore.java","lineNumber":233,"sourceCode":"\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}\n\n\t@Override\n\tprotected void doDelete(org.springframework.ai.vectorstore.filter.Filter.Expression filterExpression) {\n\t\tAssert.notNull(filterExpression, \"Filter expression must not be null\");\n\n\t\ttry {\n\t\t\tFilter filter = this.filterExpressionConverter.convertExpression(filterExpression);\n\n\t\t\tio.qdrant.client.grpc.Points.UpdateResult response = this.qdrantClient\n\t\t\t\t.deleteAsync(this.collectionName, filter)\n\t\t\t\t.get();\n\n\t\t\tif (response.getStatus() != io.qdrant.client.grpc.Points.UpdateStatus.Completed) {\n\t\t\t\tthrow new IllegalStateException(\"Failed to delete documents by filter: \" + response.getStatus());\n\t\t\t}\n\n\t\t\tlogger.debug(\"Deleted documents matching filter expression\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tif (logger.isErrorEnabled()) {\n\t\t\t\tlogger.error(\"Failed to delete documents by filter: \" + e.getMessage(), e);\n\t\t\t}\n\t\t\tthrow new IllegalStateException(\"Failed to delete documents by filter\", e);\n\t\t}\n\t}\n\n\t/**\n\t * Performs a similarity search on the vector store.\n\t * @param request The {@link SearchRequest} object containing the query and other\n\t * search parameters.\n\t * @return A list of documents that are similar to the query.\n\t */","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/vector-stores/spring-ai-qdrant-store/src/main/java/org/springframework/ai/vectorstore/qdrant/QdrantVectorStore.java#L215-L251","documentation":"QdrantVectorStore.doDelete issues an async point-delete by filter and requires the returned UpdateResult status to be Completed. If Qdrant reports any other status (e.g. Acknowledged or a failure state), the store throws IllegalStateException 'Failed to delete documents by filter: <status>' because the deletion cannot be confirmed as fully applied.","triggerScenarios":"Calling vectorStore.delete(Filter.expression...) where qdrantClient.deleteAsync(...).get() returns an UpdateResult whose status != UpdateStatus.Completed, e.g. the node acknowledged but did not complete the operation.","commonSituations":"Qdrant cluster degraded/unavailable replicas; collection in a bad state; large filter deletions timing out on write consistency.","solutions":["Check Qdrant server logs and cluster health for why the delete did not complete","Retry the delete call after verifying the collection is writable","Verify the collection name and that the filter targets existing points","Pin/upgrade Qdrant server version if a status regression is involved"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { vectorStore.delete(filterExpr); } catch (IllegalStateException e) { logger.warn(\"Delete incomplete: {}\", e.getMessage()); /* retry with backoff, then check server health */ }","preventionTips":["Monitor Qdrant cluster health before bulk deletions","Keep collection writes enabled (no read-only/backup mode)","Verify status via Qdrant API if delete results are critical"],"tags":["qdrant","delete","vector-store","consistency","spring-ai"],"backgroundTag":"database-write-failed","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}