Migration state machine.
In the current code, migration statuses (Migration.status) are represented with pure String. So are image statuses, snapshot statuses, and event statuses.
It has the following demerits:
1. When we grep the code for migration statuses, we could get lots of noisy info we don't want.
eg. When we want to grep migration status 'error', all the other statuses will also come out.
2. Sometimes, we use '' to wrap a string, but sometimes using "". So usually we need to grep twice for more precise results.
eg. Grep "'migrating'" and "\"migrating\"". I found that in some test files, " " is used, but in other files, ' ' is used.
3. People could spell the string incorrectly, or give a different word to represent the same meaning.
eg. In the current code, we have three statuses representing the migration is over: finish, completed and done. I really cannot tell the differences among them. (About this, I could be wrong. Please correct me.)
Nikola Dipanov has posted two patches to fix this problem by introducing a state machine for migration status. These two patches are part of another BP.
https:/
https:/
And also, Joshua Harlow has posted a patch to introduce a state machine builder, which is a common functionality.
https:/
The usage example is here:
http://
So the solution turns out to be: reuse the common state machine builder, and create a state machine for migration status.
For now, the work is abandoned now because the original fix of another problem may by pending. But the fix of migration status is still needed. And it will make many other work easier. So I'd like to go on with it through this BP.
Blueprint information
- Status:
- Started
- Approver:
- John Garbutt
- Priority:
- Medium
- Drafter:
- Tang Chen
- Direction:
- Needs approval
- Assignee:
- Tang Chen
- Definition:
- Pending Approval
- Series goal:
- None
- Implementation:
- Started
- Milestone target:
- None
- Started by
- John Garbutt
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
The above patches have been abandoned. And the BP has been updated. Please review this new BP.
Gerrit topic: https:/
Addressed by: https:/
Migration state machine
(Abandoned)
Pending Patches
==============
Addressed by: https:/
WIP: Implement status machine for live-migration.
Addressed by: https:/
WIP: Implement status machine for resize.
Addressed by: https:/
WIP: Implement status machine for evacuation.
Addressed by: https:/
WIP: Implement status machine for migration.
Addressed by: https:/
WIP: Use status machines to manage the migraiton status.
Deferred till Newton --johnthetubaguy 2nd March 2016
Addressed by: https:/
Use finite machine in migration process