)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"058acc1081769124b4f31e93c1f57d76da4ae0cd","unresolved":false,"context_lines":[{"line_number":7,"context_line":"WIP: Use status machines to manage the migraiton status."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds a new status_machine field into class Migration."},{"line_number":10,"context_line":"This filed will be initialized when it is first used, and at this"},{"line_number":11,"context_line":"time, \"migration_type\" and \"status\" fields should be initialized"},{"line_number":12,"context_line":"first."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa80f949_bfd0b954","line":10,"updated":"2015-11-04 10:15:01.000000000","message":"field","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"5cc70ba42ea6448f25ad6337fa631642a9df64d6","unresolved":false,"context_lines":[{"line_number":7,"context_line":"WIP: Use status machines to manage the migraiton status."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds a new status_machine field into class Migration."},{"line_number":10,"context_line":"This filed will be initialized when it is first used, and at this"},{"line_number":11,"context_line":"time, \"migration_type\" and \"status\" fields should be initialized"},{"line_number":12,"context_line":"first."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da85f559_136807f5","line":10,"in_reply_to":"fa80f949_bfd0b954","updated":"2015-11-07 14:03:24.000000000","message":"Done","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"}],"nova/objects/migration.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"058acc1081769124b4f31e93c1f57d76da4ae0cd","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        super(MigrationStatusMachine, self).__init__(Status.INIT)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"def change_status(migration, event):"},{"line_number":260,"context_line":"    if migration.status_machine is None:"},{"line_number":261,"context_line":"        if migration.migration_type \u003d\u003d \u0027live-migration\u0027:"},{"line_number":262,"context_line":"            migration.status_machine \u003d LiveMigrationStatusMachine.build("}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_5f52ed68","line":259,"updated":"2015-11-04 10:15:01.000000000","message":"Is there a reason this isn\u0027t just in the method on the Migration object below?","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"900c7a65eb96c21a8040e004532986fa92de7e41","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        super(MigrationStatusMachine, self).__init__(Status.INIT)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"def change_status(migration, event):"},{"line_number":260,"context_line":"    if migration.status_machine is None:"},{"line_number":261,"context_line":"        if migration.migration_type \u003d\u003d \u0027live-migration\u0027:"},{"line_number":262,"context_line":"            migration.status_machine \u003d LiveMigrationStatusMachine.build("}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_896da434","line":259,"in_reply_to":"da85f559_33818b90","updated":"2015-11-07 16:29:24.000000000","message":"Sorry, I didn\u0027t finish it. I think it is my mistake here. It can be in the method of class Migration. I was trying to initialize the state machine in __init__(). But I could not get migration_type correctly. But in a method in class, I think it is OK. \n\nWill change it in the next version.","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"5cc70ba42ea6448f25ad6337fa631642a9df64d6","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        super(MigrationStatusMachine, self).__init__(Status.INIT)"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"def change_status(migration, event):"},{"line_number":260,"context_line":"    if migration.status_machine is None:"},{"line_number":261,"context_line":"        if migration.migration_type \u003d\u003d \u0027live-migration\u0027:"},{"line_number":262,"context_line":"            migration.status_machine \u003d LiveMigrationStatusMachine.build("}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_33818b90","line":259,"in_reply_to":"fa80f949_5f52ed68","updated":"2015-11-07 14:03:24.000000000","message":"In the very beginning, I tried to initialize the state machine in __init__() of class Migration. But at the init time, migration_type may have not been set yet. And","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"058acc1081769124b4f31e93c1f57d76da4ae0cd","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \u0027hidden\u0027: fields.BooleanField(nullable\u003dFalse, default\u003dFalse),"},{"line_number":304,"context_line":"        }"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    status_machine \u003d None"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    @staticmethod"},{"line_number":309,"context_line":"    def _from_db_object(context, migration, db_migration):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_7f8331cd","line":306,"updated":"2015-11-04 10:15:01.000000000","message":"state_machine? It\u0027s a state machine for statuses. You might call it a status state machine, or just status, or just state. status machine isn\u0027t right, though :) The only word which should precede \u0027machine\u0027 in this context is \u0027state\u0027.\n\nMore substantively, are you intending to pass this object and its state around exclusively via rpc, or are you going to persist it to the db?","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"01c81c029f199f0df723c47e36bb603d4e4d07e4","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \u0027hidden\u0027: fields.BooleanField(nullable\u003dFalse, default\u003dFalse),"},{"line_number":304,"context_line":"        }"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    status_machine \u003d None"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    @staticmethod"},{"line_number":309,"context_line":"    def _from_db_object(context, migration, db_migration):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_3e82a253","line":306,"in_reply_to":"da85f559_0e88da21","updated":"2015-11-08 22:00:57.000000000","message":"Ok, the confusing part about \u0027status_machine\u0027 is that its spelling is so close to \u0027state_machine\u0027 it almost looks like a typo, maybe a better name is worth some thought...","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"5cc70ba42ea6448f25ad6337fa631642a9df64d6","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \u0027hidden\u0027: fields.BooleanField(nullable\u003dFalse, default\u003dFalse),"},{"line_number":304,"context_line":"        }"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    status_machine \u003d None"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    @staticmethod"},{"line_number":309,"context_line":"    def _from_db_object(context, migration, db_migration):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_0e8f7a24","line":306,"in_reply_to":"da85f559_2bc83574","updated":"2015-11-07 14:03:24.000000000","message":"Yes, you are right. One state machine object for each Migration object, and only current_state costs memory.","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"991d8bc1efcfd915c5897a0592a840cf5f647ceb","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \u0027hidden\u0027: fields.BooleanField(nullable\u003dFalse, default\u003dFalse),"},{"line_number":304,"context_line":"        }"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    status_machine \u003d None"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    @staticmethod"},{"line_number":309,"context_line":"    def _from_db_object(context, migration, db_migration):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_9cef16b0","line":306,"in_reply_to":"da85f559_3e82a253","updated":"2015-11-09 01:39:18.000000000","message":"I have change the name to \"state_machine\" in the v2 patch-set. Maybe we can call the new state machine \"state_machine_v2\" or something similar. But this is all after the BP is approved. \n\nhttps://blueprints.launchpad.net/nova/+spec/migration-state-field-machine\n\nIt is OK to me that we call it \"state_machine\" in this version. :)","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"5cc70ba42ea6448f25ad6337fa631642a9df64d6","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \u0027hidden\u0027: fields.BooleanField(nullable\u003dFalse, default\u003dFalse),"},{"line_number":304,"context_line":"        }"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    status_machine \u003d None"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    @staticmethod"},{"line_number":309,"context_line":"    def _from_db_object(context, migration, db_migration):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_0e88da21","line":306,"in_reply_to":"fa80f949_7f8331cd","updated":"2015-11-07 14:03:24.000000000","message":"Because I\u0027m planning to add another field named \"state\" to class Migration, and redesign the state machine, I wanted to keep the name \"state_machine\" for it. But it needs discussion. Maybe it is not the best way.\n\nAnd about your second question, the objects of class Migration may be passed through conductor, compute and driver. But it won\u0027t be passed through rpc. And the states, just like Joshua said below, only current_state is stored in db, and APIs can only refer to current_state of a state machine.","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"794c5a715f9a47e0f4e1428d9a7213402b8a90a9","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \u0027hidden\u0027: fields.BooleanField(nullable\u003dFalse, default\u003dFalse),"},{"line_number":304,"context_line":"        }"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    status_machine \u003d None"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    @staticmethod"},{"line_number":309,"context_line":"    def _from_db_object(context, migration, db_migration):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_2bc83574","line":306,"in_reply_to":"fa80f949_7f8331cd","updated":"2015-11-07 00:57:59.000000000","message":"I\u0027d hope state machines aren\u0027t passed around, all u need is the current_state and u should be able to initialize a new machine from that and continue doing things... State machines don\u0027t have \u0027memory\u0027 so there shouldn\u0027t be much else that is needed to send it around (if needed).","commit_id":"99834c74510b193585608d3e668a8a5e337d214b"}]}
