You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 lockfromqdrant_client.http.models.modelsimportPointStruct, PointIdsList, Filter, FieldCondition, MatchValueCOLLECTION="my-test-collection"lock=client.lock_storage(reason="DB is locked")
print(lock)
# upload test pointuploaded_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 pointresponse=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 pointdeleted_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.
The text was updated successfully, but these errors were encountered:
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.
The console output:
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.
The text was updated successfully, but these errors were encountered: