Skip to content

[BUG] Spurious "random_master is True but there is only one master specified" warning in multi-master mode #69571

Description

@ggiesen

Description

A minion configured for all-hot multi-master (a master: list with the default master_type: str) logs the following warning once per master at every startup:

random_master is True but there is only one master specified. Ignoring.

even though random_master is a valid, documented setting for that configuration.

master: list + random_master: True is a documented combination:

  • The Multi-Master Tutorial describes all-hot multi-master ("all masters are running hot, and any active master can be used to send commands out to the minions"), configured with a master: list.
  • random_master is documented, with a master: list, to shuffle it on startup "to distribute the load of many minions executing salt-call requests, for example, from a cron job."

The warning is intended only for the single-master case, where random_master genuinely has no effect.

Root cause

In multi-master mode, MinionManager._spawn_minions (salt/minion.py) creates one Minion per master, each bound to a single master via s_opts["master"] = master but inheriting the operator's random_master setting (and flagged with s_opts["multimaster"] = True). Each child then takes the single-master branch of eval_master and emits the warning. With N masters, the warning appears N times at startup.

Setup

  • on-prem / VM, onedir packaging
  • minion connected to two masters

Steps to Reproduce the behavior

Minion config:

master:
  - master1.example.com
  - master2.example.com
random_master: True

Restart the minion and check the log:

# grep random_master /var/log/salt/minion
... random_master is True but there is only one master specified. Ignoring.
... random_master is True but there is only one master specified. Ignoring.

Expected behavior

No warning for a valid multi-master configuration. The warning should fire only for a genuinely single-master minion (one where random_master truly has no effect), not for the per-master child minions the MinionManager spawns in multi-master mode.

Versions Report

Observed on 3006.26. The warning code is unguarded on the current 3006.x branch and on master (the else "single master sign in" branch of MinionBase.eval_master).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions