Qdrant MemoryStore delete collection does not perform delete operation
Describe the bug Qdrant MemoryStore Delete collection does not perform a delete operation
The implementation code in the repo performs delete if the collection does not exists, instead you need to delete only if the collection exists.
public async Task DeleteCollectionAsync(string collectionName, CancellationToken cancellationToken = default) { if (!await this._qdrantClient.DoesCollectionExistAsync(collectionName, cancellationToken).ConfigureAwait(false)) { await this._qdrantClient.DeleteCollectionAsync(collectionName, cancellationToken).ConfigureAwait(false); } }
Instead the correct code should be this (removed ! in if condition) public async Task DeleteCollectionAsync(string collectionName, CancellationToken cancellationToken = default) { if (await this._qdrantClient.DoesCollectionExistAsync(collectionName, cancellationToken).ConfigureAwait(false)) { await this._qdrantClient.DeleteCollectionAsync(collectionName, cancellationToken).ConfigureAwait(false); } }
@vtenisc , thanks for bringing this up. We will take a look and see what is going on.
ah... I also found this bug today, which delayed me for half a day
I also found this bug: Public async Task DeleteCollectionAsync(string collectionName, CancellationToken cancellationToken = default) { //if (!await this._qdrantClient.DoesCollectionExistAsync(collectionName, cancellationToken).ConfigureAwait(false)) if (await this._qdrantClient.DoesCollectionExistAsync(collectionName, cancellationToken).ConfigureAwait(false)) { await this._qdrantClient.DeleteCollectionAsync(collectionName, cancellationToken).ConfigureAwait(false); }
I can repro the same with this code sample.
Thank you for the heads up, PR in the queue!
Fixed with https://github.com/microsoft/semantic-kernel/pull/1025. Thanks all for the reports, and @craigomatic for the fix.