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

RFE: Write Inventory changes to the database after inventory sync has completed #7586

Closed
msilmser opened this issue Jul 8, 2020 · 3 comments

Comments

@msilmser
Copy link

msilmser commented Jul 8, 2020

ISSUE TYPE
  • Feature Idea
SUMMARY

In order to long running connections to the database during slow inventory syncs, some users may desire an option to write all data to the database after the sync as opposed to during.

@AlanCoding
Copy link
Member

It is possible that this will be accomplished by #7061

Several forms of inventory refactoring are planned, it's going to be a massive task, and I think @chrismeyersfsu may have started on some of that.

The largest change will be moving ansible-inventory calls into a container. Saving to the database will only happen after that has completed. I don't think that saving the inventory has ever been a major bottleneck, and if it had, it was because of overly-verbose logging. Typically, it's the inventory plugin itself that's the thing that takes an eternity.

@wenottingham
Copy link
Contributor

While #7061 may change this, we are not planning to deeply change the process of how we import inventory. We've always only ever started saving it after the ansible-inventory process exits.

@chrismeyersfsu
Copy link
Member

Yeah, I'm not exactly sure what is wanted here. As @wenottingham said, we don't update the inventory in the DB until the cloud inventory gathering process has finished. We also tried hard to push the lock that protects competing inventory source updates to the same Inventory down as far as possible. https://github.com/ansible/awx/blob/devel/awx/main/management/commands/inventory_import.py#L884

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

No branches or pull requests

4 participants