Provide version migration mechanism for json state
Closed this issue · 1 comments
dmitrypekar commented
Rationale:
We are going to introduce new concept such as cluster. It will definitely change json state format.
And when the user upgrades the Scheduler it's json state should be migrated automatically to the
new format.
For that purpose we need to have some simple mechanism to migrate json state
to the newer version (only in forward direction).
The proposed approach is following:
- we add Scheduler.version: Version field, containing current version.
- we add version attribute to json state (if absent, we assume - 0.9.3.0 or current on the moment of the implementation);
- if Scheduler.version is greater then json state version, we apply a series of
migration classes, matching those version interval. - we log about applied migrations;
Todo. Need to think. May be we will need to support migrations in both direction forward and backward. This will allow the user to downgrade the scheduler, if required.
dmitrypekar commented
Implemented.