)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"30e343b8f3a2f2f19b47351776a19e66afa0d97e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If the admin is migrating a volume without locking the volume,"},{"line_number":10,"context_line":"this migration can be aborted by the volume user\u0027s actions, e.g."},{"line_number":11,"context_line":"extend, attach, delete, etc. This patch targets to abort the"},{"line_number":12,"context_line":"host assisted migration across different volume nodes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iffc5bc28683c736239d707b2e4e7c6d6c3516cc6"},{"line_number":15,"context_line":"Partial-implements: blueprint migration-improvement"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"9a1a9d01_b3de8f0f","line":12,"updated":"2015-09-28 14:16:00.000000000","message":"I\u0027m not too sure about the premise here.  If an admin is migrating a volume, a user\u0027s action should be the one that fails, not the migration?  Admin actions generally take precedence over user actions.","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"0ec614e33041f737bf6f432e6ddb96c52b9b922c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"If the admin is migrating a volume without locking the volume,"},{"line_number":10,"context_line":"this migration can be aborted by the volume user\u0027s actions, e.g."},{"line_number":11,"context_line":"extend, attach, delete, etc. This patch targets to abort the"},{"line_number":12,"context_line":"host assisted migration across different volume nodes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iffc5bc28683c736239d707b2e4e7c6d6c3516cc6"},{"line_number":15,"context_line":"Partial-implements: blueprint migration-improvement"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"5a2ca52d_69d0d11f","line":12,"in_reply_to":"9a1a9d01_b3de8f0f","updated":"2015-10-16 06:30:59.000000000","message":"Your concern here was exactly what I proposed before, but during an IRC discussion quite a while ago, there is one conclusion for it. It can date back to the purpose of cinder, which is to provide block storage service to the user.\n\nThis is use case for the action interruption: User A created a volume vol-1 and he is supposed to have the service of this volume. Admin B needs to migrate this volume vol-1 due to some reasons, so he issued \"cinder migrate\" onto this volume. However, we would like to guarantee this service of vol-1 to User A, even if the volume is in migration. I used to propose to simply change the volume status into something to prevent the migration being interrupted, but the above case is what other cinder folks care about. We finally come to a solution that a key lock_volume is introduced into cinder migrate API. If this key is set to True, volume status turns to maintenance and no interruption on this migration. If this key is set to False, volume status does not change and migration will be terminated, if the volume user send other commands to this volume. This patch continues from: https://review.openstack.org/#/c/186312/.","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"30e343b8f3a2f2f19b47351776a19e66afa0d97e","unresolved":false,"context_lines":[{"line_number":12,"context_line":"host assisted migration across different volume nodes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iffc5bc28683c736239d707b2e4e7c6d6c3516cc6"},{"line_number":15,"context_line":"Partial-implements: blueprint migration-improvement"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"9a1a9d01_b313efb7","line":15,"updated":"2015-09-28 14:16:00.000000000","message":"This blueprint is still targeted for liberty?","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"0ec614e33041f737bf6f432e6ddb96c52b9b922c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"host assisted migration across different volume nodes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iffc5bc28683c736239d707b2e4e7c6d6c3516cc6"},{"line_number":15,"context_line":"Partial-implements: blueprint migration-improvement"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"5a2ca52d_e905c179","line":15,"in_reply_to":"9a1a9d01_b313efb7","updated":"2015-10-16 06:30:59.000000000","message":"It was. \nHowever, this BP is really complex and huge, as you can see there is a long list of patches dedicated to it. Part of this has been done in L, and I need to continue in M. It has been set to M.","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"}],"cinder/volume/drivers/lvm.py":[{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"f60e131833e3794a2fd17776679c55ac77015362","unresolved":false,"context_lines":[{"line_number":9,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":"from __builtin__ import False"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"\"\"\""},{"line_number":15,"context_line":"Driver for Linux servers running LVM."}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_649c7d0e","line":12,"updated":"2015-08-26 01:57:25.000000000","message":"We should remove this","commit_id":"b9045b3e9f1b3a1abb22538ef813060683021d56"}],"cinder/volume/manager.py":[{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"f60e131833e3794a2fd17776679c55ac77015362","unresolved":false,"context_lines":[{"line_number":934,"context_line":"                    reason\u003d_(\"volume is already attached\"))"},{"line_number":935,"context_line":""},{"line_number":936,"context_line":"            migration_handling()"},{"line_number":937,"context_line":"            self._wait_till_volume_ready(volume_id)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"            attachment \u003d None"},{"line_number":940,"context_line":"            host_name_sanitized \u003d utils.sanitize_hostname("}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_06534618","line":937,"updated":"2015-08-26 01:57:25.000000000","message":"Some tests are need there to ensure the changes correctly.","commit_id":"b9045b3e9f1b3a1abb22538ef813060683021d56"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"f60e131833e3794a2fd17776679c55ac77015362","unresolved":false,"context_lines":[{"line_number":1247,"context_line":"        volume \u003d self.db.volume_get(context, volume_id)"},{"line_number":1248,"context_line":"        model_update \u003d None"},{"line_number":1249,"context_line":"        migration_handling()"},{"line_number":1250,"context_line":"        self._wait_till_volume_ready(volume_id)"},{"line_number":1251,"context_line":"        try:"},{"line_number":1252,"context_line":"            self.driver.validate_connector(connector)"},{"line_number":1253,"context_line":"        except exception.InvalidConnectorException as err:"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_462e1e8d","line":1250,"updated":"2015-08-26 01:57:25.000000000","message":"Here need some new tests too.","commit_id":"b9045b3e9f1b3a1abb22538ef813060683021d56"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"f60e131833e3794a2fd17776679c55ac77015362","unresolved":false,"context_lines":[{"line_number":1814,"context_line":"        self._notify_about_volume_usage(context, volume, \"resize.start\")"},{"line_number":1815,"context_line":"        try:"},{"line_number":1816,"context_line":"            migration_handling()"},{"line_number":1817,"context_line":"            self._wait_till_volume_ready(volume_id)"},{"line_number":1818,"context_line":"            self.driver.extend_volume(volume, new_size)"},{"line_number":1819,"context_line":"        except Exception:"},{"line_number":1820,"context_line":"            LOG.exception(_LE(\"Extend volume failed.\"),"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_66424240","line":1817,"updated":"2015-08-26 01:57:25.000000000","message":"here too.","commit_id":"b9045b3e9f1b3a1abb22538ef813060683021d56"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"2a9e73dffdd7f41e57d322394385c28ad2910832","unresolved":false,"context_lines":[{"line_number":844,"context_line":"        LOG.info(_LI(\"Delete snapshot completed successfully\"),"},{"line_number":845,"context_line":"                 resource\u003dsnapshot)"},{"line_number":846,"context_line":"        return True"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"    def _wait_till_volume_ready(self, volume_id,"},{"line_number":849,"context_line":"                                timeout\u003d"},{"line_number":850,"context_line":"                                CONF.migration_create_volume_timeout_secs):"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a1a9d01_2e148c42","line":847,"updated":"2015-09-25 17:21:50.000000000","message":"Should probably name this \"_wait_until_volume_ready\"","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"2a9e73dffdd7f41e57d322394385c28ad2910832","unresolved":false,"context_lines":[{"line_number":851,"context_line":"        starttime \u003d time.time()"},{"line_number":852,"context_line":"        deadline \u003d starttime + CONF.migration_create_volume_timeout_secs"},{"line_number":853,"context_line":"        ind \u003d self.migration_info.get(volume_id + \u0027indicator\u0027)"},{"line_number":854,"context_line":"        tries \u003d 0"},{"line_number":855,"context_line":"        while (ind is not None and ind !\u003d \u0027aborted\u0027):"},{"line_number":856,"context_line":"            tries +\u003d 1"},{"line_number":857,"context_line":"            now \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a1a9d01_4ead40e8","line":854,"updated":"2015-09-25 17:21:50.000000000","message":"Parenthesis aren\u0027t necessary (up to you)","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"2a9e73dffdd7f41e57d322394385c28ad2910832","unresolved":false,"context_lines":[{"line_number":858,"context_line":"            if now \u003e deadline:"},{"line_number":859,"context_line":"                msg \u003d _(\"The volume is not ready.\")"},{"line_number":860,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":861,"context_line":"            else:"},{"line_number":862,"context_line":"                time.sleep(tries ** 2)"},{"line_number":863,"context_line":"            ind \u003d self.migration_info.get(volume_id + \u0027indicator\u0027)"},{"line_number":864,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"9a1a9d01_aed09c54","line":861,"updated":"2015-09-25 17:21:50.000000000","message":"Any reason we\u0027re sleeping \"try # * try #\"?  It seems a bit odd doing the sleep in this pattern","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"2a9e73dffdd7f41e57d322394385c28ad2910832","unresolved":false,"context_lines":[{"line_number":881,"context_line":"                tries \u003d 0"},{"line_number":882,"context_line":"                while pid is None:"},{"line_number":883,"context_line":"                    tries +\u003d 1"},{"line_number":884,"context_line":"                    now \u003d time.time()"},{"line_number":885,"context_line":"                    if now \u003e deadline:"},{"line_number":886,"context_line":"                        break"},{"line_number":887,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a1a9d01_4ef6a090","line":884,"updated":"2015-09-25 17:21:50.000000000","message":"Since this is part of the loops ending condition we could always move it into the while condition","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"2a9e73dffdd7f41e57d322394385c28ad2910832","unresolved":false,"context_lines":[{"line_number":890,"context_line":"                # Get the process for the pid and terminate it."},{"line_number":891,"context_line":"                if pid:"},{"line_number":892,"context_line":"                    vol_utils.terminate_process(pid)"},{"line_number":893,"context_line":"            else:"},{"line_number":894,"context_line":"                # Kill the migration process for file mode."},{"line_number":895,"context_line":"                pass"},{"line_number":896,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"9a1a9d01_ce307059","line":893,"updated":"2015-09-25 17:21:50.000000000","message":"Is part a WIP to come?","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"34734468440160f34f94c40c20469d658926a062","unresolved":false,"context_lines":[{"line_number":890,"context_line":"                # Get the process for the pid and terminate it."},{"line_number":891,"context_line":"                if pid:"},{"line_number":892,"context_line":"                    vol_utils.terminate_process(pid)"},{"line_number":893,"context_line":"            else:"},{"line_number":894,"context_line":"                # Kill the migration process for file mode."},{"line_number":895,"context_line":"                pass"},{"line_number":896,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"5a2ca52d_e91381b6","line":893,"in_reply_to":"9a1a9d01_ce307059","updated":"2015-10-16 06:44:34.000000000","message":"Exactly.","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"2a9e73dffdd7f41e57d322394385c28ad2910832","unresolved":false,"context_lines":[{"line_number":895,"context_line":"                pass"},{"line_number":896,"context_line":""},{"line_number":897,"context_line":"            self.migration_info[volume_id + \u0027indicator\u0027] \u003d ("},{"line_number":898,"context_line":"                \u0027abort\u0027)"},{"line_number":899,"context_line":"        elif indicator !\u003d \u0027complete\u0027:"},{"line_number":900,"context_line":"            # The indicator complete means the volume has been copied"},{"line_number":901,"context_line":"            # to the destination, but there are still some db records"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a1a9d01_6e5a8485","line":898,"updated":"2015-09-25 17:21:50.000000000","message":"Could always change this to just an \"if\" and then we could remove line 897 because it\u0027s identical to 907 and \"indicator \u003d\u003d \u0027ready_copy\u0027\" would also enter here","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"34734468440160f34f94c40c20469d658926a062","unresolved":false,"context_lines":[{"line_number":895,"context_line":"                pass"},{"line_number":896,"context_line":""},{"line_number":897,"context_line":"            self.migration_info[volume_id + \u0027indicator\u0027] \u003d ("},{"line_number":898,"context_line":"                \u0027abort\u0027)"},{"line_number":899,"context_line":"        elif indicator !\u003d \u0027complete\u0027:"},{"line_number":900,"context_line":"            # The indicator complete means the volume has been copied"},{"line_number":901,"context_line":"            # to the destination, but there are still some db records"}],"source_content_type":"text/x-python","patch_set":31,"id":"5a2ca52d_696f712b","line":898,"in_reply_to":"9a1a9d01_6e5a8485","updated":"2015-10-16 06:44:34.000000000","message":"Let me keep it so far, because I am still verifying all the logic here. If all conditions are considered, I will give an optimized structure.","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"2a9e73dffdd7f41e57d322394385c28ad2910832","unresolved":false,"context_lines":[{"line_number":910,"context_line":"                      mountpoint, mode):"},{"line_number":911,"context_line":"        \"\"\"Updates db to show volume is attached.\"\"\""},{"line_number":912,"context_line":"        @utils.synchronized(volume_id + \u0027mig\u0027, external\u003dTrue)"},{"line_number":913,"context_line":"        def migration_handling():"},{"line_number":914,"context_line":"            self._in_process_migration_handling(volume_id)"},{"line_number":915,"context_line":""},{"line_number":916,"context_line":"        @utils.synchronized(volume_id, external\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a1a9d01_0e7f48ab","line":913,"updated":"2015-09-25 17:21:50.000000000","message":"Is there any reason we define this function many times as nested function instead of just once? It appears we are always calling migration_handling() and then self._wait_till_volume_ready(volume_id).  So we could define\n\nmigration_handling(volume_id) which called inner method that does locking and then waits","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"34734468440160f34f94c40c20469d658926a062","unresolved":false,"context_lines":[{"line_number":910,"context_line":"                      mountpoint, mode):"},{"line_number":911,"context_line":"        \"\"\"Updates db to show volume is attached.\"\"\""},{"line_number":912,"context_line":"        @utils.synchronized(volume_id + \u0027mig\u0027, external\u003dTrue)"},{"line_number":913,"context_line":"        def migration_handling():"},{"line_number":914,"context_line":"            self._in_process_migration_handling(volume_id)"},{"line_number":915,"context_line":""},{"line_number":916,"context_line":"        @utils.synchronized(volume_id, external\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":31,"id":"5a2ca52d_099cbd0d","line":913,"in_reply_to":"9a1a9d01_0e7f48ab","updated":"2015-10-16 06:44:34.000000000","message":"Yes. As you see migration_info is what I introduced to mark the special stage of a whole migration. Migration can check and change it and other actions, like attach, extend, etc, can check and change it. I need to make sure there is no conflict in changing it, so I add @utils.synchronized(volume_id + \u0027mig\u0027, external\u003dTrue) before migration_handling.\nHowever, _wait_till_volume_ready is different, and it does not need to be in the @utils.synchronized, because it only check migration_info(no change). If we put _wait_till_volume_ready in the @utils.synchronized, it is possible that the code execution is locked/frozen in it, because other code is waiting for @utils.synchronized is released.","commit_id":"bc6594ff92d590303dba20657bec5292868ad3dd"}]}
