)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17444,"name":"Jay.Shen","email":"shenhong09@huawei.com","username":"Jay.Shen"},"change_message_id":"8bf8455d6a781293266a7f4c3c22905123f87288","unresolved":false,"context_lines":[{"line_number":15,"context_line":"status before even trying to go to the volume manager.  If the"},{"line_number":16,"context_line":"volume or snapshot is already busy an exception can be returned"},{"line_number":17,"context_line":"to the caller.  This makes the majority of the locks in Cinder"},{"line_number":18,"context_line":"volume mananger no longer needed."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"APIImpact"},{"line_number":21,"context_line":"blueprint: remove-volume-manager-locks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a4dcd0f_0296504c","line":18,"updated":"2015-08-04 04:08:00.000000000","message":"S/mananger/manager","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"}],"specs/kilo/remove-volume-manager-locks.rst":[{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"f1dbea9230953a05e5ebed35954e765da338b09e","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/cinder/+spec/remove-volume-manager-locks"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The Cinder volume manager currently has locks around several methods.  These"},{"line_number":14,"context_line":"locks slow performance in a high availability environment by only allowing"},{"line_number":15,"context_line":"one action to occur at a time.  By removing these locks the methods will"},{"line_number":16,"context_line":"be able to run multiple requests in parallel."}],"source_content_type":"text/x-rst","patch_set":1,"id":"da86d52c_0987e0b5","line":13,"updated":"2015-02-06 04:44:05.000000000","message":"local file locks.\n\nThe problem with the locks is not only a performance problem, but more importantly because of not working when another cinder instance is running on another host.","commit_id":"3277b53040ea1e297cf7013d5aebbba8c6d9f540"},{"author":{"_account_id":11903,"name":"Anthony Lee","email":"anthony.mic.lee@hpe.com","username":"leeantho"},"change_message_id":"bf92190420e629fd1228b03ba329dea77ff28d25","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/cinder/+spec/remove-volume-manager-locks"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The Cinder volume manager currently has locks around several methods.  These"},{"line_number":14,"context_line":"locks slow performance in a high availability environment by only allowing"},{"line_number":15,"context_line":"one action to occur at a time.  By removing these locks the methods will"},{"line_number":16,"context_line":"be able to run multiple requests in parallel."}],"source_content_type":"text/x-rst","patch_set":1,"id":"da86d52c_d5729fe2","line":13,"in_reply_to":"da86d52c_0987e0b5","updated":"2015-02-06 21:44:01.000000000","message":"Done","commit_id":"3277b53040ea1e297cf7013d5aebbba8c6d9f540"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"6648372ac554258e918b55bebd599c79db222023","unresolved":false,"context_lines":[{"line_number":30,"context_line":"delete_snapshot"},{"line_number":31,"context_line":"detach_volume"},{"line_number":32,"context_line":"attach_volume (lock is around do_attach)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"There is also _run_flow_locked() that has a lock but that lock would not"},{"line_number":35,"context_line":"be touched."},{"line_number":36,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_b45d12ef","line":33,"updated":"2015-02-09 06:07:54.000000000","message":"Does removing the locks from volume manager have any impact on the drivers since they are running in the same process?","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":11903,"name":"Anthony Lee","email":"anthony.mic.lee@hpe.com","username":"leeantho"},"change_message_id":"e2f10d8b94592522eb8092832c9f1979f91b03ea","unresolved":false,"context_lines":[{"line_number":30,"context_line":"delete_snapshot"},{"line_number":31,"context_line":"detach_volume"},{"line_number":32,"context_line":"attach_volume (lock is around do_attach)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"There is also _run_flow_locked() that has a lock but that lock would not"},{"line_number":35,"context_line":"be touched."},{"line_number":36,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_20fc5c3e","line":33,"in_reply_to":"da86d52c_b45d12ef","updated":"2015-02-09 19:10:04.000000000","message":"Ideally it should not negatively impact any drivers.  With race conditions handled properly the driver won\u0027t be able to access a volume that is already busy.  In the implementation the idea is to have the cinder API not call into the manager unless volume isn\u0027t busy.\n\nFor positive impacts, it will allow multiple cinder instances to perform actions on the same volume safely.\n\nNot sure if I answered your question fully.  Let me know if you need more details.\n\nThanks.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":9924,"name":"Jeegn Chen","email":"Jeegn.Chen@emc.com","username":"jeegn-chen"},"change_message_id":"1260da612891357bf41fcbda90f9170e1024cc2b","unresolved":false,"context_lines":[{"line_number":47,"context_line":"In order to remove the locks from the methods in Cinder volume manager there"},{"line_number":48,"context_line":"will need to be changes made to the Cinder volume API.  When a request is"},{"line_number":49,"context_line":"received by the Cinder volume API for any of the previously locked actions a"},{"line_number":50,"context_line":"check on the volume/snapshot status will be performed.  This check will ensure"},{"line_number":51,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":52,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_44025fb5","line":50,"updated":"2015-02-09 09:32:26.000000000","message":"Do we have utility that can combine the state checking operation and state changing operation into a single atomic operation?\n\nIf not, there will be race condition.\n\nFor example, if two requests against the same volume arrive almost at the same time and the handling threads both notice that the volume is in available state, how can we make sure only one thread go ahead instead of letting both threads get into the critical section for further changes?","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"c5e972d6379507aefa30575568c7838c2fa31fc8","unresolved":false,"context_lines":[{"line_number":47,"context_line":"In order to remove the locks from the methods in Cinder volume manager there"},{"line_number":48,"context_line":"will need to be changes made to the Cinder volume API.  When a request is"},{"line_number":49,"context_line":"received by the Cinder volume API for any of the previously locked actions a"},{"line_number":50,"context_line":"check on the volume/snapshot status will be performed.  This check will ensure"},{"line_number":51,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":52,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_d13d0dde","line":50,"in_reply_to":"3ab451fb_2e20fe9a","updated":"2015-04-27 03:19:48.000000000","message":"Still not really convinced the select prevents the thread case raised by Jeegn. Think it would be useful for us to verify that.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"5fd4097e2968207abf91b89985742e90e018b190","unresolved":false,"context_lines":[{"line_number":47,"context_line":"In order to remove the locks from the methods in Cinder volume manager there"},{"line_number":48,"context_line":"will need to be changes made to the Cinder volume API.  When a request is"},{"line_number":49,"context_line":"received by the Cinder volume API for any of the previously locked actions a"},{"line_number":50,"context_line":"check on the volume/snapshot status will be performed.  This check will ensure"},{"line_number":51,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":52,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3acd31a7_5fa640c2","line":50,"in_reply_to":"bab921fb_d13d0dde","updated":"2015-04-30 11:45:01.000000000","message":"Both Anthony\u0027s and Duncan\u0027s solutions work with Galera in multi-master configuration if a retry on deadlock is used.\nI have verified it: https://github.com/Akrog/test-cinder-atomic-states","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"da7b3ffe4929942b94998f9581ba8885e86213a2","unresolved":false,"context_lines":[{"line_number":47,"context_line":"In order to remove the locks from the methods in Cinder volume manager there"},{"line_number":48,"context_line":"will need to be changes made to the Cinder volume API.  When a request is"},{"line_number":49,"context_line":"received by the Cinder volume API for any of the previously locked actions a"},{"line_number":50,"context_line":"check on the volume/snapshot status will be performed.  This check will ensure"},{"line_number":51,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":52,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3ab451fb_2e20fe9a","line":50,"in_reply_to":"da86d52c_003cb8be","updated":"2015-04-17 12:39:55.000000000","message":"\"update status\u003d$new where id\u003d$id and status\u003d$old\" amd checking the count returned is more performant, and works on Gaera systems where select for update doesn\u0027t.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":11903,"name":"Anthony Lee","email":"anthony.mic.lee@hpe.com","username":"leeantho"},"change_message_id":"e2f10d8b94592522eb8092832c9f1979f91b03ea","unresolved":false,"context_lines":[{"line_number":47,"context_line":"In order to remove the locks from the methods in Cinder volume manager there"},{"line_number":48,"context_line":"will need to be changes made to the Cinder volume API.  When a request is"},{"line_number":49,"context_line":"received by the Cinder volume API for any of the previously locked actions a"},{"line_number":50,"context_line":"check on the volume/snapshot status will be performed.  This check will ensure"},{"line_number":51,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":52,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_003cb8be","line":50,"in_reply_to":"da86d52c_44025fb5","updated":"2015-02-09 19:10:04.000000000","message":"Yes, good point.\n\nHaving a \"SELECT .. FOR UPDATE\" database call when checking the current volume status could possibly be used to prevent this race condition.\n\nI will look into seeing if this can be used.\n\nThanks.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"c5e972d6379507aefa30575568c7838c2fa31fc8","unresolved":false,"context_lines":[{"line_number":61,"context_line":"|                |    |  in-use          |"},{"line_number":62,"context_line":"+----------------+    +------------------+"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"If an \"ING\" State is detected by the API an exception will be returned to the"},{"line_number":65,"context_line":"caller.  It will be up to the caller to catch the exception and handle it.  The"},{"line_number":66,"context_line":"exception from the volume API is similar to a lock in that it will prevent any"},{"line_number":67,"context_line":"of the previously locked actions from occuring until the volume/snapshot is"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_113825ee","line":64,"updated":"2015-04-27 03:19:48.000000000","message":"error_*ing is still \"ing\" ... I get what you\u0027re proposing here, but just sayin\u0027.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"c5e972d6379507aefa30575568c7838c2fa31fc8","unresolved":false,"context_lines":[{"line_number":73,"context_line":"The proposed solution does not require a large amount of code revisions to be"},{"line_number":74,"context_line":"made in Cinder, which some other solutions may involve."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"One alternative would be to create a new state management system."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"Data model impact"},{"line_number":79,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_b12739c9","line":76,"updated":"2015-04-27 03:19:48.000000000","message":"How is this working in conjunction with the other solutions being proposed, like a state machine? Would like there to not be conflicts later. :)\n\nhttps://review.openstack.org/110434\n\nhttps://review.openstack.org/124205\n\nhttps://review.openstack.org/149611","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"c5e972d6379507aefa30575568c7838c2fa31fc8","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"There are no changes to input parameters in the API but several methods will"},{"line_number":87,"context_line":"now have the possibility of returning an exception if a volume or snapshot"},{"line_number":88,"context_line":"is found to be in an \"ING\" state."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"The methods that will have this possibility are:"},{"line_number":91,"context_line":"begin_detaching"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bab921fb_111f056d","line":88,"updated":"2015-04-27 03:19:48.000000000","message":"aside from the \"ING\" error states, as raised above.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"da7b3ffe4929942b94998f9581ba8885e86213a2","unresolved":false,"context_lines":[{"line_number":105,"context_line":"being detached by CinderB so volA has a status of \"detaching\" set."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"CinderA will receive an exception back from begin_detaching (HTTP 500,"},{"line_number":108,"context_line":"VolumeIsBusy).  CinderA must then decide what to do based on that exception."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"Security impact"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3ab451fb_8e3152ef","line":108,"updated":"2015-04-17 12:39:55.000000000","message":"Nova currently does not handle failures in cinder calls well, so fixing up its failure case handling is a part of this work.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"5fd4097e2968207abf91b89985742e90e018b190","unresolved":false,"context_lines":[{"line_number":105,"context_line":"being detached by CinderB so volA has a status of \"detaching\" set."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"CinderA will receive an exception back from begin_detaching (HTTP 500,"},{"line_number":108,"context_line":"VolumeIsBusy).  CinderA must then decide what to do based on that exception."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"Security impact"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3acd31a7_622ba383","line":108,"in_reply_to":"3ab451fb_8e3152ef","updated":"2015-04-30 11:45:01.000000000","message":"This specific case can be solved with some simple logic, since it\u0027s the same action (detach) to be performed there is no need to throw an error. Or are we referring to a multi-attach case and both requests would be to detach from different VMs?","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"a8440e4316cbfaf5325c8f081c5dffbcd12e7d6d","unresolved":false,"context_lines":[{"line_number":121,"context_line":"Other end user impact"},{"line_number":122,"context_line":"---------------------"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"None"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"Performance Impact"},{"line_number":127,"context_line":"------------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3acd31a7_06aa8a70","line":124,"updated":"2015-05-03 08:33:46.000000000","message":"Some scripts that used to work with not waiting for an *ing state to end before submitting a new request will now fail. They were always somewhat flaky and non-deterministic, but they will now get http error codes back where they got nominal success before. \n\nI don\u0027t think this is a major issue, but I do think it should be called out while we evaluate the proposal","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"6648372ac554258e918b55bebd599c79db222023","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"Nova will need a change to a section of the detach code.  It currently does not"},{"line_number":178,"context_line":"catch exceptions if one is thrown during Cinder\u0027s detach method."},{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"Testing"},{"line_number":182,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_14aa5ed4","line":179,"updated":"2015-02-09 06:07:54.000000000","message":"Nova does not catch exception from initialize_connection either.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"55645852c63ec5f081deb6f24e8ef5958b227158","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"Nova will need a change to a section of the detach code.  It currently does not"},{"line_number":178,"context_line":"catch exceptions if one is thrown during Cinder\u0027s detach method."},{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"Testing"},{"line_number":182,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_8a3799e2","line":179,"in_reply_to":"da86d52c_14aa5ed4","updated":"2015-02-18 02:55:06.000000000","message":"we need to revisit how nova is calling Cinder to begin with.   It seems the current nova -\u003e cinder model is ripe for races.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"6648372ac554258e918b55bebd599c79db222023","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"Adding unit tests to check for the exception being thrown during situations"},{"line_number":185,"context_line":"where a volume/snapshot is in a \"ING\" state should be sufficient."},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"Documentation Impact"},{"line_number":189,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_b42b5232","line":186,"updated":"2015-02-09 06:07:54.000000000","message":"I think we should also observe if there is any impact on CI testing. Can you add a note about this?","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"551f8fef6e2a6223254abe7cd80ef1ee2e303dc8","unresolved":false,"context_lines":[{"line_number":189,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"The new exceptions thrown from some of the methods in the Cinder volume API"},{"line_number":192,"context_line":"should be documented."},{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"References"}],"source_content_type":"text/x-rst","patch_set":2,"id":"da86d52c_52502f0a","line":192,"updated":"2015-02-10 06:22:11.000000000","message":"Not sure where this will be. We don\u0027t really document this kind of information today.","commit_id":"4bedf612faadbaf4302ce2226c1c137237b5c923"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/cinder/+spec/remove-volume-manager-locks"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The Cinder volume manager currently has local file locks around several"},{"line_number":14,"context_line":"methods.  These local file locks slow performance in a high availability"},{"line_number":15,"context_line":"environment by only allowing one action to occur at a time.  Another"},{"line_number":16,"context_line":"major problem with the local file locks is that a cinder instance"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_121109b0","line":13,"updated":"2015-05-26 08:32:02.000000000","message":"I think it is more correct to remove the word \"local\", since it wouldn\u0027t be local anymore if we change default directory to an NFS share.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"9a62ad20b1d9f3b45899f06ee527e68bb1c83dfa","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/cinder/+spec/remove-volume-manager-locks"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The Cinder volume manager currently has local file locks around several"},{"line_number":14,"context_line":"methods.  These local file locks slow performance in a high availability"},{"line_number":15,"context_line":"environment by only allowing one action to occur at a time.  Another"},{"line_number":16,"context_line":"major problem with the local file locks is that a cinder instance"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_116ceb33","line":13,"in_reply_to":"7a016987_121109b0","updated":"2015-05-28 21:27:34.000000000","message":"local is fine.  absolutely no one would recommend using NFS for local file locks.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The Cinder volume manager currently has local file locks around several"},{"line_number":14,"context_line":"methods.  These local file locks slow performance in a high availability"},{"line_number":15,"context_line":"environment by only allowing one action to occur at a time.  Another"},{"line_number":16,"context_line":"major problem with the local file locks is that a cinder instance"},{"line_number":17,"context_line":"running on a different host will not be able to work in parallel with"},{"line_number":18,"context_line":"other cinder instances.  By removing these local file locks the methods"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_b25d957b","line":15,"updated":"2015-05-26 08:32:02.000000000","message":"This is misleading, they allow multiple actions to occur at a time since they lock on volume_id and function name, and this text says that only 1 action can occur at a time, regardless of volume_id.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":15,"context_line":"environment by only allowing one action to occur at a time.  Another"},{"line_number":16,"context_line":"major problem with the local file locks is that a cinder instance"},{"line_number":17,"context_line":"running on a different host will not be able to work in parallel with"},{"line_number":18,"context_line":"other cinder instances.  By removing these local file locks the methods"},{"line_number":19,"context_line":"will be able to run multiple requests in parallel."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_72d71dc0","line":18,"updated":"2015-05-26 08:32:02.000000000","message":"Although it\u0027s not a good solution, it would be able to work on different nodes if you use an NFS share for the file lock.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"9a62ad20b1d9f3b45899f06ee527e68bb1c83dfa","unresolved":false,"context_lines":[{"line_number":15,"context_line":"environment by only allowing one action to occur at a time.  Another"},{"line_number":16,"context_line":"major problem with the local file locks is that a cinder instance"},{"line_number":17,"context_line":"running on a different host will not be able to work in parallel with"},{"line_number":18,"context_line":"other cinder instances.  By removing these local file locks the methods"},{"line_number":19,"context_line":"will be able to run multiple requests in parallel."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_d14893b5","line":18,"in_reply_to":"7a016987_72d71dc0","updated":"2015-05-28 21:27:34.000000000","message":"I wouldn\u0027t ever suggest using NFS for this type of thing.  That\u0027s not even worth mentioning as an idea.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f2dcc5a46374f6066fc2ec61085d0799e5eca82c","unresolved":false,"context_lines":[{"line_number":15,"context_line":"environment by only allowing one action to occur at a time.  Another"},{"line_number":16,"context_line":"major problem with the local file locks is that a cinder instance"},{"line_number":17,"context_line":"running on a different host will not be able to work in parallel with"},{"line_number":18,"context_line":"other cinder instances.  By removing these local file locks the methods"},{"line_number":19,"context_line":"will be able to run multiple requests in parallel."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_ff5c6a1a","line":18,"in_reply_to":"7a016987_d14893b5","updated":"2015-05-29 08:11:42.000000000","message":"It\u0027s a \"poor\u0027s man solution\" to the multinode locking issue that actually works. Just because we use by default a local path doesn\u0027t mean that it is always local.\n\nAnyway, I just mentioned it in case the spec wanted to be more accurate and specific.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":31,"context_line":"detach_volume"},{"line_number":32,"context_line":"attach_volume (lock is around do_attach)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"There is also _run_flow_locked() that has a lock but that lock would not"},{"line_number":35,"context_line":"be touched."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_77e6ec45","line":34,"updated":"2015-05-26 08:32:02.000000000","message":"That lock should be touched as well, otherwise you can have other nodes deleting a snapshot, volume or replica you are using to create a volume.\n\nI don\u0027t know what\u0027s the best solution for that lock, since you need to prevent deletion but you should allow multiple nodes to create volumes, backup it, etc. at the same time and not allow deletion until all operations have completed.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"51a5dad821709c7030e7c5c88ccff9d7d20ee3bd","unresolved":false,"context_lines":[{"line_number":31,"context_line":"detach_volume"},{"line_number":32,"context_line":"attach_volume (lock is around do_attach)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"There is also _run_flow_locked() that has a lock but that lock would not"},{"line_number":35,"context_line":"be touched."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa32b979_287f2be1","line":34,"in_reply_to":"7a016987_77e6ec45","updated":"2015-06-24 06:43:04.000000000","message":"I agree with Gorka.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":47,"context_line":"In order to remove the locks from the methods in Cinder volume manager there"},{"line_number":48,"context_line":"will need to be changes made to the Cinder volume API.  When a request is"},{"line_number":49,"context_line":"received by the Cinder volume API for any of the previously locked actions a"},{"line_number":50,"context_line":"check on the volume/snapshot status will be performed.  This check will ensure"},{"line_number":51,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":52,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_74338af7","line":50,"updated":"2015-05-26 08:32:02.000000000","message":"I think it\u0027s worth mentioning in the specs that we\u0027ll be doing a compare and swap action on the status and not a check first and later on a change to the status, as this would allow race conditions like the ones we have now in some places.\n\nOtherwise we wouldn\u0027t be able to do atomic state changes and assure that we are effectively doing the lock.\n\nThis was mentioned in previous patches.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9abfd4c94391d0dd243a04a27fe216d601afbd7a","unresolved":false,"context_lines":[{"line_number":61,"context_line":"|                |    |  in-use          |"},{"line_number":62,"context_line":"+----------------+    +------------------+"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"If an \"ING\" State is detected by the API an exception will be returned to the"},{"line_number":65,"context_line":"caller.  It will be up to the caller to catch the exception and handle it.  The"},{"line_number":66,"context_line":"exception from the volume API is similar to a lock in that it will prevent any"},{"line_number":67,"context_line":"of the previously locked actions from occuring until the volume/snapshot is"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5afe65bd_33982fc0","line":64,"updated":"2015-06-03 17:50:07.000000000","message":"Volume migration specs for L [1] may add a different state that doesn\u0027t end in ING as discussed in Cinder Meeting [2] from 16:10:44 to 16:26:02, maintenance has been discussed and looks like the best candidate.\n\n[1]: https://review.openstack.org/#/c/186327/\n[2]: http://eavesdrop.openstack.org/meetings/cinder/2015/cinder.2015-06-03-16.00.log.html","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31f0f8bfb63d6a97dda1ed61886b76f7ee1018e3","unresolved":false,"context_lines":[{"line_number":62,"context_line":"+----------------+    +------------------+"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"If an \"ING\" State is detected by the API an exception will be returned to the"},{"line_number":65,"context_line":"caller.  It will be up to the caller to catch the exception and handle it.  The"},{"line_number":66,"context_line":"exception from the volume API is similar to a lock in that it will prevent any"},{"line_number":67,"context_line":"of the previously locked actions from occuring until the volume/snapshot is"},{"line_number":68,"context_line":"available."}],"source_content_type":"text/x-rst","patch_set":3,"id":"1a4dcd0f_f33f8bd4","line":65,"updated":"2015-08-03 18:59:15.000000000","message":"You can\u0027t do this in the v2 API IMO since it\u0027s a backwards incompatible change which breaks nova and any other users of the volume API (speaking as a nova core).\n\nI\u0027d think that something like this would break Tempest right away which means it\u0027s breaking the API.  If cinder had microversions then that might be a path forward, else you could be talking about cinder v3 API (note that I\u0027m coming into this conversation very late so all of this might have already been said and fought over).\n\nI guess the problem with a v2.x microversion or v3 API is still that the locks are removed from the underlying code so that\u0027s going to impact any API regardless, so if you did this only in a new API version you\u0027d have to change the v1/v2 APIs to mimic the existing locking mechanism that the volume manager was doing before it was removed, and then only the new API version has the new behavior, which all seems like a pain in the ass.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":13997,"name":"SHIGEMATSU Mitsuhiro","email":"shigematsu.mitsuhiro@lab.ntt.co.jp","username":"pshige"},"change_message_id":"2afe0ab0dee993b87f79bdea6e5e07249d14fdfb","unresolved":false,"context_lines":[{"line_number":64,"context_line":"If an \"ING\" State is detected by the API an exception will be returned to the"},{"line_number":65,"context_line":"caller.  It will be up to the caller to catch the exception and handle it.  The"},{"line_number":66,"context_line":"exception from the volume API is similar to a lock in that it will prevent any"},{"line_number":67,"context_line":"of the previously locked actions from occuring until the volume/snapshot is"},{"line_number":68,"context_line":"available."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Alternatives"}],"source_content_type":"text/x-rst","patch_set":3,"id":"da20952f_62e7f5e4","line":67,"updated":"2015-08-27 14:19:25.000000000","message":"s/occuring/occurring/","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"51a5dad821709c7030e7c5c88ccff9d7d20ee3bd","unresolved":false,"context_lines":[{"line_number":65,"context_line":"caller.  It will be up to the caller to catch the exception and handle it.  The"},{"line_number":66,"context_line":"exception from the volume API is similar to a lock in that it will prevent any"},{"line_number":67,"context_line":"of the previously locked actions from occuring until the volume/snapshot is"},{"line_number":68,"context_line":"available."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Alternatives"},{"line_number":71,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa32b979_03900842","line":68,"updated":"2015-06-24 06:43:04.000000000","message":"When creating a new volume B from a volume A(with --source-volid), the file cinder-[A uuid]-delete_volume is locked, and its status is available. In this case, with local file lock mechanism, volume A can\u0027t be deleted until volume B finishes creation.\nAs volume A is available, if just checking status, it will be deleted. This should not be allowed.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"0d5fd4d75a8e02029542e1b67a5c744d62fc1ced","unresolved":false,"context_lines":[{"line_number":65,"context_line":"caller.  It will be up to the caller to catch the exception and handle it.  The"},{"line_number":66,"context_line":"exception from the volume API is similar to a lock in that it will prevent any"},{"line_number":67,"context_line":"of the previously locked actions from occuring until the volume/snapshot is"},{"line_number":68,"context_line":"available."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Alternatives"},{"line_number":71,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba3cc151_460ad822","line":68,"in_reply_to":"fa32b979_03900842","updated":"2015-07-01 03:06:43.000000000","message":"+1","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f7cbbf4b61e552da594162d3814aa87b2186f701","unresolved":false,"context_lines":[{"line_number":65,"context_line":"caller.  It will be up to the caller to catch the exception and handle it.  The"},{"line_number":66,"context_line":"exception from the volume API is similar to a lock in that it will prevent any"},{"line_number":67,"context_line":"of the previously locked actions from occuring until the volume/snapshot is"},{"line_number":68,"context_line":"available."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"Alternatives"},{"line_number":71,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"ba3cc151_106f1b93","line":68,"in_reply_to":"fa32b979_03900842","updated":"2015-07-01 08:21:37.000000000","message":"As far as I understand it, this spec is not trying to solve all the locks we currently have, just some.\n\nIn a recent mail thread [1] I mentioned the 3 different kind of locks we have:\n\n 1- Locking multiple writing access to a resource\n 2- Prevent modification of a resource being used for reading\n 3- Backend drivers\n\nThis is trying to remove type 1.\n\n[1]: http://lists.openstack.org/pipermail/openstack-dev/2015-June/068254.html","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"There are no changes to input parameters in the API but several methods will"},{"line_number":87,"context_line":"now have the possibility of returning an exception if a volume or snapshot"},{"line_number":88,"context_line":"is found to be in an \"ING\" state."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"The methods that will have this possibility are:"},{"line_number":91,"context_line":"begin_detaching"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_5473ee15","line":88,"updated":"2015-05-26 08:32:02.000000000","message":"Like Mike said, it should be explicitly stated that error_deleting and error_detaching are exceptions.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":97,"context_line":"possibly others"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The expected error http response code for when a volume/snapshot is busy"},{"line_number":100,"context_line":"would be HTTP 500."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Example:"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_14f21670","line":100,"updated":"2015-05-26 08:32:02.000000000","message":"I think 409 Conflict is the appropriate response and not 500.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31f0f8bfb63d6a97dda1ed61886b76f7ee1018e3","unresolved":false,"context_lines":[{"line_number":97,"context_line":"possibly others"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The expected error http response code for when a volume/snapshot is busy"},{"line_number":100,"context_line":"would be HTTP 500."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Example:"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"1a4dcd0f_b03fb424","line":100,"in_reply_to":"5afe65bd_c593564e","updated":"2015-08-03 18:59:15.000000000","message":"http://specs.openstack.org/openstack/api-wg/guidelines/evaluating_api_changes.html\n\nThe following types of changes are generally not considered acceptable:\n\nA change such that a request which was successful before now results in an error response (unless the success reported previously was hiding an existing error condition).\n\n--\n\nThat seems to sum up the issue here from the client perspective.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"f0b5795e5182d83a0d6f4a633e69552defc9cb42","unresolved":false,"context_lines":[{"line_number":97,"context_line":"possibly others"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The expected error http response code for when a volume/snapshot is busy"},{"line_number":100,"context_line":"would be HTTP 500."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Example:"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5afe65bd_c593564e","line":100,"in_reply_to":"5afe65bd_d6dc4de6","updated":"2015-06-03 16:58:58.000000000","message":"It\u0027s never ok to knowingly return a 500. In this case it is absolutely a 409 conflict because the current state of the system does not permit the action but a future state might. \n\n@Patrick, your right, 423 is special. Also, i wouldn\u0027t even use the word locked in our case because the resource isn\u0027t locked because there are some requests you can still perform.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f2dcc5a46374f6066fc2ec61085d0799e5eca82c","unresolved":false,"context_lines":[{"line_number":97,"context_line":"possibly others"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The expected error http response code for when a volume/snapshot is busy"},{"line_number":100,"context_line":"would be HTTP 500."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Example:"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_df276eb4","line":100,"in_reply_to":"7a016987_11018b38","updated":"2015-05-29 08:11:42.000000000","message":"423 makes a lot of sense, since we can return the same error with resources locked using other mechanism than the ING states - like when we lock a volume because it\u0027s being used as the source for creating another volume.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"9a62ad20b1d9f3b45899f06ee527e68bb1c83dfa","unresolved":false,"context_lines":[{"line_number":97,"context_line":"possibly others"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The expected error http response code for when a volume/snapshot is busy"},{"line_number":100,"context_line":"would be HTTP 500."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Example:"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_11018b38","line":100,"in_reply_to":"7a016987_14f21670","updated":"2015-05-28 21:27:34.000000000","message":"Actually a 423 is a better error code.    423 \u003d Locked","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"7527c9ea4135cf1f5937aae9efee7b84834e5b1b","unresolved":false,"context_lines":[{"line_number":97,"context_line":"possibly others"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The expected error http response code for when a volume/snapshot is busy"},{"line_number":100,"context_line":"would be HTTP 500."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"Example:"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5afe65bd_d6dc4de6","line":100,"in_reply_to":"7a016987_df276eb4","updated":"2015-06-03 03:49:49.000000000","message":"Isn\u0027t this a server error though? I\u0027m under the impression that this would be a valid request, but the server isn\u0027t in a state to be able to handle it, which should fall into the 500\u0027s and not a 400\u0027s client error.\n\nIf you guys really want a 400 error I would lean towards 409... some brief googling of 423 (hadn\u0027t heard of it before) leads me to understand that it is a WebDAV thing designed for use with the LOCK and UNLOCK HTTP requests, lock tokens, and a bunch of other junk (https://tools.ietf.org/html/rfc4918#section-6). 409 is for a conflict with the request... which is more like what happened as would be in the middle of processing a conflicting request.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31f0f8bfb63d6a97dda1ed61886b76f7ee1018e3","unresolved":false,"context_lines":[{"line_number":104,"context_line":"CinderA calls begin_detaching to begin detaching volA, but volA is already"},{"line_number":105,"context_line":"being detached by CinderB so volA has a status of \"detaching\" set."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"CinderA will receive an exception back from begin_detaching (HTTP 500,"},{"line_number":108,"context_line":"VolumeIsBusy).  CinderA must then decide what to do based on that exception."},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"1a4dcd0f_70492cd0","line":107,"updated":"2015-08-03 18:59:15.000000000","message":"No 500.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"5cd59505c1490ec5b29093cc3e11cf33c1d8c21b","unresolved":false,"context_lines":[{"line_number":121,"context_line":"Other end user impact"},{"line_number":122,"context_line":"---------------------"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"None"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"Performance Impact"},{"line_number":127,"context_line":"------------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_2e9ba019","line":124,"updated":"2015-05-23 23:50:11.000000000","message":"It\u0027s an API change, that always has some impact. In particular, some operations that got a success response before may now get failure","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"47dff4400c800725e19f4f4d22909dba6bd5c4ee","unresolved":false,"context_lines":[{"line_number":121,"context_line":"Other end user impact"},{"line_number":122,"context_line":"---------------------"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"None"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"Performance Impact"},{"line_number":127,"context_line":"------------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"3afb71cf_223e4228","line":124,"in_reply_to":"5afe65bd_faaeec83","updated":"2015-06-10 10:18:50.000000000","message":"The success you currently get is quite possibly hiding an error, but only in a subset of cases. Definitely not clear cut.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"f0b5795e5182d83a0d6f4a633e69552defc9cb42","unresolved":false,"context_lines":[{"line_number":121,"context_line":"Other end user impact"},{"line_number":122,"context_line":"---------------------"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"None"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"Performance Impact"},{"line_number":127,"context_line":"------------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"5afe65bd_faaeec83","line":124,"in_reply_to":"7a016987_2e9ba019","updated":"2015-06-03 16:58:58.000000000","message":"I\u0027m not sure it\u0027s ok to change the API to return a 409 instead of the current behavior of accepting the request and eventually working. Please see \"The following types of changes are generally not considered acceptable:..A change such that a request which was successful before now results in an error response (unless the success reported previously was hiding an existing error condition).\" in https://github.com/openstack/api-wg/blob/master/guidelines/evaluating_api_changes.rst","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"47dff4400c800725e19f4f4d22909dba6bd5c4ee","unresolved":false,"context_lines":[{"line_number":127,"context_line":"------------------"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"Performance should be improved for situations where multiple Cinder instances"},{"line_number":130,"context_line":"are attempting to do volume actions on the same backend."},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"Other deployer impact"},{"line_number":133,"context_line":"---------------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"3afb71cf_62855acd","line":130,"updated":"2015-06-10 10:18:50.000000000","message":"Why? Clients will now be polling more, and nothing has actually changed to make anything faster I don\u0027t think. Performance in aggregate is likely to be slightly worse due to polling and extra DB operations on the API end.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31f0f8bfb63d6a97dda1ed61886b76f7ee1018e3","unresolved":false,"context_lines":[{"line_number":132,"context_line":"Other deployer impact"},{"line_number":133,"context_line":"---------------------"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"None"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"Developer impact"},{"line_number":138,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"1a4dcd0f_30608435","line":135,"updated":"2015-08-03 18:59:15.000000000","message":"There would totally be deployer upgrade impacts here right?  If you did this, Nova would need to be updated to handle the errors which means you need to upgrade Nova with this code before you can upgrade Cinder to the level that starts sending the exceptions - and that\u0027s not something that\u0027s been required before as far as I know, i.e. today I should be able to run Kilo Nova and Liberty Cinder and it should be fine.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":145,"context_line":"delete_volume"},{"line_number":146,"context_line":"delete_snapshot"},{"line_number":147,"context_line":"detach_volume"},{"line_number":148,"context_line":"do_attach (inside of the attach_volume method)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"Implementation"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_54ff6eaa","line":148,"updated":"2015-05-26 08:32:02.000000000","message":"There are other methods that should return exceptions as well; like detach_volume, migrate_volume, retype...","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"Add checks for \"ING\" states to appropriate Cinder volume API methods."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"Create unit tests to test the \"ING\" status checking."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Dependencies"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_941cc614","line":171,"updated":"2015-05-26 08:32:02.000000000","message":"This is quite the change, what about functional tests?","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"056c16d455e55a27c9c0c19bfedd7b3141a52d6c","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"Add checks for \"ING\" states to appropriate Cinder volume API methods."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"Create unit tests to test the \"ING\" status checking."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Dependencies"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_577d30b0","line":171,"in_reply_to":"7a016987_941cc614","updated":"2015-05-26 09:01:00.000000000","message":"Fixing up tempest test is going to be necessary anyway - currently they make some rather broken assumptions about how things work. We might as well get some decent tempest coverage for these cases, though the exception cases are hard since most of the *ING states are tremporary, so any test is going to be racy / non-deterministic","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"023309f149b2e02bab9269792276bf996dc4de1c","unresolved":false,"context_lines":[{"line_number":175,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"Nova will need a change to a section of the detach code.  It currently does not"},{"line_number":178,"context_line":"catch exceptions if one is thrown during Cinder\u0027s detach method."},{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"Testing"}],"source_content_type":"text/x-rst","patch_set":3,"id":"3a50d1a3_59c0b67c","line":178,"updated":"2015-07-30 23:35:38.000000000","message":"https://bugs.launchpad.net/nova/+bug/1458958 filed for this.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":182,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"Adding unit tests to check for the exception being thrown during situations"},{"line_number":185,"context_line":"where a volume/snapshot is in a \"ING\" state should be sufficient."},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"Documentation Impact"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_f4b2da05","line":185,"updated":"2015-05-26 08:32:02.000000000","message":"Functional tests?","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31f0f8bfb63d6a97dda1ed61886b76f7ee1018e3","unresolved":false,"context_lines":[{"line_number":182,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"Adding unit tests to check for the exception being thrown during situations"},{"line_number":185,"context_line":"where a volume/snapshot is in a \"ING\" state should be sufficient."},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"Documentation Impact"}],"source_content_type":"text/x-rst","patch_set":3,"id":"1a4dcd0f_704e0cc3","line":185,"in_reply_to":"7a016987_f4b2da05","updated":"2015-08-03 18:59:15.000000000","message":"You would totally need Tempest coverage for API changes.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ced9e06d4b9f984447486d0b6a8dbf1989057ee7","unresolved":false,"context_lines":[{"line_number":189,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"The new exceptions thrown from some of the methods in the Cinder volume API"},{"line_number":192,"context_line":"should be documented."},{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"References"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7a016987_34875214","line":192,"updated":"2015-05-26 08:32:02.000000000","message":"If we are removing locks we might as well mention it when referring to lock_path configuration option.","commit_id":"9af4aa0d9842cb6ab0d8f2a9650b97f8bf4d2208"}],"specs/mitaka/remove-volume-manager-locks.rst":[{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"d1200bf1e0eccc18badb733006dc7edc1a0a052a","unresolved":false,"context_lines":[{"line_number":49,"context_line":"received by the Cinder volume API for any of the previously locked actions a"},{"line_number":50,"context_line":"check on the volume/snapshot status will be performed.  To avoid possible race"},{"line_number":51,"context_line":"conditions with fetching the volume and checking status, and then updating, we"},{"line_number":52,"context_line":"will be doing a db compare and swap operation on the status.  This will ensure"},{"line_number":53,"context_line":"an atomic state change for the volume.  This check will ensure"},{"line_number":54,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":55,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"ba15a1d1_35e8197c","line":52,"updated":"2015-09-22 20:32:02.000000000","message":"Could link to Gorka\u0027s patches for atomic state change here or in Dependencies.","commit_id":"43b59806607bd80b056f3a828f3f43ffb5f02693"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"d1200bf1e0eccc18badb733006dc7edc1a0a052a","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"In order to implement this new API change, this proposal will require the "},{"line_number":75,"context_line":"microversion API feature set.  We cannot break backwards compatibility with"},{"line_number":76,"context_line":"Nova.  "},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"Alternatives"}],"source_content_type":"text/x-rst","patch_set":4,"id":"ba15a1d1_55d4adbb","line":76,"updated":"2015-09-22 20:32:02.000000000","message":"Could list these here or under Dependencies:\nhttps://review.openstack.org/#/c/223803/      # spec\nhttps://review.openstack.org/#/c/224910/       # code","commit_id":"43b59806607bd80b056f3a828f3f43ffb5f02693"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"1b91afd6dd3d9c8ce1fa28e825db704df888a4ad","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"In order to implement this new API change, this proposal will require the "},{"line_number":75,"context_line":"microversion API feature set.  We cannot break backwards compatibility with"},{"line_number":76,"context_line":"Nova.  "},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"Alternatives"}],"source_content_type":"text/x-rst","patch_set":4,"id":"ba15a1d1_9fe7be3f","line":76,"in_reply_to":"ba15a1d1_55d4adbb","updated":"2015-09-22 23:04:27.000000000","message":"Done","commit_id":"43b59806607bd80b056f3a828f3f43ffb5f02693"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":31,"context_line":"detach_volume"},{"line_number":32,"context_line":"attach_volume (lock is around do_attach)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"There is also _run_flow_locked() that has a lock but that lock would not"},{"line_number":35,"context_line":"be touched."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_88953c34","line":34,"updated":"2015-09-23 10:11:03.000000000","message":"_run_flow_locked is cooperating with aforementioned locks. Take a look at https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L516-L526. We\u0027re locking on delete_volume and delete_snapshot to prevent the removal of the source volume, replica or snapshot while creating the volume.\n\nSumming up - I don\u0027t think that this run_flow_locked has sense once locks on delete_volume and delete_snapshots get removed.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8354c6af80cd6f05d7e55745e35637a8c097935c","unresolved":false,"context_lines":[{"line_number":31,"context_line":"detach_volume"},{"line_number":32,"context_line":"attach_volume (lock is around do_attach)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"There is also _run_flow_locked() that has a lock but that lock would not"},{"line_number":35,"context_line":"be touched."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"}],"source_content_type":"text/x-rst","patch_set":5,"id":"9a1a9d01_b6aa4a18","line":34,"in_reply_to":"ba15a1d1_33e4863a","updated":"2015-09-25 07:46:31.000000000","message":"I mean that the lock on _run_flow_locked is blocking on delete_volume and delete_snapshot locks. This mean that if we remove these two lock on _run_flow_locked becomes almost useless. It will prevent only from creating two volumes from one snapshot/src_vol. In my opinion \"not touching it\" isn\u0027t the way to go.\n\nThis is my understanding of the code, maybe I\u0027m missing something?","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8ae26a32f36e558349c790da30c32a9a402daefd","unresolved":false,"context_lines":[{"line_number":31,"context_line":"detach_volume"},{"line_number":32,"context_line":"attach_volume (lock is around do_attach)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"There is also _run_flow_locked() that has a lock but that lock would not"},{"line_number":35,"context_line":"be touched."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_33e4863a","line":34,"in_reply_to":"ba15a1d1_88953c34","updated":"2015-09-23 22:27:40.000000000","message":"I\u0027m not sure I follow what you are getting at here.   I understand that we have the lock here in place for preventing the originating volume/snap from being deleted while we are creating a new volume from it.  The ING checks don\u0027t really account for this one, unless we automatically put the source volume/snap into an \u0027ing\u0027 state while the process is ongoing.  If that process fails, then the source vol will be left in the \u0027ing\u0027 state until someone/something cleans it up.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"},{"line_number":38,"context_line":"instances are communicating with the same backend.  Each Cinder instance can"},{"line_number":39,"context_line":"be trying to perform actions against the same volume on the backend but"},{"line_number":40,"context_line":"currently one of them will be blocked until the other Cinder instance\u0027s request"},{"line_number":41,"context_line":"is completed."},{"line_number":42,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_68b788d8","line":39,"updated":"2015-09-23 10:11:03.000000000","message":"It would be more understandable if you\u0027ve mentioned that you\u0027re talking about *reading* actions (like creating a snapshot from, etc.).","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8ae26a32f36e558349c790da30c32a9a402daefd","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"},{"line_number":38,"context_line":"instances are communicating with the same backend.  Each Cinder instance can"},{"line_number":39,"context_line":"be trying to perform actions against the same volume on the backend but"},{"line_number":40,"context_line":"currently one of them will be blocked until the other Cinder instance\u0027s request"},{"line_number":41,"context_line":"is completed."},{"line_number":42,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_b33df68f","line":39,"in_reply_to":"ba15a1d1_68b788d8","updated":"2015-09-23 22:27:40.000000000","message":"This isn\u0027t just about reading states though.   You could have a request to attach a volume come in at the same time as a delete.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8354c6af80cd6f05d7e55745e35637a8c097935c","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The primary use case where this problem arises is when multiple Cinder"},{"line_number":38,"context_line":"instances are communicating with the same backend.  Each Cinder instance can"},{"line_number":39,"context_line":"be trying to perform actions against the same volume on the backend but"},{"line_number":40,"context_line":"currently one of them will be blocked until the other Cinder instance\u0027s request"},{"line_number":41,"context_line":"is completed."},{"line_number":42,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"9a1a9d01_7663521b","line":39,"in_reply_to":"ba15a1d1_b33df68f","updated":"2015-09-25 07:46:31.000000000","message":"Good point.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":74,"context_line":"In order to implement this new API change, this proposal will require the"},{"line_number":75,"context_line":"microversion API feature set.  We cannot break backwards compatibility with"},{"line_number":76,"context_line":"Nova."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"Alternatives"},{"line_number":80,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_c8dfb4d4","line":77,"updated":"2015-09-23 10:11:03.000000000","message":"One thing isn\u0027t explained here. How do we prevent a source volume from being deleted while we\u0027re creating another one from it? We would need either to set source volume to some \u0027reading\u0027 state or check the DB for volumes in \u0027creating\u0027 state that have source_volid set to the volume we wan\u0027t to delete.\n\nIn the first case - who will remove \u0027reading\u0027 state once finished? What happens in failure of that component? How do we implement multiple readers reliably and lock-free?\n\nSecond idea seem to work, but are we sure we\u0027re not introducing a performance issue?","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8ae26a32f36e558349c790da30c32a9a402daefd","unresolved":false,"context_lines":[{"line_number":74,"context_line":"In order to implement this new API change, this proposal will require the"},{"line_number":75,"context_line":"microversion API feature set.  We cannot break backwards compatibility with"},{"line_number":76,"context_line":"Nova."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"Alternatives"},{"line_number":80,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_10efedb1","line":77,"in_reply_to":"ba15a1d1_c8dfb4d4","updated":"2015-09-23 22:27:40.000000000","message":"I tend to like the idea of checking for volumes in creating state where source_volid is the same as the volume being requested for deletion.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":79,"context_line":"Alternatives"},{"line_number":80,"context_line":"------------"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"One alternative would be to create a new state management system."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"Data model impact"},{"line_number":85,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_a8c12031","line":82,"updated":"2015-09-23 10:11:03.000000000","message":"Just for the record - another alternative would probably be to use distributed shared locks. We\u0027ve decided against that at Cinder\u0027s midcycle meetup.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":174,"context_line":"Remove locks currently in the Cinder volume manager that are around"},{"line_number":175,"context_line":"delete_volume, delete_snapshot, detach_volume and do_attach in attach_volume."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"Add checks for \"ING\" states to appropriate Cinder volume API methods."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"Create unit tests to test the \"ING\" status checking."},{"line_number":180,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_e8f95881","line":177,"updated":"2015-09-23 10:11:03.000000000","message":"I think we also need all the Gorka\u0027s work with API race conditions to get in first.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8ae26a32f36e558349c790da30c32a9a402daefd","unresolved":false,"context_lines":[{"line_number":174,"context_line":"Remove locks currently in the Cinder volume manager that are around"},{"line_number":175,"context_line":"delete_volume, delete_snapshot, detach_volume and do_attach in attach_volume."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"Add checks for \"ING\" states to appropriate Cinder volume API methods."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"Create unit tests to test the \"ING\" status checking."},{"line_number":180,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_26d0cd1e","line":177,"in_reply_to":"ba15a1d1_e8f95881","updated":"2015-09-23 22:27:40.000000000","message":"Done","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":186,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_8831bc5c","line":187,"updated":"2015-09-23 10:11:03.000000000","message":"Just a nit, but hey, 3 spaces? ;)","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8ae26a32f36e558349c790da30c32a9a402daefd","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":186,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_2b8bb8c4","line":187,"in_reply_to":"ba15a1d1_8831bc5c","updated":"2015-09-23 22:27:40.000000000","message":"Done","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":185,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":186,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "},{"line_number":191,"context_line":"accordingly in all interactions with Cinder API calls."}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_a84600be","line":188,"updated":"2015-09-23 10:11:03.000000000","message":"How do we support backward compatibility? Loop the calls in the API itself? Resort to locks? I think microversions are on c-api level, and this spec want to mess with c-vol locks.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"79b352eef6e68c7b155459d4f6deede06eb21d82","unresolved":false,"context_lines":[{"line_number":185,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":186,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "},{"line_number":191,"context_line":"accordingly in all interactions with Cinder API calls."}],"source_content_type":"text/x-rst","patch_set":5,"id":"9a1a9d01_f11d1567","line":188,"in_reply_to":"9a1a9d01_b990fb96","updated":"2015-09-25 17:16:33.000000000","message":"For the old version of the API request, we have to have the same behavior as we do now, so we\u0027ll have to keep the locks in place for the old calls.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"8354c6af80cd6f05d7e55745e35637a8c097935c","unresolved":false,"context_lines":[{"line_number":185,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":186,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "},{"line_number":191,"context_line":"accordingly in all interactions with Cinder API calls."}],"source_content_type":"text/x-rst","patch_set":5,"id":"9a1a9d01_b990fb96","line":188,"in_reply_to":"ba15a1d1_8ba1a448","updated":"2015-09-25 07:46:31.000000000","message":"The problem I see is that we need to know microversion of a request inside c-vol. There are two cases then:\n\na) New behavior - no locks in c-vol, requests return VolumeIsBusy on an API level.\nb) Old behavior - API passes request, c-vol queues it using locks.\n\nAn example of problematic sequence would be:\n1) Request volume x creation from snapshot y.\n2) Request snapshot y deletion while volume x is being created.\n\nThe old behavior is to queue delete request until volume x is created. This is achieved through lock. Now in new behavior we want to return VolumeIsBusy - that\u0027s fine.\n\nThe question is - how do we achieve old behavior in c-vol once we remove locks? Either we need to use same lock mechanism if request is from old microversion or loop the calls on c-api level.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8ae26a32f36e558349c790da30c32a9a402daefd","unresolved":false,"context_lines":[{"line_number":185,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":186,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "},{"line_number":191,"context_line":"accordingly in all interactions with Cinder API calls."}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_8ba1a448","line":188,"in_reply_to":"ba15a1d1_a84600be","updated":"2015-09-23 22:27:40.000000000","message":"1) We have to use microversions in the API.\n\n2) When the version used is the base/old/original version, then we\u0027ll have to use the existing locking mechanism, or distributed locks, and we won\u0027t be able to raise the VolumeIsBusy exceptions.  This the downside to doing microversioning and supporting backwards compatible APIs.  It\u0027s quite a bit of overhead, but hopefully it\u0027s a write once and forget, that is until we remove the older supported version.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"935f7e1afc7fe6c306dca5b3dbc6562597951f71","unresolved":false,"context_lines":[{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "},{"line_number":191,"context_line":"accordingly in all interactions with Cinder API calls."},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"https://review.openstack.org/#/c/223803/"}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_c88a5464","line":190,"updated":"2015-09-23 10:11:03.000000000","message":"Trailing space.","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"8ae26a32f36e558349c790da30c32a9a402daefd","unresolved":false,"context_lines":[{"line_number":187,"context_line":"the new API microversion capability in Cinder.   We will bump the microversion"},{"line_number":188,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them "},{"line_number":191,"context_line":"accordingly in all interactions with Cinder API calls."},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"https://review.openstack.org/#/c/223803/"}],"source_content_type":"text/x-rst","patch_set":5,"id":"ba15a1d1_4b886cc5","line":190,"in_reply_to":"ba15a1d1_c88a5464","updated":"2015-09-23 22:27:40.000000000","message":"Done","commit_id":"a383127619559ff28bf5360c3f62e0910ff232d3"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"3ec68dc985d1fd9a6931b2ac776949ff35ee1ab4","unresolved":false,"context_lines":[{"line_number":53,"context_line":"an atomic state change for the volume.  This check will ensure"},{"line_number":54,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":55,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"+----------------+    +------------------+"},{"line_number":58,"context_line":"|  \"ING\" States  |    |   Other States   |"},{"line_number":59,"context_line":"+----------------+    +------------------+"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_040169ae","line":56,"updated":"2015-09-25 18:07:21.000000000","message":"We do this already by an exclusionary method don\u0027t we:\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L368\n\nThat seems to catch all of the \"ING\" states as you call them here.\n\nAs does this one for delete_snapshot:\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L932\n\nattach/detach we have the same type of checks in the manager, they should be bumped up to volume/api I think:\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L852","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"a8156a4dbae28fd6d8b8e8d8d6ced19fca9971fa","unresolved":false,"context_lines":[{"line_number":53,"context_line":"an atomic state change for the volume.  This check will ensure"},{"line_number":54,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":55,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"+----------------+    +------------------+"},{"line_number":58,"context_line":"|  \"ING\" States  |    |   Other States   |"},{"line_number":59,"context_line":"+----------------+    +------------------+"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_f43bb6e9","line":56,"in_reply_to":"9a1a9d01_024719bc","updated":"2015-09-26 04:20:49.000000000","message":"Indeed!  Thanks!!  The create from volume and create from snap are in fact that main reason for the locks it appears.  New state would fix that up I think don\u0027t you?  We could do something like introduce \"transferring\" state.\n\nOf course it needs clear and consistent enforcement/implementation as proposed in this spec.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"38ef3f49d8490f83c597f9837bdbc0595cc95638","unresolved":false,"context_lines":[{"line_number":53,"context_line":"an atomic state change for the volume.  This check will ensure"},{"line_number":54,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":55,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"+----------------+    +------------------+"},{"line_number":58,"context_line":"|  \"ING\" States  |    |   Other States   |"},{"line_number":59,"context_line":"+----------------+    +------------------+"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_024719bc","line":56,"in_reply_to":"9a1a9d01_040169ae","updated":"2015-09-25 18:51:23.000000000","message":"So, yes you are correct that we do some checks to make sure the state is something we want to allow.  I believe the reason why the locks were put in place is when there are concurrent requests for the same action and not necessarily to check to make sure the state transition is allowed.\n\nhttps://github.com/openstack/cinder/commit/4f6e5fcc252799e2b9207b6ef2b58b52a7a93563","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e940b9ba2c2a6c7a6221a3930573f083d435abaa","unresolved":false,"context_lines":[{"line_number":53,"context_line":"an atomic state change for the volume.  This check will ensure"},{"line_number":54,"context_line":"that the current state of the volume/snapshot is not an \"ING\" state.  The"},{"line_number":55,"context_line":"following is a list of all statuses and the ones considered an \"ING\" state:"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"+----------------+    +------------------+"},{"line_number":58,"context_line":"|  \"ING\" States  |    |   Other States   |"},{"line_number":59,"context_line":"+----------------+    +------------------+"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_dae2142f","line":56,"in_reply_to":"9a1a9d01_f43bb6e9","updated":"2015-09-29 07:45:32.000000000","message":"I guess \"transferring\" state is something described below as \"reading\". This is problematic - how do we clean it up if a c-vol crashes? How do we differentiate a moment when c-vol crashed with simple \"operation is pending\"?\n\nI think a better idea would be to have atomic state transition on deletion of volume A with constraint on no volumes with src_vol\u003dA are in CREATING state.\n\nBut that\u0027s explained below I think. :)","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"904a4ef67759229cab5ae85df86a9586b95b8cf0","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"In order to implement this new API change, this proposal will require the"},{"line_number":75,"context_line":"microversion API feature set.  We cannot break backwards compatibility with"},{"line_number":76,"context_line":"Nova."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"In the case of the _run_flow_locked() mechanism, that is needed to provide a way"}],"source_content_type":"text/x-rst","patch_set":7,"id":"7a2fa921_1023a706","line":76,"updated":"2015-10-07 20:54:12.000000000","message":"I do not believe that this changes anything with Nova.\nWe currently return exceptions for -ing state in begin_detaching and for maintenance in detach:\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L600\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L648\n\nand also for reserve_volume and attach:\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L558\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L562\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L619\n\nSince Nova checks for proper state before these calls, there is a race condition.\nThe Nova path for attach already has a \u0027try:\u0027 block, but detach does not, so there is a bug in Nova.\n\nBut we are not really changing the API contract with Nova here.\n\nAn argument has been made that this could break other scripts that have been written against this API. Are other scripts allowed to call attach/detach directly? Should they be allowed? What is to stop these scripts from calling without using begin_detaching and reserve_volume? And shouldn\u0027t they check state as Nova does, and be prepared for the existing exceptions? If they are broken, it is their bug to fix.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"db76ef746446db16aa9a4d614cc3aa92675d547f","unresolved":false,"context_lines":[{"line_number":73,"context_line":""},{"line_number":74,"context_line":"In order to implement this new API change, this proposal will require the"},{"line_number":75,"context_line":"microversion API feature set.  We cannot break backwards compatibility with"},{"line_number":76,"context_line":"Nova."},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"In the case of the _run_flow_locked() mechanism, that is needed to provide a way"}],"source_content_type":"text/x-rst","patch_set":7,"id":"7a2fa921_2d80bef6","line":76,"in_reply_to":"7a2fa921_1023a706","updated":"2015-10-08 05:40:48.000000000","message":"I agree on Nova\u0027s part but one thing to clarify is that with CAS Nova should just call Cinder and wait for reply - either successful or not. If it is calling Cinder to get status, validates the status and then calls Cinder again - there\u0027s a race condition between the calls.\n\nI think the main problem with breaking the API contract was the delete call. Currently if a volume is created from a snapshot and we\u0027re trying to delete the snapshot - the request will wait for snapshot lock to be released and then complete the deletion. So we\u0027re queuing delete request until it is possible to execute it. In new model we\u0027ll fail immediately and user would need to retry.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"3ec68dc985d1fd9a6931b2ac776949ff35ee1ab4","unresolved":false,"context_lines":[{"line_number":81,"context_line":"new volume from it.  The current mechanism creates a lock on the original"},{"line_number":82,"context_line":"volume/snapshot, then creates the volume from it, and then removes the lock."},{"line_number":83,"context_line":"This ensures that the source can\u0027t be deleted while the new volume is being"},{"line_number":84,"context_line":"created."},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"One approach is during delete actions on a volume, see if there are any"},{"line_number":87,"context_line":"volumes in the creating state where the source_volid is the id of the volume"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_e4c8f576","line":84,"updated":"2015-09-25 18:07:21.000000000","message":"I\u0027m not following this exactly.  We don\u0027t allow delete of volumes that have snapshots (unless somebody finally snuck that one past me :) ).  If we\u0027re doing that it\u0027s wrong IMO.\n\nIf we\u0027re not, then this is kind of an odd case because we fail delete on volumes with snapshots anyway; and we get that info from the DB on the snapshot_create.  We should be setting/creating the db instance in volume/api probably to help with timing contentions on this?","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"a8156a4dbae28fd6d8b8e8d8d6ced19fca9971fa","unresolved":false,"context_lines":[{"line_number":81,"context_line":"new volume from it.  The current mechanism creates a lock on the original"},{"line_number":82,"context_line":"volume/snapshot, then creates the volume from it, and then removes the lock."},{"line_number":83,"context_line":"This ensures that the source can\u0027t be deleted while the new volume is being"},{"line_number":84,"context_line":"created."},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"One approach is during delete actions on a volume, see if there are any"},{"line_number":87,"context_line":"volumes in the creating state where the source_volid is the id of the volume"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_b45f7e40","line":84,"in_reply_to":"9a1a9d01_07c64b67","updated":"2015-09-26 04:20:49.000000000","message":"Ahh, yeah... that\u0027s a GREAT point, thanks!","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"38ef3f49d8490f83c597f9837bdbc0595cc95638","unresolved":false,"context_lines":[{"line_number":81,"context_line":"new volume from it.  The current mechanism creates a lock on the original"},{"line_number":82,"context_line":"volume/snapshot, then creates the volume from it, and then removes the lock."},{"line_number":83,"context_line":"This ensures that the source can\u0027t be deleted while the new volume is being"},{"line_number":84,"context_line":"created."},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"One approach is during delete actions on a volume, see if there are any"},{"line_number":87,"context_line":"volumes in the creating state where the source_volid is the id of the volume"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_07c64b67","line":84,"in_reply_to":"9a1a9d01_e4c8f576","updated":"2015-09-25 18:51:23.000000000","message":"I think one of the cases is where you are creating a volume from a snapshot.  The lock, locks the snapshot so it can\u0027t be deleted.  I don\u0027t think the API currently checks for that case.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"3ec68dc985d1fd9a6931b2ac776949ff35ee1ab4","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"One approach is during delete actions on a volume, see if there are any"},{"line_number":87,"context_line":"volumes in the creating state where the source_volid is the id of the volume"},{"line_number":88,"context_line":"being requested for deletion.  If so, then return VolumeIsBusy."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"An alternative is to set the source volume into a \u0027reading\u0027 state, which would"},{"line_number":91,"context_line":"prevent deletes from happening against the source.  If the creation from the"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_2496ed4c","line":88,"updated":"2015-09-25 18:07:21.000000000","message":"Seems like this is a broader statement about what we do for calls that fail state checks due to \"in process\" activities, seems like a good idea, but there are likely ramifications in terms of compatibility here that we\u0027ll need to consider.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"3ec68dc985d1fd9a6931b2ac776949ff35ee1ab4","unresolved":false,"context_lines":[{"line_number":101,"context_line":"One alternative would be to create a new state management system.  Another"},{"line_number":102,"context_line":"alternative is to introduce a DLM (Distributed Locking Mechanism), something"},{"line_number":103,"context_line":"along the lines of the tooz library.   We discussed this at the Liberty"},{"line_number":104,"context_line":"mid-cycle/sprint and determined that it\u0027s too much to ask of an operator to"},{"line_number":105,"context_line":"deploy another library just for running Cinder."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"Data model impact"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_849ed954","line":104,"updated":"2015-09-25 18:07:21.000000000","message":"Not sure why that\u0027s too much to ask, add it to requirements, the operator doesn\u0027t even know about it really.  How is that different than using oslo.xxx or os-brick etc?  Not following the issue, so makes me think I don\u0027t know what what I thought I did about Tooz.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e940b9ba2c2a6c7a6221a3930573f083d435abaa","unresolved":false,"context_lines":[{"line_number":101,"context_line":"One alternative would be to create a new state management system.  Another"},{"line_number":102,"context_line":"alternative is to introduce a DLM (Distributed Locking Mechanism), something"},{"line_number":103,"context_line":"along the lines of the tooz library.   We discussed this at the Liberty"},{"line_number":104,"context_line":"mid-cycle/sprint and determined that it\u0027s too much to ask of an operator to"},{"line_number":105,"context_line":"deploy another library just for running Cinder."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"Data model impact"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_5538173d","line":104,"in_reply_to":"9a1a9d01_34328e11","updated":"2015-09-29 07:45:32.000000000","message":"If this paragraph causes confusion I don\u0027t mind if it gets removed. It was added on my request.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"a8156a4dbae28fd6d8b8e8d8d6ced19fca9971fa","unresolved":false,"context_lines":[{"line_number":101,"context_line":"One alternative would be to create a new state management system.  Another"},{"line_number":102,"context_line":"alternative is to introduce a DLM (Distributed Locking Mechanism), something"},{"line_number":103,"context_line":"along the lines of the tooz library.   We discussed this at the Liberty"},{"line_number":104,"context_line":"mid-cycle/sprint and determined that it\u0027s too much to ask of an operator to"},{"line_number":105,"context_line":"deploy another library just for running Cinder."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"Data model impact"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_34328e11","line":104,"in_reply_to":"9a1a9d01_47e52307","updated":"2015-09-26 04:20:49.000000000","message":"yeah, that surely makes more sense.  We should reword that to avoid any ocnfusion or frankly AFAIC everything proposed here shouldn\u0027t really meet any question/objection; it\u0027s code cleanup / tech-debt and we should just do it. :)","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"38ef3f49d8490f83c597f9837bdbc0595cc95638","unresolved":false,"context_lines":[{"line_number":101,"context_line":"One alternative would be to create a new state management system.  Another"},{"line_number":102,"context_line":"alternative is to introduce a DLM (Distributed Locking Mechanism), something"},{"line_number":103,"context_line":"along the lines of the tooz library.   We discussed this at the Liberty"},{"line_number":104,"context_line":"mid-cycle/sprint and determined that it\u0027s too much to ask of an operator to"},{"line_number":105,"context_line":"deploy another library just for running Cinder."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"Data model impact"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_47e52307","line":104,"in_reply_to":"9a1a9d01_849ed954","updated":"2015-09-25 18:51:23.000000000","message":"I think the \u0027too much to ask\u0027 that was brought up wasn\u0027t Tooz itself per say, but more related to the Tooz \u0027backends\u0027.  For example, if this required a separate DB instance for the Tooz backend, then that\u0027s an extra hurdle that a Cinder deployer needed to deal with prior to even standing up Cinder.\n\nre: \n   http://docs.openstack.org/developer/tooz/drivers.html#backends","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"3ec68dc985d1fd9a6931b2ac776949ff35ee1ab4","unresolved":false,"context_lines":[{"line_number":123,"context_line":"delete_snapshot"},{"line_number":124,"context_line":"attach"},{"line_number":125,"context_line":"detach"},{"line_number":126,"context_line":"possibly others"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"The expected error http response code for when a volume/snapshot is busy"},{"line_number":129,"context_line":"would be HTTP 409 (Conflict)."}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_64e705e5","line":126,"updated":"2015-09-25 18:07:21.000000000","message":"yeah, IMHO we need to clean up all of our volume/api methods and do things more consistently and sensibly here.  We\u0027ve picked at it over time, but we just need to go in and fix it all up like you suggest.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e940b9ba2c2a6c7a6221a3930573f083d435abaa","unresolved":false,"context_lines":[{"line_number":208,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":209,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":210,"context_line":"the new API microversion capability in Cinder.  We will bump the microversion"},{"line_number":211,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them"},{"line_number":214,"context_line":"accordingly in all interactions with Cinder API calls."}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a1a9d01_d5a50747","line":211,"updated":"2015-09-29 07:45:32.000000000","message":"Continuing discussion from patchset 5:\n\n    \"For the old version of the API request, we have to have the\n    same behavior as we do now, so we\u0027ll have to keep the locks\n    in place for the old calls.\"\n\nI agree on that. My concern is only on how do we achieve it? I see multiple problems there. First one would be - how do we pass the information about the API microversion used from c-api to c-vol? Is it in context? Maybe I\u0027m misunderstanding something about microversions here? Anyway I think that this should be explained here.\n\nOn the other hand there can be a problem when create volume from snapshot request comes from old API microversion and delete snapshot comes from the other one (or the other way). How do we lock the snapshot deletion then? I think that description of behavior in such situations also need to be included in this spec.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"73726ecf12844b5c4a28240dcbffbae8a9c41f06","unresolved":false,"context_lines":[{"line_number":208,"context_line":"Since this requires a change to how the API may respond to requests, raising a"},{"line_number":209,"context_line":"VolumeIsBusy exception where it previously did not, this feature will require"},{"line_number":210,"context_line":"the new API microversion capability in Cinder.  We will bump the microversion"},{"line_number":211,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them"},{"line_number":214,"context_line":"accordingly in all interactions with Cinder API calls."}],"source_content_type":"text/x-rst","patch_set":7,"id":"7a2fa921_adf37c9d","line":211,"in_reply_to":"9a1a9d01_d5a50747","updated":"2015-10-07 20:18:27.000000000","message":"I\u0027ve just watched the discussion on this spec (https://www.youtube.com/watch?v\u003dD_iXpNcWDv8). For the record - the point was that there are two options:\n\n* Modify the behavior without any notice. This is actually a little serious change - creation of volume from snapshot can lock a volume for 10+ seconds. That\u0027s a big window.\n\n* Try to do microversions in c-vol manager (uuugly).\n\nAnother idea that wasn\u0027t mentioned in the discussion is to loop the compare-and-swap attempts in the API when executing older microversion. The drawback here is that the lock is guaranteed to be released on process failure and DB state change isn\u0027t, so whole process may never end.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"904a4ef67759229cab5ae85df86a9586b95b8cf0","unresolved":false,"context_lines":[{"line_number":210,"context_line":"the new API microversion capability in Cinder.  We will bump the microversion"},{"line_number":211,"context_line":"and only reply with VolumeIsBusy if the new version is requested."},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"Nova will then need to look for the VolumeIsBusy reponses and deal with them"},{"line_number":214,"context_line":"accordingly in all interactions with Cinder API calls."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"https://review.openstack.org/#/c/223803/"}],"source_content_type":"text/x-rst","patch_set":7,"id":"7a2fa921_f0b14b90","line":213,"updated":"2015-10-07 20:54:12.000000000","message":"See my comment on L#76. Nova should already be looking for exceptions, since they already exist.","commit_id":"b9ad059e985d6a68c0c2ebc41757f6ea8a3e571f"}]}
