salt icon indicating copy to clipboard operation
salt copied to clipboard

[DOCS] Improving returner docs

Open faivirol opened this issue 3 years ago • 5 comments

Description The docs do a very bad job at explaining the difference between ext_job_cache, event_return, master_job_cache, --return and which returner modules support which contexts.

Suggested Fix Clarify the following:

  • The difference between the master options (I don't currently understand this)
  • How --return works (does it ask the minion to send the data, and does this relate to the master options? which master option sets the argument's default value?)
  • How to tell if a module can be used in a given master option (it is unclear to me which exact functions this depends on)
  • Which options should be on the masters and which should be on the minions

Location or format of documentation https://docs.saltproject.io/en/latest/ref/returners/index.html https://docs.saltproject.io/en/latest/topics/jobs/external_cache.html https://docs.saltproject.io/en/latest/ref/configuration/master.html

Additional context I am more than happy to write the documentation, but I need to know how the returner system works before that and if the links above are the correct place to add documentation to.

faivirol avatar Dec 23 '22 13:12 faivirol

I just had to dig into the returner system, so I might have some answers for you.

Minion options:

  • return instructs the minion to send job results to a list of external systems in addition to sending them to the master. This is the same thing --return does. Essentially, this sends copies that are otherwise not used inside Salt.

Master options:

  • With master_job_cache, minions will return the results as usual and the master will send those to an external system. It will look up job results from there instead of the disk.
  • ext_job_cache instructs minions to return job results to an external system instead of the master by default. The master will look up job results from there instead of the disk.
  • event_return instructs the master to send all events to a list of external systems. You can filter which events are sent using event_return_whitelist and event_return_blacklist (undocumented afaik). There are also several engines that do the same. I'm unsure which way of exporting events should be preferred.

Necessary functions per config option:

return

  • returner

master_job_cache

  • returner
  • prep_jid
  • save_load
  • get_load

ext_job_cache

  • returner
  • prep_jid
  • save_load
  • get_load
  • get_jid
  • get_fun
  • get_jids
  • get_minions

event_return

  • event_return

Edit: TIL scheduled tasks do not respect return. You need to set schedule_returners for default task returners, which can be overridden per task.

lkubb avatar Jan 31 '23 09:01 lkubb

I was planning on giving this another go soon-ish, this will really help. Thanks a lot!

faivirol avatar Jan 31 '23 15:01 faivirol

Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.

Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.

If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.

dwoz avatar Oct 15 '26 22:10 dwoz

Reopening — there is an open PR tracking a fix for this: #69564.

dwoz avatar Oct 17 '26 01:10 dwoz

Closing — consolidated into #70585. The checkbox for this item is in the appropriate theme section of that tracker. Please pick up the sub-item there.

dwoz avatar Oct 28 '26 03:10 dwoz