Skip to content

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

@WMMMD

Description

@WMMMD

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

No one assigned

    Labels

    Featurenew functionality including changes to functionality and code refactors, etc.needs-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions