)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"d6c298da614e04135d799146356599b0f9bf8911","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     yuriy_n \u003cynesenenko@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-28 13:51:43 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement missing methods to Block Device driver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds the create_snapshot and create_volume_from_snapshot"},{"line_number":10,"context_line":"methods to Block Device driver."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a1a9d01_acea5272","line":7,"updated":"2015-09-30 11:41:17.000000000","message":"Should be something like:\nImplement snapshots-related features for Block Device Driver","commit_id":"ddc6f6014d75f437f7d3c9208c28c7a62787eeba"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"d6c298da614e04135d799146356599b0f9bf8911","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Implement missing methods to Block Device driver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds the create_snapshot and create_volume_from_snapshot"},{"line_number":10,"context_line":"methods to Block Device driver."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ifde29a523cd07bcd1a4efa245513e9fd9517a3cc"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a1a9d01_cc98e61e","line":10,"updated":"2015-09-30 11:41:17.000000000","message":"+delete_snapshot","commit_id":"ddc6f6014d75f437f7d3c9208c28c7a62787eeba"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"d6c298da614e04135d799146356599b0f9bf8911","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch adds the create_snapshot and create_volume_from_snapshot"},{"line_number":10,"context_line":"methods to Block Device driver."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ifde29a523cd07bcd1a4efa245513e9fd9517a3cc"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a1a9d01_4cb4d67e","line":12,"updated":"2015-09-30 11:41:17.000000000","message":"Related blueprint: block-device-driver-minimum-features-set","commit_id":"ddc6f6014d75f437f7d3c9208c28c7a62787eeba"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"448995bec52a31ffabbd5113c4c72bd02f23e8a6","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Yuriy Nesenenko \u003cynesenenko@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-10-13 19:30:45 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement snapshots-related features for Block Device Driver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds the create_snapshot, create_volume_from_snapshot"},{"line_number":10,"context_line":"and delete_snapshot methods to Block Device driver."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3a29b11f_05e5e735","line":7,"updated":"2015-10-19 18:03:23.000000000","message":"This patch does more than that, please split it or add explicitly that it is also adding locks to create_volume and delete_volume and why these locks are needed. This will make it easier to understand the patch in the future.","commit_id":"9bf7fa7d58e1379ca68b286c36de1553896ea630"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9b80d6c40cff15aef8ef687232b3de359a69157d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds the create_snapshot, create_volume_from_snapshot"},{"line_number":10,"context_line":"and delete_snapshot methods to Block Device driver. It also adds"},{"line_number":11,"context_line":"synchronization to these methods to avoid multiple calls to get"},{"line_number":12,"context_line":"the same device."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Related blueprint: block-device-driver-minimum-features-set"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"3a29b11f_bb1772a2","line":11,"updated":"2015-10-19 18:49:54.000000000","message":"It adds synchronization also to create_volume, delete_volume create_cloned_volume and extend_volume.\n\nhttps://review.openstack.org/#/c/203593/ will probably make you to rebase the patch, so you can fix that then.","commit_id":"e8338dad6f1e3b3b34831255861d7978cfef7f2c"}],"cinder/volume/drivers/block_device.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"8989393c55dac87cde99771d25562ff6b27ffac6","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def create_volume(self, volume):"},{"line_number":65,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":66,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"},{"line_number":67,"context_line":"                 {\"volume\": volume[\u0027name\u0027], \"device\": device})"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_b48579ae","line":64,"updated":"2015-10-01 15:38:23.000000000","message":"This also needs locking/synchronization, currently, two concurrent create requests could start using the same block device resulting in corruption.","commit_id":"210a3b09370f4488b570c3e3b9b39d0887e03e6c"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"67d6cb46be2e355a1d0d28f490efe57e3d430eab","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            volutils.clear_volume("},{"line_number":85,"context_line":"                dev_size[dev_path], dev_path,"},{"line_number":86,"context_line":"                volume_clear\u003dself.configuration.volume_clear,"},{"line_number":87,"context_line":"                volume_clear_size\u003dself.configuration.volume_clear_size)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def local_path(self, device):"},{"line_number":90,"context_line":"        if device[\u0027provider_location\u0027]:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_b4f49987","line":87,"updated":"2015-10-01 15:36:11.000000000","message":"This should at least log a warning message if volume clearing is disabled or can\u0027t run, because people disabling it will leak data between volumes/tenants.","commit_id":"210a3b09370f4488b570c3e3b9b39d0887e03e6c"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"67d6cb46be2e355a1d0d28f490efe57e3d430eab","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        else:"},{"line_number":208,"context_line":"            raise exception.CinderException(_(\"No big enough free disk\"))"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def create_snapshot(self, snapshot):"},{"line_number":211,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":212,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"},{"line_number":213,"context_line":"        dev_size \u003d self._get_devices_sizes([device])"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_f49c515f","line":210,"updated":"2015-10-01 15:36:11.000000000","message":"This has to verify that the volume isn\u0027t attached.  As is, this would result in data corruption.","commit_id":"210a3b09370f4488b570c3e3b9b39d0887e03e6c"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"67d6cb46be2e355a1d0d28f490efe57e3d430eab","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            \u0027provider_location\u0027: device,"},{"line_number":223,"context_line":"        }"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def delete_snapshot(self, snapshot):"},{"line_number":226,"context_line":"        self._delete_block_device(snapshot)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def create_volume_from_snapshot(self, volume, snapshot):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_b4225900","line":225,"updated":"2015-10-01 15:36:11.000000000","message":"Needs locking against create_snapshot, because a create_snapshot and delete_snapshot running at the same time will result in a corrupt snapshot volume.","commit_id":"210a3b09370f4488b570c3e3b9b39d0887e03e6c"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"25fa36a071d8856c458649e9d7b32343ee93be0b","unresolved":false,"context_lines":[{"line_number":165,"context_line":"            if local_path:"},{"line_number":166,"context_line":"                used_devices.add(local_path)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        snap_lst \u003d api.snapshot_get_by_host(context.get_admin_context(),"},{"line_number":169,"context_line":"                                            self.host)"},{"line_number":170,"context_line":"        for snap in snap_lst:"},{"line_number":171,"context_line":"            local_path \u003d self.local_path(snap)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_7c579f02","line":168,"updated":"2015-10-06 14:30:22.000000000","message":"This should be using self.db instead of \"api\".","commit_id":"e0c5c774b77e2e809f75e400ad0f482db39f54c1"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"25fa36a071d8856c458649e9d7b32343ee93be0b","unresolved":false,"context_lines":[{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":216,"context_line":"    def create_snapshot(self, snapshot):"},{"line_number":217,"context_line":"        volume \u003d api.volume_get(context.get_admin_context(),"},{"line_number":218,"context_line":"                                snapshot[\u0027volume_id\u0027])"},{"line_number":219,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":220,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_3c42873f","line":217,"updated":"2015-10-06 14:30:22.000000000","message":"This should be using self.db instead of \"api\".","commit_id":"e0c5c774b77e2e809f75e400ad0f482db39f54c1"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"24b933f7f6e712c929e144192e58d182d5182fa4","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableVD,"},{"line_number":45,"context_line":"                        driver.CloneableImageVD, driver.TransferVD):"},{"line_number":46,"context_line":"    VERSION \u003d \u00272.1.0\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def __init__(self, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_69c98658","line":45,"updated":"2015-10-09 09:45:24.000000000","message":"Seems that we need to update version at least to 2.2","commit_id":"d67dd5e55ef65137eabb9d12e38b9624216951fa"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"ce55912521c00b58914f3099b87f3635e27faf4b","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                volume_clear\u003dself.configuration.volume_clear,"},{"line_number":89,"context_line":"                volume_clear_size\u003dself.configuration.volume_clear_size)"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            LOG.warning(_LW(\"Volume clearing is disabled or can\u0027t run\"))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def local_path(self, device):"},{"line_number":94,"context_line":"        if device[\u0027provider_location\u0027]:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_4c1b5f81","line":91,"updated":"2015-10-09 18:39:33.000000000","message":"This should case cause the delete to fail resulting in \"error_deleting\".\n\nOtherwise you have a situation where user A deletes a volume, it fails to wipe for whatever reason, and then user B is allocated that volume, gaining access to user A\u0027s data.","commit_id":"5cbb848c251d79ab59290a3c370f32cda25fda27"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"e29da7c6beb57fad5b71eab6a5fa411f17fc484d","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                volume_clear\u003dself.configuration.volume_clear,"},{"line_number":89,"context_line":"                volume_clear_size\u003dself.configuration.volume_clear_size)"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            LOG.warning(_LW(\"Volume clearing is disabled or can\u0027t run\"))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def local_path(self, device):"},{"line_number":94,"context_line":"        if device[\u0027provider_location\u0027]:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_c7a3a1ff","line":91,"in_reply_to":"7a2fa921_4c1b5f81","updated":"2015-10-12 10:36:43.000000000","message":"Good catch, I\u0027m agree","commit_id":"5cbb848c251d79ab59290a3c370f32cda25fda27"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"e29da7c6beb57fad5b71eab6a5fa411f17fc484d","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        snap_lst \u003d self.db.snapshot_get_by_host(context.get_admin_context(),"},{"line_number":169,"context_line":"                                                self.host)"},{"line_number":170,"context_line":"        for snap in snap_lst:"},{"line_number":171,"context_line":"            local_path \u003d self.local_path(snap)"},{"line_number":172,"context_line":"            if local_path:"},{"line_number":173,"context_line":"                used_devices.add(local_path)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_27861566","line":170,"updated":"2015-10-12 10:36:43.000000000","message":"Please, don\u0027t copy-paste code. These lines are similar to #163-166","commit_id":"5cbb848c251d79ab59290a3c370f32cda25fda27"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"ce55912521c00b58914f3099b87f3635e27faf4b","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":220,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"},{"line_number":221,"context_line":"        dev_size \u003d self._get_devices_sizes([device])"},{"line_number":222,"context_line":"        volutils.copy_volume("},{"line_number":223,"context_line":"            self.local_path(volume), device,"},{"line_number":224,"context_line":"            dev_size[device],"},{"line_number":225,"context_line":"            self.configuration.volume_dd_blocksize,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_6c697bf8","line":222,"updated":"2015-10-09 18:39:33.000000000","message":"You can\u0027t do this if the volume is in use, or you will have a corrupt snapshot.","commit_id":"5cbb848c251d79ab59290a3c370f32cda25fda27"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"a0de2a117a94e7faca6d60b60eaf4815af4379dd","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":220,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"},{"line_number":221,"context_line":"        dev_size \u003d self._get_devices_sizes([device])"},{"line_number":222,"context_line":"        volutils.copy_volume("},{"line_number":223,"context_line":"            self.local_path(volume), device,"},{"line_number":224,"context_line":"            dev_size[device],"},{"line_number":225,"context_line":"            self.configuration.volume_dd_blocksize,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_f53f5985","line":222,"in_reply_to":"7a2fa921_67196d79","updated":"2015-10-12 16:30:08.000000000","message":"?\n\nThe API has callers issue \"--force\" for snapshots of volumes that are in-use.  Those snapshots are still expected to work correctly, though.  It has to be checked here and fail if the volume is in-use, because that will generate a corrupt copy.","commit_id":"5cbb848c251d79ab59290a3c370f32cda25fda27"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"e29da7c6beb57fad5b71eab6a5fa411f17fc484d","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":220,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"},{"line_number":221,"context_line":"        dev_size \u003d self._get_devices_sizes([device])"},{"line_number":222,"context_line":"        volutils.copy_volume("},{"line_number":223,"context_line":"            self.local_path(volume), device,"},{"line_number":224,"context_line":"            dev_size[device],"},{"line_number":225,"context_line":"            self.configuration.volume_dd_blocksize,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_67196d79","line":222,"in_reply_to":"7a2fa921_6c697bf8","updated":"2015-10-12 10:36:43.000000000","message":"Eric, it\u0027s checked by cinder-api. Should we check it here too?","commit_id":"5cbb848c251d79ab59290a3c370f32cda25fda27"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_d45498cb","line":64,"updated":"2015-10-12 20:09:50.000000000","message":"I get why this is added, but you should split these changes to another patch, as these aren\u0027t related to this one - as your commit message states. Also you \"need\" to use external\u003dTrue to lock between multiple processes [1].\n\n[1] https://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L175-L178","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"74c80736c6be857ce7be44c9b444962242bf640b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_d49258f6","line":64,"in_reply_to":"7a2fa921_d45498cb","updated":"2015-10-12 20:11:22.000000000","message":"s/\"need\"/*need* \n\nIt\u0027s probably too late for me to do reviews. ;)","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            \u0027provider_location\u0027: device,"},{"line_number":71,"context_line":"        }"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":74,"context_line":"    def delete_volume(self, volume):"},{"line_number":75,"context_line":"        self._delete_block_device(volume)"},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_945dc0ee","line":73,"updated":"2015-10-12 20:09:50.000000000","message":"ditto","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                  image_meta,"},{"line_number":119,"context_line":"                                  self.local_path(volume))"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":122,"context_line":"    def create_cloned_volume(self, volume, src_vref):"},{"line_number":123,"context_line":"        LOG.info(_LI(\u0027Creating clone of volume: %s.\u0027), src_vref[\u0027id\u0027])"},{"line_number":124,"context_line":"        device \u003d self.find_appropriate_size_device(src_vref[\u0027size\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_745ca4ed","line":121,"updated":"2015-10-12 20:09:50.000000000","message":"ditto","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            raise exception.CinderException(_(\"No big enough free disk\"))"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":221,"context_line":"    def create_snapshot(self, snapshot):"},{"line_number":222,"context_line":"        volume \u003d self.db.volume_get(context.get_admin_context(),"},{"line_number":223,"context_line":"                                    snapshot[\u0027volume_id\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_34c70c47","line":220,"updated":"2015-10-12 20:09:50.000000000","message":"You should lock with external\u003dTrue to lock between multiple processes.","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        volume \u003d self.db.volume_get(context.get_admin_context(),"},{"line_number":223,"context_line":"                                    snapshot[\u0027volume_id\u0027])"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":226,"context_line":"            msg \u003d _(\"Volume is not available.\")"},{"line_number":227,"context_line":"            LOG.error(msg, resource\u003dvolume)"},{"line_number":228,"context_line":"            raise exception.CinderException(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_b4ba3cbf","line":225,"updated":"2015-10-12 20:09:50.000000000","message":"You\u0027re introducing a race condition here. Please mark it with TODO describing that this should be changed after we\u0027ll get compare-and-swap atomic DB updates in place (geguileo work)","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":239,"context_line":"            \u0027provider_location\u0027: device,"},{"line_number":240,"context_line":"        }"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":243,"context_line":"    def delete_snapshot(self, snapshot):"},{"line_number":244,"context_line":"        self._delete_block_device(snapshot)"},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_74eb44b1","line":242,"updated":"2015-10-12 20:09:50.000000000","message":"external\u003dTrue","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":243,"context_line":"    def delete_snapshot(self, snapshot):"},{"line_number":244,"context_line":"        self._delete_block_device(snapshot)"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":247,"context_line":"    def create_volume_from_snapshot(self, volume, snapshot):"},{"line_number":248,"context_line":"        LOG.info(_LI(\u0027Creating volume %s from snapshot.\u0027), volume[\u0027id\u0027])"},{"line_number":249,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_14d1b0fb","line":246,"updated":"2015-10-12 20:09:50.000000000","message":"external\u003dTrue","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"4a38dd49964548e223fafdab4bae4099ac20a59c","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            \u0027provider_location\u0027: device,"},{"line_number":258,"context_line":"        }"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    @utils.synchronized(\u0027block_device\u0027)"},{"line_number":261,"context_line":"    def extend_volume(self, volume, new_size):"},{"line_number":262,"context_line":"        dev_path \u003d self.local_path(volume)"},{"line_number":263,"context_line":"        total_size \u003d self._get_devices_sizes([dev_path])"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a2fa921_b408fc92","line":260,"updated":"2015-10-12 20:09:50.000000000","message":"external\u003dTrue and I don\u0027t believe this belongs to this particular patch.","commit_id":"b2bb58fc04b6ee051b07d5a10f90d393e24d9ede"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"dd02ac1a108d2f00cc92a117cbb3318bc9abf801","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        volume \u003d self.db.volume_get(context.get_admin_context(),"},{"line_number":223,"context_line":"                                    snapshot[\u0027volume_id\u0027])"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":226,"context_line":"            msg \u003d _(\"Volume is not available.\")"},{"line_number":227,"context_line":"            LOG.error(msg, resource\u003dvolume)"},{"line_number":228,"context_line":"            raise exception.CinderException(msg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_4abb1f0f","line":225,"updated":"2015-10-13 11:44:02.000000000","message":"I\u0027m taking back my comment from previous patchset. Atomic state transitions won\u0027t help here… _Probably_ locking on the method is enough…\n\nI wonder if we\u0027re doing the same check in other drivers? This seems like a weird approach.","commit_id":"2895f84035f398695731e35b3c8568585d3bd599"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"ac03830e5a883950e2cff5b7e799d97308021e7f","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        volume \u003d self.db.volume_get(context.get_admin_context(),"},{"line_number":223,"context_line":"                                    snapshot[\u0027volume_id\u0027])"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":226,"context_line":"            msg \u003d _(\"Volume is not available.\")"},{"line_number":227,"context_line":"            LOG.error(msg, resource\u003dvolume)"},{"line_number":228,"context_line":"            raise exception.CinderException(msg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_c9c73344","line":225,"in_reply_to":"5a2ca52d_4abb1f0f","updated":"2015-10-13 14:54:27.000000000","message":"We do similar things in the RemoteFS drivers.  This isn\u0027t related to state transitions / locking.\n\nWe have to do this because the expectation from the volume manager / Cinder is that this method can be called when the volume is \"in-use\", but the design of this driver is such that trying to create a snapshot while the volume is \"in-use\" will result in a corrupt snapshot.\n\nThe only option is to just have the driver say it can\u0027t do that and live with that limitation.","commit_id":"2895f84035f398695731e35b3c8568585d3bd599"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"ac03830e5a883950e2cff5b7e799d97308021e7f","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":226,"context_line":"            msg \u003d _(\"Volume is not available.\")"},{"line_number":227,"context_line":"            LOG.error(msg, resource\u003dvolume)"},{"line_number":228,"context_line":"            raise exception.CinderException(msg)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":231,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_4909e394","line":228,"updated":"2015-10-13 14:54:27.000000000","message":"VolumeDriverException","commit_id":"2895f84035f398695731e35b3c8568585d3bd599"},{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"af40355f54061fa2bb346ee9908afcdc8b41deb6","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a29b11f_606d22cb","line":64,"updated":"2015-10-22 07:21:19.000000000","message":"\"external\u003dTrue\" means a progress level lock, do we really need this \u0027big\u0027 lock when create volume?","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":14305,"name":"Yuriy Nesenenko","email":"ynesenenko@mirantis.com","username":"yuriy_n"},"change_message_id":"70d9fd4123c9ca420f8d5e53ba9e7889e158d054","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a29b11f_d38e4b2d","line":64,"in_reply_to":"3a29b11f_606d22cb","updated":"2015-10-22 09:04:55.000000000","message":"We should use \u0027external\u003dTrue\u0027 to lock between multiple processes [1].\n\n[1] https://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L175-L178","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"540618728a6ff3ce975c7cab8b26dfede552bfe8","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_856d499a","line":64,"in_reply_to":"3a29b11f_cc7a2c88","updated":"2015-11-04 21:48:44.000000000","message":"Are there any better solution to remove this big lock from create_volume()?\n\nAdding this lock here means user can\u0027t create new volume while they create clone volume, snapshot volume or delete volume. These operations take too much time(depends on the volume size) because this driver uses dd full block copy to create clone, snapshot or delete volume.\n\nThis seems very bad experience for users.\n\nI think if we can manage used volume more efficiently,\nit is enough to lock only the find_appropriate_size_device().\n\nAny thought?","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"3a496535a3ba3ea62f0cddd954a98d316f98c5eb","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a29b11f_cc7a2c88","line":64,"in_reply_to":"3a29b11f_d38e4b2d","updated":"2015-10-22 10:09:04.000000000","message":"Explaining in more details - we have c-vol service coupled with c-bak (backup) service. This means that we can have multiple processes using these methods (backups can create and delete temporary volumes).","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"69b8a7d5e59da0193abdbc02609cc767fc4d9acc","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_91f241d1","line":64,"in_reply_to":"fa80f949_5e194887","updated":"2015-11-05 19:40:15.000000000","message":"\u003e\u003eLocking only on find_appropriate_size_device won\u0027t work, \n\u003e\u003ebecause we don\u0027t have a block device reserved until we return \n\u003e\u003e from this method.\n\nYes. I agree on it.\n\nI think we need another device management mechanism for used devices instead of managing it by DB to avoid race condition.\n\nSimple solutions are;\n (1) Create a file like volume-123-456 which contains device information\n (2) Create a symbolic link for used devices\n\ntgtd manages target configuration using (1). May be there are another good solutions.","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"94d75dd15479943b4605971f06b06cc662258b4f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_5e194887","line":64,"in_reply_to":"fa80f949_856d499a","updated":"2015-11-05 19:13:06.000000000","message":"Locking only on find_appropriate_size_device won\u0027t work, because we don\u0027t have a block device reserved until we return from this method.\n\nBut this is actually a good thought, because locking on create_volume is not enough either. Device isn\u0027t reserved until manager saves provider_location to the DB. I think we still have race condition here we need to engineer around.\n\nPotentially this may lead to a case where two volumes are writing to the same block device, which may lead to severe data losses.","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8f806a1babad9a723773bb651314a139f3fc9937","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_ca96ce4b","line":64,"in_reply_to":"fa80f949_91f241d1","updated":"2015-11-05 20:54:13.000000000","message":"This is solely local driver, that cannot be run in A/A manner, so any file-based solution should work well - which is nice. :)","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"af40355f54061fa2bb346ee9908afcdc8b41deb6","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                volume_clear\u003dself.configuration.volume_clear,"},{"line_number":89,"context_line":"                volume_clear_size\u003dself.configuration.volume_clear_size)"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            LOG.warning(_LW(\"Volume clearing is disabled or can\u0027t run\"))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if device[\u0027status\u0027] \u003d\u003d \"error_deleting\":"},{"line_number":94,"context_line":"            msg \u003d _(\"Failed to delete device.\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a29b11f_b537fafd","line":91,"updated":"2015-10-22 07:21:19.000000000","message":"Add a \u0027.\u0027 to the end of line.","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"ee94f65565e8ec8c00d6ec4f280d57a3ef1fc053","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                                             self.host)"},{"line_number":175,"context_line":"        used_devices \u003d self._get_used_items(lst)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        snap_lst \u003d self.db.snapshot_get_by_host(context.get_admin_context(),"},{"line_number":178,"context_line":"                                                self.host)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        return used_devices.union(self._get_used_items(snap_lst))"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_6d3da3ba","line":177,"updated":"2015-11-05 03:48:59.000000000","message":"Could we use objects.SnapshotList here?","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"94d75dd15479943b4605971f06b06cc662258b4f","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                                             self.host)"},{"line_number":175,"context_line":"        used_devices \u003d self._get_used_items(lst)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        snap_lst \u003d self.db.snapshot_get_by_host(context.get_admin_context(),"},{"line_number":178,"context_line":"                                                self.host)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        return used_devices.union(self._get_used_items(snap_lst))"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_3e024470","line":177,"in_reply_to":"fa80f949_6d3da3ba","updated":"2015-11-05 19:13:06.000000000","message":"Ah, good catch!","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":13203,"name":"Wilson Liu","email":"295988511@qq.com","username":"Bob-OpenStack"},"change_message_id":"af40355f54061fa2bb346ee9908afcdc8b41deb6","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":221,"context_line":"    def create_snapshot(self, snapshot):"},{"line_number":222,"context_line":"        volume \u003d self.db.volume_get(context.get_admin_context(),"},{"line_number":223,"context_line":"                                    snapshot[\u0027volume_id\u0027])"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":226,"context_line":"            msg \u003d _(\"Volume is not available.\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a29b11f_20ebaae0","line":223,"updated":"2015-10-22 07:21:19.000000000","message":"Why not just just do it like this:\nvolume \u003d snapshot[\u0027volume_id\u0027]","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":14305,"name":"Yuriy Nesenenko","email":"ynesenenko@mirantis.com","username":"yuriy_n"},"change_message_id":"70d9fd4123c9ca420f8d5e53ba9e7889e158d054","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":221,"context_line":"    def create_snapshot(self, snapshot):"},{"line_number":222,"context_line":"        volume \u003d self.db.volume_get(context.get_admin_context(),"},{"line_number":223,"context_line":"                                    snapshot[\u0027volume_id\u0027])"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        if volume[\u0027status\u0027] !\u003d \u0027available\u0027:"},{"line_number":226,"context_line":"            msg \u003d _(\"Volume is not available.\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a29b11f_53c9db57","line":223,"in_reply_to":"3a29b11f_20ebaae0","updated":"2015-10-22 09:04:55.000000000","message":"In such a way we\u0027ll just get volume_id not volume object. As you see below we\u0027re checking the volume\u0027s status.","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"d86818be918fa602e11ef623434f944702456a45","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":231,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"},{"line_number":232,"context_line":"        dev_size \u003d self._get_devices_sizes([device])"},{"line_number":233,"context_line":"        volutils.copy_volume("},{"line_number":234,"context_line":"            self.local_path(volume), device,"},{"line_number":235,"context_line":"            dev_size[device],"},{"line_number":236,"context_line":"            self.configuration.volume_dd_blocksize,"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_6cf5a9c9","line":233,"updated":"2015-11-05 01:38:43.000000000","message":"Is this doing a full copy? If it is, i feel it is not snapshot.","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a48cbe9215f3859bd8a7e4a248ae3081c5527e","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":231,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"},{"line_number":232,"context_line":"        dev_size \u003d self._get_devices_sizes([device])"},{"line_number":233,"context_line":"        volutils.copy_volume("},{"line_number":234,"context_line":"            self.local_path(volume), device,"},{"line_number":235,"context_line":"            dev_size[device],"},{"line_number":236,"context_line":"            self.configuration.volume_dd_blocksize,"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_cc7935fe","line":233,"in_reply_to":"fa80f949_6cf5a9c9","updated":"2015-11-05 01:57:18.000000000","message":"This driver is a special case since it\u0027s raw block devices. In that case, a full copy is really the only way to get a \"snapshot\" of the volume.","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":10439,"name":"Xi Yang","email":"yang.xi@99cloud.net","username":"phenom"},"change_message_id":"ee94f65565e8ec8c00d6ec4f280d57a3ef1fc053","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        LOG.info(_LI(\u0027Creating volume snapshot: %s.\u0027), snapshot[\u0027id\u0027])"},{"line_number":231,"context_line":"        device \u003d self.find_appropriate_size_device(snapshot[\u0027volume_size\u0027])"},{"line_number":232,"context_line":"        dev_size \u003d self._get_devices_sizes([device])"},{"line_number":233,"context_line":"        volutils.copy_volume("},{"line_number":234,"context_line":"            self.local_path(volume), device,"},{"line_number":235,"context_line":"            dev_size[device],"},{"line_number":236,"context_line":"            self.configuration.volume_dd_blocksize,"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa80f949_b2ebea77","line":233,"in_reply_to":"fa80f949_cc7935fe","updated":"2015-11-05 03:48:59.000000000","message":"@Sean\nFine. It makes sense.","commit_id":"035d358ecce4a261064986b0df9ea0de370c444f"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"d1b256e3aa61858716504562df636082eec1c9b3","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a8ffd7b_3bc4023f","line":64,"updated":"2015-11-24 13:38:26.000000000","message":"I think we still have following potential race condition here.\n\n\u003e\u003eBut this is actually a good thought, because locking on create_volume is not enough either. Device isn\u0027t reserved until manager saves provider_location to the DB. I think we still have race condition here we need to engineer around.\n\n\nCreate vol1        Create vol2\n-----------------------------------\ncreate_volume      Wait lock release\n |                 |\n |Reserve \"sdd\"    |\n |                 |\nFin create_volume  create_volume start\n |                 |Reserve \"sdd\"\n |DB update        |\n |at manager       |","commit_id":"e478047a51f7fd9ef50e9e743ea201788aecb29b"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"b3b5a80127780238468b36219afaa917cef997e4","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a8ffd7b_ae3af2e5","line":64,"in_reply_to":"9a8ffd7b_3bc4023f","updated":"2015-11-24 13:55:41.000000000","message":"Mitsuhiro, I\u0027m agree with you. I  didn\u0027t address any comments yet. I\u0027m working on CI now","commit_id":"e478047a51f7fd9ef50e9e743ea201788aecb29b"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"9e3aa7e2ac682240998030e105090c9cd10fced0","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def check_for_setup_error(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @utils.synchronized(\u0027block_device\u0027, external\u003dTrue)"},{"line_number":65,"context_line":"    def create_volume(self, volume):"},{"line_number":66,"context_line":"        device \u003d self.find_appropriate_size_device(volume[\u0027size\u0027])"},{"line_number":67,"context_line":"        LOG.info(_LI(\"Create %(volume)s on %(device)s.\"),"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a8ffd7b_c7fdd96f","line":64,"in_reply_to":"9a8ffd7b_ae3af2e5","updated":"2015-11-24 14:36:29.000000000","message":"I got the situation. Thanks.","commit_id":"e478047a51f7fd9ef50e9e743ea201788aecb29b"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"313a4966c52305c37214756d5615474516ba6586","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                volume_clear\u003dself.configuration.volume_clear,"},{"line_number":89,"context_line":"                volume_clear_size\u003dself.configuration.volume_clear_size)"},{"line_number":90,"context_line":"        else:"},{"line_number":91,"context_line":"            LOG.warning(_LW(\"Volume clearing is disabled or can\u0027t run\"))"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if device[\u0027status\u0027] \u003d\u003d \"error_deleting\":"},{"line_number":94,"context_line":"            msg \u003d _(\"Failed to delete device.\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a8ffd7b_630cce94","line":91,"updated":"2015-12-01 21:07:36.000000000","message":"If volume_clear !\u003d \u0027none\u0027 and dev_path doesn\u0027t exist, then this shouldn\u0027t succeed.\n\nIn that case, something has gone wrong and it could result in data leaking between tenants when we reuse the device.","commit_id":"e478047a51f7fd9ef50e9e743ea201788aecb29b"}]}
