milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
29.56k stars 2.83k forks source link

[Bug]: deletion problem #35491

Open zs856 opened 1 month ago

zs856 commented 1 month ago

Is there an existing issue for this?

Environment

- Milvus version: 2.4.8
- Deployment mode(standalone or cluster): standalone 
- MQ type(rocksmq, pulsar or kafka):    None
- SDK version(e.g. pymilvus v2.0.0rc2): pymilvus 2.4.5
- OS(Ubuntu or CentOS): Ubuntu 22.04
- CPU/Memory: 32GB
- GPU: None
- Others:

Current Behavior

Today, while I was following the official documentation to practice the deletion operation, I found that the data was not successfully deleted. You can check the uploaded .ipynb file to see the code I ran. The development environment can also be reproduced using pyproject.toml and Docker Compose.

milvus-deletion-bug.zip

Expected Behavior

I expect the data in the Collection to be successfully deleted as it is executed in the code of the official documentation.

Steps To Reproduce

1. Deploy milvus using the docker compose file I provided
2. Set up development environment using the pyproject (1).toml I provided
3. Run the code inside 删除bug.ipynb

Milvus Log

No response

Anything else?

No response

XuanYang-cn commented 1 month ago

@zs856 Hi, thx for the detailed bug report and reproducable codes. I noticed that you're usingclient.get_collection_stats(collection_name='quick_setup') to verify correcteness of deletion. Accually get_collection_stats are neither realtime nor accurate, espcially for deletions.

Please try to use query(count(*)), or query() those deleted pks with strong consistency level. See https://milvus.io/docs/get-and-scalar-query.md#Use-Advanced-Operators

client.query(...., output_fields=["count(*)"], consistency_level="Strong")
yanliang567 commented 1 month ago

/assign @zs856 /unassign

stale[bot] commented 3 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.