Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indeterministic lock results #626

Open
donwitobanana opened this issue May 14, 2024 · 1 comment
Open

Indeterministic lock results #626

donwitobanana opened this issue May 14, 2024 · 1 comment

Comments

@donwitobanana
Copy link

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.

@generall
Copy link
Member

I don't think locks functionality have actual usage. It is likely that we are going to deprecate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants