)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Bharath Kumar \u003cbharath.kumar3@hpe.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-03-10 14:28:20 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove the image-volume db entry if cloned_volume() fails"},{"line_number":8,"context_line":"If the cloned_volume() functions fails"},{"line_number":9,"context_line":"the db entry will happen ,even if"},{"line_number":10,"context_line":"already exists in the db.So removing db cache"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5aef4532_3531ed5a","line":7,"updated":"2016-03-10 14:31:05.000000000","message":"Needs a blank line after the summary line.","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove the image-volume db entry if cloned_volume() fails"},{"line_number":8,"context_line":"If the cloned_volume() functions fails"},{"line_number":9,"context_line":"the db entry will happen ,even if"},{"line_number":10,"context_line":"already exists in the db.So removing db cache"},{"line_number":11,"context_line":"entry from the db if it exists , whenever a call to"},{"line_number":12,"context_line":"create the image-volume cache db entry happens."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5aef4532_d54249ad","line":9,"updated":"2016-03-10 14:31:05.000000000","message":"space on wrong side of the comma.","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Remove the image-volume db entry if cloned_volume() fails"},{"line_number":8,"context_line":"If the cloned_volume() functions fails"},{"line_number":9,"context_line":"the db entry will happen ,even if"},{"line_number":10,"context_line":"already exists in the db.So removing db cache"},{"line_number":11,"context_line":"entry from the db if it exists , whenever a call to"},{"line_number":12,"context_line":"create the image-volume cache db entry happens."},{"line_number":13,"context_line":"for the bug-id:1552734"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5aef4532_154951d0","line":10,"updated":"2016-03-10 14:31:05.000000000","message":"Need space before \"So\".","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":8,"context_line":"If the cloned_volume() functions fails"},{"line_number":9,"context_line":"the db entry will happen ,even if"},{"line_number":10,"context_line":"already exists in the db.So removing db cache"},{"line_number":11,"context_line":"entry from the db if it exists , whenever a call to"},{"line_number":12,"context_line":"create the image-volume cache db entry happens."},{"line_number":13,"context_line":"for the bug-id:1552734"},{"line_number":14,"context_line":"link:https://bugs.launchpad.net/cinder/+bug/1552734"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5aef4532_3518cdd2","line":11,"updated":"2016-03-10 14:31:05.000000000","message":"Extra space before the comma.","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":10,"context_line":"already exists in the db.So removing db cache"},{"line_number":11,"context_line":"entry from the db if it exists , whenever a call to"},{"line_number":12,"context_line":"create the image-volume cache db entry happens."},{"line_number":13,"context_line":"for the bug-id:1552734"},{"line_number":14,"context_line":"link:https://bugs.launchpad.net/cinder/+bug/1552734"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I9f62c5d2919b8bc63df15dba5206120155c5b938"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5aef4532_958281c6","line":13,"updated":"2016-03-10 14:31:05.000000000","message":"Remove this and at the end on its own line add:\n\nCloses-bug: #1552734\n\n\nOtherwise it won\u0027t get properly linked.","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":11,"context_line":"entry from the db if it exists , whenever a call to"},{"line_number":12,"context_line":"create the image-volume cache db entry happens."},{"line_number":13,"context_line":"for the bug-id:1552734"},{"line_number":14,"context_line":"link:https://bugs.launchpad.net/cinder/+bug/1552734"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I9f62c5d2919b8bc63df15dba5206120155c5b938"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5aef4532_15779102","line":14,"updated":"2016-03-10 14:31:05.000000000","message":"Remove this line.","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"db5ed704f7072505e92865097d87f774ad3d88e5","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the cloned_volume() functions fails"},{"line_number":10,"context_line":"the db entry will happen,even if"},{"line_number":11,"context_line":"already exists in the db. So removing db cache"},{"line_number":12,"context_line":"entry from the db if it exists, whenever a call to"},{"line_number":13,"context_line":"create the image-volume cache db entry happens."},{"line_number":14,"context_line":"Closes-bug: #1552734"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5aef4532_f145be6e","line":11,"updated":"2016-03-10 22:40:51.000000000","message":"If the create_cloned_volume() function fails, a new db cache entry will be created even if there is already an entry in the db.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"db5ed704f7072505e92865097d87f774ad3d88e5","unresolved":false,"context_lines":[{"line_number":10,"context_line":"the db entry will happen,even if"},{"line_number":11,"context_line":"already exists in the db. So removing db cache"},{"line_number":12,"context_line":"entry from the db if it exists, whenever a call to"},{"line_number":13,"context_line":"create the image-volume cache db entry happens."},{"line_number":14,"context_line":"Closes-bug: #1552734"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I9f62c5d2919b8bc63df15dba5206120155c5b938"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5aef4532_2c118952","line":13,"updated":"2016-03-10 22:40:51.000000000","message":"Without your change, what happens if there is already an entry in the db and create_cloned_volume() call is successful?  Will we end up with two entries or one entry in this case?\n\nYour code only deletes the entry if create_cloned_volume fails, but this commit message suggests the existing entry will always be removed when there is a call to create the db entry.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":19367,"name":"Bharath kumar","username":"bharath.kumar3","inactive":true},"change_message_id":"ec2fedce0117415109b6063802d9f28805d7cdfb","unresolved":false,"context_lines":[{"line_number":10,"context_line":"the db entry will happen,even if"},{"line_number":11,"context_line":"already exists in the db. So removing db cache"},{"line_number":12,"context_line":"entry from the db if it exists, whenever a call to"},{"line_number":13,"context_line":"create the image-volume cache db entry happens."},{"line_number":14,"context_line":"Closes-bug: #1552734"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I9f62c5d2919b8bc63df15dba5206120155c5b938"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5aef4532_6519df21","line":13,"in_reply_to":"5aef4532_2c118952","updated":"2016-03-15 09:37:26.000000000","message":"thank you for the reply, patrick east suggested a change, ill do that and then ill write a unit test for that","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"db5ed704f7072505e92865097d87f774ad3d88e5","unresolved":false,"context_lines":[{"line_number":11,"context_line":"already exists in the db. So removing db cache"},{"line_number":12,"context_line":"entry from the db if it exists, whenever a call to"},{"line_number":13,"context_line":"create the image-volume cache db entry happens."},{"line_number":14,"context_line":"Closes-bug: #1552734"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I9f62c5d2919b8bc63df15dba5206120155c5b938"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5aef4532_4c4e953b","line":14,"updated":"2016-03-10 22:40:51.000000000","message":"Add an empty line before \"Closes-Bug\".","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"}],"cinder/tests/unit/image/test_cache.py":[{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"8fe680f8782a237c81586820d6b55c3f1c6d4958","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            entry[\u0027size\u0027]"},{"line_number":207,"context_line":"        )"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def test_cache_entry_already_exists(self):"},{"line_number":210,"context_line":"        cache \u003d self._build_cache()"},{"line_number":211,"context_line":"        entry \u003d self._build_entry()"},{"line_number":212,"context_line":"        volume_ref \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"1af94dfe_9e5c674c","line":209,"updated":"2016-03-18 17:34:20.000000000","message":"This unit test doesn\u0027t really test the code that was modified... I recommend adding a test over in this test case https://github.com/openstack/cinder/blob/master/cinder/tests/unit/volume/flows/test_create_volume_flow.py#L697 which could have the clone image volume fail, and simulate re-creating the volume (read: reproduce the bug if this commit was not present). You should then be able to assert that the old image-volume was deleted from the cache, and you only end up with a single entry in the cache for that image.","commit_id":"cc29beff246b2674b317418128da655cb62cb7af"}],"cinder/volume/manager.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"    def _create_image_cache_volume_entry(self, ctx, volume_ref,"},{"line_number":1134,"context_line":"                                         image_id, image_meta):"},{"line_number":1135,"context_line":"        \"\"\"Create a new image-volume and cache entry for it."},{"line_number":1136,"context_line":"        This assumes that the image has already been downloaded and stored"},{"line_number":1137,"context_line":"        in the volume described by the volume_ref."},{"line_number":1138,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"5aef4532_b5521d65","line":1135,"updated":"2016-03-10 14:31:05.000000000","message":"Blank line should not be removed.","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"a3a75bd7a8eb95d9d422bd620c14a0d3992299df","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"            if not image_volume:"},{"line_number":1155,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1156,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1157,"context_line":"                                \u0027 as we are creating an entry again \u0027))"},{"line_number":1158,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx,"},{"line_number":1159,"context_line":"                            volume_ref, image_id, image_meta)"},{"line_number":1160,"context_line":"                if entry:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aef4532_b5d97df5","line":1157,"range":{"start_line":1157,"start_character":67,"end_line":1157,"end_character":68},"updated":"2016-03-10 14:31:05.000000000","message":"Remove space at the end. Should end with a period for consistency.","commit_id":"ba569a9e1ee42f60e825fce9932a8162cfd02725"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"8cfd0db30bea75f05e2570e69d7edd04f7d0f80c","unresolved":false,"context_lines":[{"line_number":1133,"context_line":"    def _create_image_cache_volume_entry(self, ctx, volume_ref,"},{"line_number":1134,"context_line":"                                         image_id, image_meta):"},{"line_number":1135,"context_line":"        \"\"\"Create a new image-volume and cache entry for it."},{"line_number":1136,"context_line":"        "},{"line_number":1137,"context_line":"        This assumes that the image has already been downloaded and stored"},{"line_number":1138,"context_line":"        in the volume described by the volume_ref."},{"line_number":1139,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_0bc80e73","line":1136,"updated":"2016-03-10 14:55:19.000000000","message":"You have extra blank spaces here that cause pep8 failures.","commit_id":"e7985355d1692f6d7740de2d959aaded19eea0ef"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"8cfd0db30bea75f05e2570e69d7edd04f7d0f80c","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx,"},{"line_number":1160,"context_line":"                            volume_ref, image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_4b8b361f","line":1160,"updated":"2016-03-10 14:55:19.000000000","message":"This will cause a problem too. Since ctx is on the first line, the rest of these will need to line up with it.\n\nProbably the easiest would be to move ctx to this second line so you just need one indentation from the previous line.","commit_id":"e7985355d1692f6d7740de2d959aaded19eea0ef"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"8cfd0db30bea75f05e2570e69d7edd04f7d0f80c","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"                                \u0027%(image_id)s will not create cache entry.\u0027),"},{"line_number":1168,"context_line":"                            {\u0027image_id\u0027: image_id})"},{"line_number":1169,"context_line":"                return"},{"line_number":1170,"context_line":"            "},{"line_number":1171,"context_line":"            self.image_volume_cache.create_cache_entry("},{"line_number":1172,"context_line":"                ctx,"},{"line_number":1173,"context_line":"                image_volume,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_6b84320a","line":1170,"updated":"2016-03-10 14:55:19.000000000","message":"Extra spaces on this line too that will cause problems.","commit_id":"e7985355d1692f6d7740de2d959aaded19eea0ef"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"9564d478c53faa5b21b627b8c95f601800af993b","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                                                    volume_ref,"},{"line_number":1154,"context_line":"                                                    image_meta)"},{"line_number":1155,"context_line":"            if not image_volume:"},{"line_number":1156,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_099d7565","line":1158,"range":{"start_line":1156,"start_character":33,"end_line":1158,"end_character":67},"updated":"2016-03-11 22:39:09.000000000","message":"This message really isn\u0027t helpful to an end user.  I think it would be something more like:  \"Create_closed_volume failed.  Deleting old cache entry.\"\n\nOtherwise it isn\u0027t clear to the user if this is actually happening without looking at the code.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":19367,"name":"Bharath kumar","username":"bharath.kumar3","inactive":true},"change_message_id":"ec2fedce0117415109b6063802d9f28805d7cdfb","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                                                    volume_ref,"},{"line_number":1154,"context_line":"                                                    image_meta)"},{"line_number":1155,"context_line":"            if not image_volume:"},{"line_number":1156,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_8d866d63","line":1158,"range":{"start_line":1156,"start_character":33,"end_line":1158,"end_character":67},"in_reply_to":"3afc51ec_099d7565","updated":"2016-03-15 09:37:26.000000000","message":"yeah sure, ill change in the next patch set.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":20984,"name":"Mark Mokryn","email":"mokesmokes@gmail.com"},"change_message_id":"81b72c840bb7cb4ef6f0df3278f3968ab471eb26","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"},{"line_number":1164,"context_line":"                        entry"},{"line_number":1165,"context_line":"                    )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_db45d370","line":1162,"updated":"2016-03-14 15:30:47.000000000","message":"evict() evicts the cache entry but doesn\u0027t delete the volume. Should use _delete_image_volume assuming it works as advertised (\"Delete a volume and remove cache entry.\")","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":19367,"name":"Bharath kumar","username":"bharath.kumar3","inactive":true},"change_message_id":"ec2fedce0117415109b6063802d9f28805d7cdfb","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"},{"line_number":1164,"context_line":"                        entry"},{"line_number":1165,"context_line":"                    )"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_2d28f9e1","line":1162,"in_reply_to":"3afc51ec_db45d370","updated":"2016-03-15 09:37:26.000000000","message":"yeah sure, ill also delete the original volume here. Thank you for replying","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"90fc98cbb7cc116ac9fd9abf966aea5fa94e8720","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                                                    volume_ref,"},{"line_number":1154,"context_line":"                                                    image_meta)"},{"line_number":1155,"context_line":"            if not image_volume:"},{"line_number":1156,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"},{"line_number":1164,"context_line":"                        entry"},{"line_number":1165,"context_line":"                    )"},{"line_number":1166,"context_line":"                LOG.warning(_LW(\u0027Unable to clone image_volume for image \u0027"},{"line_number":1167,"context_line":"                                \u0027%(image_id)s will not create cache entry.\u0027),"},{"line_number":1168,"context_line":"                            {\u0027image_id\u0027: image_id})"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_403db9c2","line":1165,"range":{"start_line":1156,"start_character":16,"end_line":1165,"end_character":21},"updated":"2016-03-10 23:15:48.000000000","message":"Hang on, I don\u0027t think this is the right fix. We should just change _create_from_image_cache over in cinder/volume/flows/manager/create_volume.py to return the cache entry as well. Then right here https://github.com/openstack/cinder/blob/master/cinder/volume/flows/manager/create_volume.py#L732 we can check if is wasn\u0027t cloned and if it didn\u0027t already have a cache entry. That way we don\u0027t keep making new ones if they already exist.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"e2359ba7c6a065268bef7af44610699c1bc0d6f8","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                                                    volume_ref,"},{"line_number":1154,"context_line":"                                                    image_meta)"},{"line_number":1155,"context_line":"            if not image_volume:"},{"line_number":1156,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"},{"line_number":1164,"context_line":"                        entry"},{"line_number":1165,"context_line":"                    )"},{"line_number":1166,"context_line":"                LOG.warning(_LW(\u0027Unable to clone image_volume for image \u0027"},{"line_number":1167,"context_line":"                                \u0027%(image_id)s will not create cache entry.\u0027),"},{"line_number":1168,"context_line":"                            {\u0027image_id\u0027: image_id})"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_c17ccbed","line":1165,"range":{"start_line":1156,"start_character":16,"end_line":1165,"end_character":21},"in_reply_to":"3afc51ec_9bd6b525","updated":"2016-03-14 14:24:10.000000000","message":"Sure, I can get on board for supporting that use-case. Its not my first choice as far as fixing the bug reported, but if there\u0027s demand for it... why not :)\n\nWe still need to address Jay\u0027s comment above then for the log message, if we are going to keep this evict here the message needs to make more sense.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":19367,"name":"Bharath kumar","username":"bharath.kumar3","inactive":true},"change_message_id":"ec2fedce0117415109b6063802d9f28805d7cdfb","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                                                    volume_ref,"},{"line_number":1154,"context_line":"                                                    image_meta)"},{"line_number":1155,"context_line":"            if not image_volume:"},{"line_number":1156,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"},{"line_number":1164,"context_line":"                        entry"},{"line_number":1165,"context_line":"                    )"},{"line_number":1166,"context_line":"                LOG.warning(_LW(\u0027Unable to clone image_volume for image \u0027"},{"line_number":1167,"context_line":"                                \u0027%(image_id)s will not create cache entry.\u0027),"},{"line_number":1168,"context_line":"                            {\u0027image_id\u0027: image_id})"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_0df53d82","line":1165,"range":{"start_line":1156,"start_character":16,"end_line":1165,"end_character":21},"in_reply_to":"3afc51ec_c17ccbed","updated":"2016-03-15 09:37:26.000000000","message":"Ill change the message in the next patch set. As you told earlier, i think its better to change in create_volume file rather than here. And ill also delete the original volume as a new volume will be created after this.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":20984,"name":"Mark Mokryn","email":"mokesmokes@gmail.com"},"change_message_id":"33c5f31d8072bd4335af85f2e33b8039a0616c27","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                                                    volume_ref,"},{"line_number":1154,"context_line":"                                                    image_meta)"},{"line_number":1155,"context_line":"            if not image_volume:"},{"line_number":1156,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"},{"line_number":1164,"context_line":"                        entry"},{"line_number":1165,"context_line":"                    )"},{"line_number":1166,"context_line":"                LOG.warning(_LW(\u0027Unable to clone image_volume for image \u0027"},{"line_number":1167,"context_line":"                                \u0027%(image_id)s will not create cache entry.\u0027),"},{"line_number":1168,"context_line":"                            {\u0027image_id\u0027: image_id})"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afc51ec_9bd6b525","line":1165,"range":{"start_line":1156,"start_character":16,"end_line":1165,"end_character":21},"in_reply_to":"5aef4532_403db9c2","updated":"2016-03-14 13:10:56.000000000","message":"I disagree with this comment. If the clone fails in most cases we want to replace the cached volume with a new one - e.g. if the volume\u0027s snapshot limit was reached, in a snapshot-based clone implementation. So either we delete the cache entry along with its volume, or replace its volume with a new one (from the image which will be re-downloaded). If you really want the option of keeping the original volume in the cache, then I suppose we could add a config flag \"keep volume in cache after clone failure\", but we definitely must have an option to auto-delete the volume from the cache. Otherwise, we are forcing the user into manual intervention such as deleting snapshots or even running instances.","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":19367,"name":"Bharath kumar","username":"bharath.kumar3","inactive":true},"change_message_id":"ec2fedce0117415109b6063802d9f28805d7cdfb","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"                                                    volume_ref,"},{"line_number":1154,"context_line":"                                                    image_meta)"},{"line_number":1155,"context_line":"            if not image_volume:"},{"line_number":1156,"context_line":"                LOG.warning(_LW(\u0027Deleting the old cache entry if\u0027"},{"line_number":1157,"context_line":"                                \u0027 create_cloned_volume() fails,\u0027"},{"line_number":1158,"context_line":"                                \u0027 as we are creating an entry again\u0027))"},{"line_number":1159,"context_line":"                entry \u003d self.image_volume_cache.get_entry(ctx, volume_ref,"},{"line_number":1160,"context_line":"                                                          image_id, image_meta)"},{"line_number":1161,"context_line":"                if entry:"},{"line_number":1162,"context_line":"                    self.image_volume_cache.evict("},{"line_number":1163,"context_line":"                        ctx,"},{"line_number":1164,"context_line":"                        entry"},{"line_number":1165,"context_line":"                    )"},{"line_number":1166,"context_line":"                LOG.warning(_LW(\u0027Unable to clone image_volume for image \u0027"},{"line_number":1167,"context_line":"                                \u0027%(image_id)s will not create cache entry.\u0027),"},{"line_number":1168,"context_line":"                            {\u0027image_id\u0027: image_id})"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_25ea37db","line":1165,"range":{"start_line":1156,"start_character":16,"end_line":1165,"end_character":21},"in_reply_to":"5aef4532_403db9c2","updated":"2016-03-15 09:37:26.000000000","message":"Thank you for the reply , ill try this","commit_id":"312fa08d29d551cfcf7650fb8d61b1f43ea98b95"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"8fe680f8782a237c81586820d6b55c3f1c6d4958","unresolved":false,"context_lines":[{"line_number":1155,"context_line":"                                                      image_id,"},{"line_number":1156,"context_line":"                                                      image_meta)"},{"line_number":1157,"context_line":"            if entry:"},{"line_number":1158,"context_line":"                LOG.info(_LI(\u0027 Deleting old cache entry\u0027"},{"line_number":1159,"context_line":"                             \u0027 and image volume as a new entry \u0027"},{"line_number":1160,"context_line":"                             \u0027for same image is requested\u0027))"},{"line_number":1161,"context_line":"                self.image_volume_cache._delete_image_volume(ctx,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1af94dfe_69dc4746","line":1158,"updated":"2016-03-18 17:34:20.000000000","message":"nit: Please remove space at start of the log message.","commit_id":"cc29beff246b2674b317418128da655cb62cb7af"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"2565c656beb2c57d9a2ad45125e4573f9197a500","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"            if entry:"},{"line_number":1158,"context_line":"                LOG.info(_LI(\u0027 Deleting old cache entry\u0027"},{"line_number":1159,"context_line":"                             \u0027 and image volume as a new entry \u0027"},{"line_number":1160,"context_line":"                             \u0027for same image is requested\u0027))"},{"line_number":1161,"context_line":"                self.image_volume_cache._delete_image_volume(ctx,"},{"line_number":1162,"context_line":"                                                             entry)"},{"line_number":1163,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"bff0334d_992044f9","line":1160,"updated":"2017-04-11 19:44:32.000000000","message":"I don\u0027t think an admin will understand what this message means if it shows up in the logs.","commit_id":"cc29beff246b2674b317418128da655cb62cb7af"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"8fe680f8782a237c81586820d6b55c3f1c6d4958","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                            {\u0027image\u0027: image_id, \u0027host\u0027: volume_ref[\u0027host\u0027]})"},{"line_number":1151,"context_line":"                return"},{"line_number":1152,"context_line":""},{"line_number":1153,"context_line":"            entry \u003d self.image_volume_cache.get_entry(ctx,"},{"line_number":1154,"context_line":"                                                      volume_ref,"},{"line_number":1155,"context_line":"                                                      image_id,"},{"line_number":1156,"context_line":"                                                      image_meta)"},{"line_number":1157,"context_line":"            if entry:"},{"line_number":1158,"context_line":"                LOG.info(_LI(\u0027 Deleting old cache entry\u0027"},{"line_number":1159,"context_line":"                             \u0027 and image volume as a new entry \u0027"},{"line_number":1160,"context_line":"                             \u0027for same image is requested\u0027))"},{"line_number":1161,"context_line":"                self.image_volume_cache._delete_image_volume(ctx,"},{"line_number":1162,"context_line":"                                                             entry)"},{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"            image_volume \u003d self._clone_image_volume(ctx,"},{"line_number":1165,"context_line":"                                                    volume_ref,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1af94dfe_a4b2f649","line":1162,"range":{"start_line":1153,"start_character":12,"end_line":1162,"end_character":67},"updated":"2016-03-18 17:34:20.000000000","message":"This is potentially racy where when we query for an entry and then try to delete it or create the new cache entry and have a new entry show up or the old one deleted out from underneath us.\n\nWith that in mind, I would prefer that we catch any error raised by the delete_image_volume and swallow it here with maybe a warning message instead of preventing the new image volume from being created.\n\nThe cache will continue to work just fine if there are duplicates, and if it was deleted from under us we really want to have this keep going to create the new one, otherwise we end up incurring another cache miss and having to download the image again next time.\n\nDoes that make sense?","commit_id":"cc29beff246b2674b317418128da655cb62cb7af"},{"author":{"_account_id":19367,"name":"Bharath kumar","username":"bharath.kumar3","inactive":true},"change_message_id":"001dc5b09602545a4620630732aa528270e104ca","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                            {\u0027image\u0027: image_id, \u0027host\u0027: volume_ref[\u0027host\u0027]})"},{"line_number":1151,"context_line":"                return"},{"line_number":1152,"context_line":""},{"line_number":1153,"context_line":"            entry \u003d self.image_volume_cache.get_entry(ctx,"},{"line_number":1154,"context_line":"                                                      volume_ref,"},{"line_number":1155,"context_line":"                                                      image_id,"},{"line_number":1156,"context_line":"                                                      image_meta)"},{"line_number":1157,"context_line":"            if entry:"},{"line_number":1158,"context_line":"                LOG.info(_LI(\u0027 Deleting old cache entry\u0027"},{"line_number":1159,"context_line":"                             \u0027 and image volume as a new entry \u0027"},{"line_number":1160,"context_line":"                             \u0027for same image is requested\u0027))"},{"line_number":1161,"context_line":"                self.image_volume_cache._delete_image_volume(ctx,"},{"line_number":1162,"context_line":"                                                             entry)"},{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"            image_volume \u003d self._clone_image_volume(ctx,"},{"line_number":1165,"context_line":"                                                    volume_ref,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_405f4972","line":1162,"range":{"start_line":1153,"start_character":12,"end_line":1162,"end_character":67},"in_reply_to":"1af94dfe_a4b2f649","updated":"2016-03-29 06:55:26.000000000","message":"What im doing here is, when cloning a volume is failing because of some issue, it is trying to create a new cache entry and image-volume. So im deleting the old db entry and image cache, so that it always uses the newly created image-volume.","commit_id":"cc29beff246b2674b317418128da655cb62cb7af"},{"author":{"_account_id":16034,"name":"soumiyajit","email":"somya.rock@gmail.com","username":"soumiyajit"},"change_message_id":"2e69e6947280b8f5112b82b026f14801122cc18e","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                            {\u0027image\u0027: image_id, \u0027host\u0027: volume_ref[\u0027host\u0027]})"},{"line_number":1151,"context_line":"                return"},{"line_number":1152,"context_line":""},{"line_number":1153,"context_line":"            entry \u003d self.image_volume_cache.get_entry(ctx,"},{"line_number":1154,"context_line":"                                                      volume_ref,"},{"line_number":1155,"context_line":"                                                      image_id,"},{"line_number":1156,"context_line":"                                                      image_meta)"},{"line_number":1157,"context_line":"            if entry:"},{"line_number":1158,"context_line":"                LOG.info(_LI(\u0027 Deleting old cache entry\u0027"},{"line_number":1159,"context_line":"                             \u0027 and image volume as a new entry \u0027"},{"line_number":1160,"context_line":"                             \u0027for same image is requested\u0027))"},{"line_number":1161,"context_line":"                self.image_volume_cache._delete_image_volume(ctx,"},{"line_number":1162,"context_line":"                                                             entry)"},{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"            image_volume \u003d self._clone_image_volume(ctx,"},{"line_number":1165,"context_line":"                                                    volume_ref,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba2be162_42fbe878","line":1162,"range":{"start_line":1153,"start_character":12,"end_line":1162,"end_character":67},"in_reply_to":"ba0121b8_405f4972","updated":"2017-03-06 12:09:52.000000000","message":"Done","commit_id":"cc29beff246b2674b317418128da655cb62cb7af"}]}
