Skip to content
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

[master] Port #50053 to master #56856

Merged
merged 3 commits into from
Apr 23, 2020
Merged

Conversation

garethgreenaway
Copy link
Contributor

Port #50053 to master

mattp- added 2 commits April 22, 2020 16:13
in multimaster hot-hot environments, all events are streamed to all masters for
a given minion. this introduces the problem of a reactor being executed on each
hot master, regardless of if the reaction is idempotent  or not. This patch
introduces a simple is_leader bool that can be controlled via the reactor
runner (or emitting the equivalent event to toggle) whether a reactor in
hot-standby mode should be reacting to events coming into the bus. The feature
itself is disconnected from multimaster, and is by default True, so it should
be inert in most saltstack installs. Tests forthcoming in following commit
the event based api that was earlier implemented to allow for
controlling the reactor engine had no means of auth, any minion could
send in events to influence it. adding the master key ensures those
events come from the valid local master only.
@garethgreenaway garethgreenaway requested a review from a team as a code owner April 22, 2020 23:25
@ghost ghost requested review from Akm0d and removed request for a team April 22, 2020 23:25
@dwoz dwoz merged commit b6edb68 into saltstack:master Apr 23, 2020
@sagetherage sagetherage added the ZRelease-Sodium retired label label May 18, 2020
@max-arnold
Copy link
Contributor

Has anyone tried this?

% sudo salt-run reactor.is_leader

event:
    ----------
    _stamp:
        2020-06-02T10:22:42.528292
    key:
        REDACTED
suffix:
    salt/reactors/manage/is_leader

Passed invalid arguments: 'NoneType' object is not subscriptable

Usage:

    Return whether the running reactor is acting as a leader (responding to events).

    CLI Example:

    .. code-block:: bash

        salt-run reactor.is_leader

@DmitryKuzmenko
Copy link
Contributor

DmitryKuzmenko commented Jun 2, 2020

@max-arnold just tried on master branch. Reproduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants