-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[reconfigurator] add SimRngState to track RNGs (#7019)
Currently, each time a component like a system or collection is generated, its RNGs live in their own world. While this is okay for tests, it is somewhat inconvenient for the reconfigurator CLI which would really be able to generate not just one fixed RNG but a succession of generations of RNGs. In some cases, to do incremental work we were reusing existing RNGs (e.g. the sled ID RNG). Unfortunately that led to situations where changing how the example system was generated would also change these downstream IDs. Restructure how the RNGs are managed -- each builder now has its own RNG struct which can be initialized separately (we pass these around rather than `impl Hash` instances for type safety). We also now have a stateful RNG creator which tracks RNG generation numbers and can be used to build downstream RNGs. In an upcoming PR we're going to use this stateful RNG creator in reconfigurator-sim. I've tried to minimize disruption to existing tests, especially those with checked-in fixtures. The way to generate additional sleds does change, though, and because the physical disk and zpool IDs are generated as pure functions of the sled ID, those change too.
- Loading branch information
1 parent
3f6cd90
commit 15305ae
Showing
9 changed files
with
358 additions
and
191 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
Oops, something went wrong.