-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add config file migration code #4784
Comments
cc: @dshulyak |
I don't think that node should modify config provided by a user, moreover configuration can be provided with flags. If we want to backward compatibility for configuration across several releases there should be a code that works with old data suggested approach just asks for a problem especially with smapp. smapp already maintains more than one config with overwrites. it may download new config and replace old at any point. if you will be insisting on this approach please ensure that it really works always |
The concrete problem that triggered this issue is that If the config file is not updated and has the value set as integer, the node will crash during startup with the error message: "expected map, but received float64" which is misleading (it should be "expected string, but received int"). I don't know how we should make the node work with old configuration data? If we read the old config with the old code this config parameter will incorrectly be read as In terms of command line parameters the change in question does luckily not need any adaptions in this area. We could let smapp take care of the config transition, but then nodes that run standalone will crash when they are updated. That might be OK, but as said earlier the error that will be displayed to the user won't help the user in figuring out what the issue is or how to fix it. cc @brusherru |
i would either add i am doing exactly that with that hare3, but there are also other upgradability nuances |
I agree with @dshulyak. It will be extremely difficult to maintain, IMO it's best to avoid if possible. Regarding the problem with |
Thanks I ended up implementing something similar that indeed makes a config migration unnecessary. |
Description
The schema of the config file might change with new features or bug fixes. A current example would be: spacemeshos/post#212.
A node should be able to load a config file in an older format, migrate it to the current and persist it again. Preferably with some information about the version of the config file.
Acceptance criteria
schema
(or similarly named) field to config. If not present assume version 0 (current version)Implementation hints
The text was updated successfully, but these errors were encountered: