qdrant / qdrant/qdrant-client

Indeterministic lock results

Open
#626 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
304
Avg merge
2d 9h
Merged PRs (30d)
37

Description

I'm looking for a way to prevent new writes to Qdrant DB and trying to utilize "/locks" endpoint to achieve it, but it doesn't work as expected.

# test DB lock

from qdrant_client.http.models.models import PointStruct, PointIdsList, Filter, FieldCondition, MatchValue

COLLECTION = "my-test-collection"

lock = client.lock_storage(reason="DB is locked")
print(lock)

# upload test point
uploaded_points = client.upload_points(collection_name=COLLECTION, points=[PointStruct(id="4009805e-90f5-445e-953e-62fd7222e68c", payload={"project_id": "test"}, vector=[])])
print("upload point response: ", uploaded_points)

# search for the point
response = client.scroll(
                collection_name=COLLECTION_ALIAS,
                scroll_filter=Filter(
                    must=[
                        FieldCondition(
                            key='project_id',
                            match=MatchValue(
                                value="test"
                            )
                        )
                    ]
                )
            )
print("scroll point response: ", response)

# delete the point
deleted_points = client.delete(collection_name=COLLECTION, points_selector=PointIdsList(points=["4009805e-90f5-445e-953e-62fd7222e68c"]))
print("delete point response: ", deleted_points)

The console output:

WARNING:root:Batch upload failed 1 times. Retrying...
upload point response:  None
scroll point response:  ([Record(id='4009805e-90f5-445e-953e-62fd7222e68c', payload={'project_id': 'test'}, vector=None, shard_key=None)], None)
delete point response:  operation_id=71316 status=<UpdateStatus.COMPLETED: 'completed'>

Running the above code doesn't stop me from performing new writes to the DB, however when the lock is executed multiple times, then it locks the DB successfully. It seems like it takes multiple calls to "lock" and "unlock" methods to make it work.

I'm running above against Qdrant cloud instance.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example against a Qdrant Cloud instance, starting with the client.lock_storage("DB is locked") call and the subsequent upload_points, scroll, and delete operations. Compare behavior across repeated lock and unlock calls and check the /locks endpoint responses. Done means the lock behavior is consistent and prevents the reported writes while locked.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.