-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VAULT-28313] enos: decode scenarios iteratively
Significantly improve the speeed and reliability of `list` and `validate` in large repositories. While the prior implementation did list and validate in parallel, it also retained whole sets in memory even if they were not being used. Holding onto those references was catastrophic on machines with scarce resources. We replace the old implementation with a scenario decoder that's an iterator which allows the caller to handle the scenario if necessary or allow it to be garbage collected when we're through with it. This improves our memory usage with `list` and `validate` significantly. When testing `validate` against the Vault `replication` scenario with our prior implementation, our memory usage grew linerally until reaching ~11GB. Now our memory stays flat in the 300-400mb range. Overall it improves listing wall clock speed by 10% and our validate speed by 15% when validating a subset of scenarios. On my machine you couldn't successfully validate all of them with the prior implementation and now it works just fine. There's still room for improvement on listing speed. If we cared less about format padding we could change the UI to be incremental for the basic UI and then render the scenarios on screen while they are being decoded. I chose not to do that as it's outside the scope of what we're trying to resolve. There's also significant memory usage when creating a sample frame and validating and/or making an observation it. There are likely subsequent improvements we could make there but those don't appear to be a blocker to fixing our validator. Backwards incompatible changes: * We now return an error when attempting to list scenarios in a directory without any defined scenario blocks. * We now sort our matrix block by variant and elements and the ordering can be slightly different than before. I doubt anybody would notice but it's possible. * We don't guarantee perfectly sorted output when listing as it is done in parallel and we aren't caching and sorting. Changes: * Create a scenario decoder that implements an iterator pattern * Utilize the iterator pattern in various endpoints and tests * Fix a race in the warnings as errors check acceptance test * Bump version * Pin to the latest actions to resolve deprecation warnings Signed-off-by: Ryan Cragun <[email protected]>
- Loading branch information
1 parent
96c036c
commit a0d7988
Showing
44 changed files
with
1,324 additions
and
879 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.