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

Get rid of slow event updates in delete_inventory #14231

Closed
4 of 9 tasks
AlanCoding opened this issue Jul 12, 2023 · 2 comments
Closed
4 of 9 tasks

Get rid of slow event updates in delete_inventory #14231

AlanCoding opened this issue Jul 12, 2023 · 2 comments

Comments

@AlanCoding
Copy link
Member

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.

Feature type

New Feature

Feature Summary

We should delete these lines because they can become a very slow query, and have no restrictions for the event partition they operate on.

for host in i.hosts.iterator():
host.job_events_as_primary_host.update(host=None)

Because the Event.host ForeignKey already is set to DO_NOTHING on_delete, it should work fine.

This issue requests:

  • develop a patch to delete that loop
  • develop minimal testing to assure the job events API still works after deleting an inventory that has hosts with associated events

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Steps to reproduce

Not a bug, just slow query elimination.

Current results

Query can go slow.

Sugested feature result

Do not do that query at all.

Additional information

No response

@AlanCoding
Copy link
Member Author

I think the most recent related work was #12447

This converted the host ForeignKey from SET_NULL to DO_NOTHING. At the point that happened, deleting this bit should have been possible. @john-westcott-iv do you know of any reason that was not done at that time? Any blockers for doing it now?

@AlanCoding
Copy link
Member Author

change has merged

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

No branches or pull requests

2 participants