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

[Bug]: wrong operate to drop collection/database etc. with prefix in snapshot #33288

Closed
1 task done
smellthemoon opened this issue May 22, 2024 · 11 comments
Closed
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@smellthemoon
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Environment

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

Current Behavior

image image DropDatabase has already passed the dbID, remove with prefix in snapshot may remove another db which has the same prefix. In the case that it is not easy to have the same prefix (such as collectionID), load will also have better performance.

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

@smellthemoon smellthemoon added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 22, 2024
@smellthemoon
Copy link
Contributor Author

/assign

@yanliang567 yanliang567 added this to the 2.4.2 milestone May 23, 2024
@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 23, 2024
@yanliang567
Copy link
Contributor

/unassign

@xiaofan-luan
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Environment

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

Current Behavior

image image DropDatabase has already passed the dbID, remove with prefix in snapshot may remove another db which has the same prefix. In the case that it is not easy to have the same prefix (such as collectionID), load will also have better performance.

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

is there a spliter for the key?
for example, we can remove db/ instead db.
if we concat the key with some delimiter, this is the fast way to fix

@smellthemoon
Copy link
Contributor Author

Is there an existing issue for this?

  • I have searched the existing issues

Environment

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

Current Behavior

image image DropDatabase has already passed the dbID, remove with prefix in snapshot may remove another db which has the same prefix. In the case that it is not easy to have the same prefix (such as collectionID), load will also have better performance.

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

is there a spliter for the key? for example, we can remove db/ instead db. if we concat the key with some delimiter, this is the fast way to fix

But in fact, the key removed here is the key itself, not the prefix of the key. For example, when creating database, the key root-coord/database/db-info/dbid will be saved. When dropping database, pass in root-coord/database/db-info/dbid as the prefix. If has the same prefixes, will cause other db to be removed too.
multiSaveAndRmove seems more appropriate.

@xiaofan-luan
Copy link
Contributor

can you give an example?

@xiaofan-luan
Copy link
Contributor

don't quite understand about this part

@smellthemoon
Copy link
Contributor Author

don't quite understand about this part

For example, you create 11 databases. The id of databases is 0-10. RootCoord will save the key "root-coord/database/db-info/dbID" in snapshot.
if you want to drop database(id =1), RootCoord will remove it by writing tombstone. the prefix here is "root-coord/database/db-info/1". snapshot will list all the keys with the prefix, and then save it. So in this case, dbID 10 will be listed for having the same prefix and will be written tombstone.

@xiaofan-luan
Copy link
Contributor

the easiest fix is to always drop root-coord/database/db-info/1/ ?

@smellthemoon
Copy link
Contributor Author

the easiest fix is to always drop root-coord/database/db-info/1/ ?

The keys now do not contain delimiters at the end, may bring some compatibility issues.

@xiaofan-luan
Copy link
Contributor

so we just want to delete 1 key?

@smellthemoon
Copy link
Contributor Author

so we just want to delete 1 key?

yes, from the code, it actually just want to delete 1 key, I have added the MultiSaveAndRemove in the snapshot interface.

@yanliang567 yanliang567 modified the milestones: 2.4.2, 2.4.3, 2.4.4 May 24, 2024
sre-ci-robot pushed a commit that referenced this issue May 31, 2024
…#33328)

#33288

---------

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
@yanliang567 yanliang567 modified the milestones: 2.4.4, 2.4.5 Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants