-
Notifications
You must be signed in to change notification settings - Fork 64
Rework sled agent ledger handling for old versions #9544
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
base: main
Are you sure you want to change the base?
Conversation
| // v4 config collected from a test system. | ||
| const V4_CONFIG_PATH: &str = "test-data/v4-sled-config.json"; | ||
|
|
||
| // paths for expectorate checks | ||
| const EXPECTORATE_V10_CONFIG_PATH: &str = | ||
| "expectorate/v10-sled-config.json"; | ||
| const EXPECTORATE_V11_CONFIG_PATH: &str = | ||
| "expectorate/v11-sled-config.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you expect these tests to get updated for v12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I realize that's kind of tedious, but it seems pretty important to at least sanity check that we can convert from all prior versions up to the current. Very open to suggestions for any way to make updating these smooth. (I believe as written, the read_config_converts_from_older_versions() won't compile if a new version is added without updating it to account for it. But it should be a couple lines of changes to do so.)
@labbott pointed out that adding new sled config versions is quite painful w.r.t. updating the code that reads the ledger, and @bnaecker recently did nontrivial work here (with similar amounts of pain!). Now that done the overall API versioning reorganization work has landed, we can make this a lot cleaner. This PR makes several changes:
v4.main- we would try to read the on-disk ledger asv11; if that failed, we'd try to read it asv4, then convertv4->v10->v11. But we never tried to read it asv10. In this case (IIUC) the v10 -> v11 changes don't affect the on-disk format, so there's no practical impact here. But these changes should make this bug impossible in the future, since the macro defines the order in which we try versions, and we won't skip any.Most of the lines-of-code changed are in test files. I grabbed a newer
v4-sled-config.jsonfrom a real system so we'd have some zones with NICs (which is what changed in v4 -> v10) to confirm the tests are actually doing nontrivial conversions.