saltstack / saltstack/salt

MasterMinion calculates master grains on every usage

Open
#55,067 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Confirmed severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description of Issue

High CPU on Salt Master and slow minion responses caused by an extreme number of commands being run on the master. Tracking this down we see that MasterMinion calculates grains when instantiated, however it does not calculate the minions grains - it calculates the master’s grains, and the results are uncashed and unused (grains_cache defaults to false and the grains I cannot find references anywhere)

When setting up the MasterMinion pillar calculation is disabled and it seems grains should be too

Setup

Salt Master using GifFS and GitPillar
10 Minions

Steps to Reproduce Issue

Running salt asterisk test.ping takes about a minute
After disabling the grains in MasterMinion it takes seconds

Versions Report

2019.2.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the MasterMinion initialization described in the issue and inspect how grains are calculated when pillar calculation is disabled. Reproduce the behavior with salt '*' test.ping, then verify that master grains are no longer calculated unnecessarily and that the command returns in seconds rather than about a minute.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.