-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
We should only call returner.save_load once per jid #22171
Comments
@basepi Is this fixed now, or no? |
No. We put a bandaid on it by just catching the exception on subsequent calls, if I remember correctly. But the source issue has not been fixed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
you should reopen this issue. why not update load on duplicate key? |
... for Postgres. The same fix should be applied to MySQL returner |
Hi, this is still an issue for some returners. I've tested both sqlite and odbc returner and both tries to save the same jid twice and fails since it is primary key as per documentation. Found this issue when looking at why the mysql returner appears to work. Sorry for waking it up again. The second call seems to contain data that is also saved in the salt_returns table, so maybe an empty catch is a good "bandaid" since as far as I understand won't lose any data and is a very small impact compared to changing how returns work completely. So should I then try to create an issue for sqlite and odbc returners and try to fix it? Another workaround I found is to simply create an identity column as primary key instead and allow duplicate jids. But if the return is already saved in salt_return table maybe this will only grow the database with duplicate info? |
Right now we save the load in two places: once during the publish (inside of the
publish
function), and once inside of the_return
function. This means we try to save the load again for each minion return. This is far from ideal from a performance standpoint, and also causes problems with some returners (such as mysql).The reason we
save_load
on returns is in case ofsalt-call
-initiated jobs on the minion, or jobs initiated from a lower-level master in a syndic setup.For the former, we should be able to see from the return that it was salt-call-initiated (no jid) and save the load only then. For the latter, we're going to have to get more creative -- perhaps another syndic-specific event for saving the load?
The text was updated successfully, but these errors were encountered: