Limit what we iterate over in providers#1704
Open
jstack-godaddy wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The current implementation of applying/creating users, grants and databases was creating extremely long puppet runs in one of our environments. The environment is a shared hosting implementation that has 1000+ schema and 4 users per schema for RW/RO access. These schema and users are managed by another team, so we do not want to prune. The other team also does not want to limit users as it would create a split in workflow between on-prem and cloud provisioning. Puppet runs with
--tag mysqlwere taking close to 14 minutes to loop over all users, all grants, and all databases. In this change we are determining what the users, grants and databases we care about and only iterating over them. There's little to gain by looping over everything if we only care about the users, grants, and databases we are managing via hiera and manifests. The result is astounding. The runtime dropped from 14 minutes to 11 seconds with no change in expected behavior.after:
Additional Context
Add any additional context about the problem here.
Related Issues (if any)
N/A
Checklist
puppet apply)