-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
Featurenew functionality including changes to functionality and code refactors, etc.new functionality including changes to functionality and code refactors, etc.needs-triage
Description
Background
- Single-master architecture
- 7w minions (due to business architecture, no other high availability architecture is used)
Problems
When submitting a minion for deletion, it takes 98s to delete a minion, and we found that the problem lies in the check_minion_cache called under the delete_key function in key.py, where if minion not in minions and minion not in If minion not in minions and minion not in minions take a particularly long time, the query problem should be a list traversal problem.
Solution:
Change list to set
Before
if minion not in minions and minion not in preserve_minions:
After modification
minions_set = set(minions)
preserve_minions_set = set(preserve_minions)
if minion not in minions_set and minion not in preserve_minions_set:
In our usage scenario, deleting a server was reduced from 98 seconds to 0.5 seconds, and the query deletion actually took effect.
Metadata
Metadata
Assignees
Labels
Featurenew functionality including changes to functionality and code refactors, etc.new functionality including changes to functionality and code refactors, etc.needs-triage