Skip to content

[FEATURE REQUEST] The premise of a large number of servers takes too long to delete servers. #67929

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

Open
WMMMD opened this issue Mar 31, 2025 · 1 comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. needs-triage

Comments

@WMMMD
Copy link

WMMMD commented Mar 31, 2025

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.

@WMMMD WMMMD added Feature new functionality including changes to functionality and code refactors, etc. needs-triage labels Mar 31, 2025
Copy link

welcome bot commented Mar 31, 2025

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant