)]}'
{"specs/newton/approved/glance/database-strategy-for-rolling-upgrades.rst":[{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"aa5ed5304227854d766f217d3e0bff27816f47c5","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"#. Pre-upgrade: Release N-1 code is running, using the old column."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"#. Initial schema migration: The database schema is modified to include the new"},{"line_number":56,"context_line":"   column."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"#. The Compatabilty Phase: both release N-1 and release N code are running"},{"line_number":59,"context_line":"   simultaneously.  Release N-1 has no idea that an upgrade is occurring, but"}],"source_content_type":"text/x-rst","patch_set":1,"id":"3aaa91ec_27124163","line":56,"range":{"start_line":55,"start_character":3,"end_line":56,"end_character":10},"updated":"2016-06-21 20:34:09.000000000","message":"How about mentioning that schema changes allowed here MUST be additive in nature?","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":58,"context_line":"#. The Compatabilty Phase: both release N-1 and release N code are running"},{"line_number":59,"context_line":"   simultaneously.  Release N-1 has no idea that an upgrade is occurring, but"},{"line_number":60,"context_line":"   the release N code is running in *compatibility mode*.  During this phase,"},{"line_number":61,"context_line":"   both releases will read from and write to the old column.  Thus any data"},{"line_number":62,"context_line":"   updates made by release N code will be available to release N-1 code, and"},{"line_number":63,"context_line":"   vice-versa.  During this phase, the release N code nodes are being brought"},{"line_number":64,"context_line":"   online as the release N-1 nodes are taken offline.  The Compatabilty Phase"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_1d0e1f3b","line":61,"range":{"start_line":61,"start_character":36,"end_line":61,"end_character":59},"updated":"2016-06-21 15:08:54.000000000","message":"surely release N code would write to the old and the new column?","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"aa5ed5304227854d766f217d3e0bff27816f47c5","unresolved":false,"context_lines":[{"line_number":58,"context_line":"#. The Compatabilty Phase: both release N-1 and release N code are running"},{"line_number":59,"context_line":"   simultaneously.  Release N-1 has no idea that an upgrade is occurring, but"},{"line_number":60,"context_line":"   the release N code is running in *compatibility mode*.  During this phase,"},{"line_number":61,"context_line":"   both releases will read from and write to the old column.  Thus any data"},{"line_number":62,"context_line":"   updates made by release N code will be available to release N-1 code, and"},{"line_number":63,"context_line":"   vice-versa.  During this phase, the release N code nodes are being brought"},{"line_number":64,"context_line":"   online as the release N-1 nodes are taken offline.  The Compatabilty Phase"}],"source_content_type":"text/x-rst","patch_set":1,"id":"3aaa91ec_e0a30a4e","line":61,"range":{"start_line":61,"start_character":36,"end_line":61,"end_character":59},"in_reply_to":"5a9d85d2_1d0e1f3b","updated":"2016-06-21 20:34:09.000000000","message":"+1, N would read from old, but write to both old and new columns.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":62,"context_line":"   updates made by release N code will be available to release N-1 code, and"},{"line_number":63,"context_line":"   vice-versa.  During this phase, the release N code nodes are being brought"},{"line_number":64,"context_line":"   online as the release N-1 nodes are taken offline.  The Compatabilty Phase"},{"line_number":65,"context_line":"   ends when there are no longer any N-1 nodes running."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"#. The Data Consistency Phase: only release N code is running.  During this"},{"line_number":68,"context_line":"   phase, the release N code will be transitioned into *consistency mode*."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_dd8497d5","line":65,"range":{"start_line":65,"start_character":3,"end_line":65,"end_character":54},"updated":"2016-06-21 15:08:54.000000000","message":"Just curious how you do that. I know Nova has added service version for API nodes, so we can detect that, with a cache and a SIG_HUP to trigger the update.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"aa5ed5304227854d766f217d3e0bff27816f47c5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"   updates made by release N code will be available to release N-1 code, and"},{"line_number":63,"context_line":"   vice-versa.  During this phase, the release N code nodes are being brought"},{"line_number":64,"context_line":"   online as the release N-1 nodes are taken offline.  The Compatabilty Phase"},{"line_number":65,"context_line":"   ends when there are no longer any N-1 nodes running."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"#. The Data Consistency Phase: only release N code is running.  During this"},{"line_number":68,"context_line":"   phase, the release N code will be transitioned into *consistency mode*."}],"source_content_type":"text/x-rst","patch_set":1,"id":"3aaa91ec_5bb64f3e","line":65,"range":{"start_line":65,"start_character":3,"end_line":65,"end_character":54},"in_reply_to":"5a9d85d2_dd8497d5","updated":"2016-06-21 20:34:09.000000000","message":"We were thinking of a similar approach where services would report their status to db and change over when everything moves to N. But, to keep things simple for now, operators can just change the config and send SIGHUP to reload the configs, which would signal the completion of upgrade to N.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":77,"context_line":"   and finds a value, it needs to make sure that a newer value hasn\u0027t been"},{"line_number":78,"context_line":"   written to the old column by a node still in compatability mode."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"   One strategy for enabling update sensitive reads is to introduce a temporary"},{"line_number":81,"context_line":"   column in which consistency mode nodes record the time of a write to the new"},{"line_number":82,"context_line":"   column.  When a consistency mode node does a read from the new column and"},{"line_number":83,"context_line":"   finds a value, before using the value, it does a comparison between the"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_5d08a72c","line":80,"range":{"start_line":80,"start_character":3,"end_line":80,"end_character":15},"updated":"2016-06-21 15:08:54.000000000","message":"Another idea that came up is to have the writer update schema version column, so you can tell which place the reader should read from.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"aa5ed5304227854d766f217d3e0bff27816f47c5","unresolved":false,"context_lines":[{"line_number":77,"context_line":"   and finds a value, it needs to make sure that a newer value hasn\u0027t been"},{"line_number":78,"context_line":"   written to the old column by a node still in compatability mode."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"   One strategy for enabling update sensitive reads is to introduce a temporary"},{"line_number":81,"context_line":"   column in which consistency mode nodes record the time of a write to the new"},{"line_number":82,"context_line":"   column.  When a consistency mode node does a read from the new column and"},{"line_number":83,"context_line":"   finds a value, before using the value, it does a comparison between the"}],"source_content_type":"text/x-rst","patch_set":1,"id":"3aaa91ec_a2f1ffcf","line":80,"range":{"start_line":80,"start_character":3,"end_line":80,"end_character":15},"in_reply_to":"5a9d85d2_5d08a72c","updated":"2016-06-21 20:34:09.000000000","message":"Ah, that makes sense. Thanks for suggesting that, we\u0027ll explore it further.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":81,"context_line":"   column in which consistency mode nodes record the time of a write to the new"},{"line_number":82,"context_line":"   column.  When a consistency mode node does a read from the new column and"},{"line_number":83,"context_line":"   finds a value, before using the value, it does a comparison between the"},{"line_number":84,"context_line":"   update time of the row and the update time recorded in the temporary column;"},{"line_number":85,"context_line":"   if the row\u0027s update time is more recent, a fallback read into the old column"},{"line_number":86,"context_line":"   is performed."},{"line_number":87,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_ddb77784","line":84,"range":{"start_line":84,"start_character":62,"end_line":84,"end_character":78},"updated":"2016-06-21 15:08:54.000000000","message":"if you add that, when do you drop that?","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"aa5ed5304227854d766f217d3e0bff27816f47c5","unresolved":false,"context_lines":[{"line_number":81,"context_line":"   column in which consistency mode nodes record the time of a write to the new"},{"line_number":82,"context_line":"   column.  When a consistency mode node does a read from the new column and"},{"line_number":83,"context_line":"   finds a value, before using the value, it does a comparison between the"},{"line_number":84,"context_line":"   update time of the row and the update time recorded in the temporary column;"},{"line_number":85,"context_line":"   if the row\u0027s update time is more recent, a fallback read into the old column"},{"line_number":86,"context_line":"   is performed."},{"line_number":87,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"3aaa91ec_0281f34a","line":84,"range":{"start_line":84,"start_character":62,"end_line":84,"end_character":78},"in_reply_to":"5a9d85d2_ddb77784","updated":"2016-06-21 20:34:09.000000000","message":"It would be removed when we do the contracts.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":88,"context_line":"#. Background data migration phase: After all nodes are in consistency mode,"},{"line_number":89,"context_line":"   data migration from the old column to the new column occurs, using an update"},{"line_number":90,"context_line":"   sensitive read of the new column to ensure the correct value is recorded in"},{"line_number":91,"context_line":"   the new column for each row.  Once all data has been migrated, the release N"},{"line_number":92,"context_line":"   code is using the new column exclusively."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"#. Final schema migration: The old column is removed from the database.  At"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_bd71cbe2","line":91,"range":{"start_line":91,"start_character":33,"end_line":91,"end_character":64},"updated":"2016-06-21 15:08:54.000000000","message":"Many projects provide a CLI interface to help speed that up.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":89,"context_line":"   data migration from the old column to the new column occurs, using an update"},{"line_number":90,"context_line":"   sensitive read of the new column to ensure the correct value is recorded in"},{"line_number":91,"context_line":"   the new column for each row.  Once all data has been migrated, the release N"},{"line_number":92,"context_line":"   code is using the new column exclusively."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"#. Final schema migration: The old column is removed from the database.  At"},{"line_number":95,"context_line":"   this time, the new column may have its nullability constraint adjusted and a"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_5836f5e6","line":92,"updated":"2016-06-21 15:08:54.000000000","message":"What are we doing to detect we are \"finished\", in a way that can\u0027t read the","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"aa5ed5304227854d766f217d3e0bff27816f47c5","unresolved":false,"context_lines":[{"line_number":89,"context_line":"   data migration from the old column to the new column occurs, using an update"},{"line_number":90,"context_line":"   sensitive read of the new column to ensure the correct value is recorded in"},{"line_number":91,"context_line":"   the new column for each row.  Once all data has been migrated, the release N"},{"line_number":92,"context_line":"   code is using the new column exclusively."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"#. Final schema migration: The old column is removed from the database.  At"},{"line_number":95,"context_line":"   this time, the new column may have its nullability constraint adjusted and a"}],"source_content_type":"text/x-rst","patch_set":1,"id":"3aaa91ec_42865bba","line":92,"in_reply_to":"5a9d85d2_5836f5e6","updated":"2016-06-21 20:34:09.000000000","message":"The background data migration script, on repeated execution, will eventually report that there are no rows left to migrate. Again, this would be a manual step for now.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":96,"context_line":"   default value set."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"#. Upgrade completion: the nodes are taken out of consistency mode.  At this"},{"line_number":99,"context_line":"   point, all release N features are available."},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"Example"},{"line_number":102,"context_line":"-------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_38b6893d","line":99,"updated":"2016-06-21 15:08:54.000000000","message":"Please note, sqlalchemy doesn\u0027t really support this usage pattern above. The new code model would not be allowed to include the old column, so that would have to be a manual \"read\", based on the above \"mode\".","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"aa5ed5304227854d766f217d3e0bff27816f47c5","unresolved":false,"context_lines":[{"line_number":96,"context_line":"   default value set."},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"#. Upgrade completion: the nodes are taken out of consistency mode.  At this"},{"line_number":99,"context_line":"   point, all release N features are available."},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"Example"},{"line_number":102,"context_line":"-------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"3aaa91ec_580c8a42","line":99,"in_reply_to":"5a9d85d2_38b6893d","updated":"2016-06-21 20:34:09.000000000","message":"Not sure I understand completely but are you saying that we are removing the column while the sqlalchemy model still has references to it?","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c15ad0d43029a965b8bb3e8d1b6b691933caf646","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"#. Upgrade completion: the nodes are taken out of consistency mode.  At this"},{"line_number":99,"context_line":"   point, all release N features are available."},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"Example"},{"line_number":102,"context_line":"-------"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"5a9d85d2_b85c39ee","line":100,"updated":"2016-06-21 15:08:54.000000000","message":"So I think the above should work.\n\nBut there is a lot of steps and complexity here to ensure this can be done in a single release step.","commit_id":"20ba4bf7d81135f7c63f152012d3db4f8af164f0"},{"author":{"_account_id":17043,"name":"Timothy Symanczyk","email":"tim@symanczyk.com","username":"timothy_symanczyk"},"change_message_id":"9ac091b01be83d694f3db9315975ec98c72a6208","unresolved":false,"context_lines":[{"line_number":403,"context_line":"document.  By confining the database changes to a single release, however,"},{"line_number":404,"context_line":"developers of release N+1 do not have to worry about completing procedures"},{"line_number":405,"context_line":"begun during the migration of release N-1 to N."},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"Implementation"},{"line_number":408,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":409,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"1aa78d24_866784b6","line":406,"updated":"2016-07-08 22:47:49.000000000","message":"Since the compatibility only ever goes back one release, how will deprecation of the fallback code happen? Will every N release necessarily include a commit of the N-2 -\u003e N-1 upgrade logic?","commit_id":"0cae98981df1479b0c111bb5d9b0deaa7853d609"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"82520866c5f5dc4835e0c0fbdd7e78d02eaf8318","unresolved":false,"context_lines":[{"line_number":403,"context_line":"document.  By confining the database changes to a single release, however,"},{"line_number":404,"context_line":"developers of release N+1 do not have to worry about completing procedures"},{"line_number":405,"context_line":"begun during the migration of release N-1 to N."},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"Implementation"},{"line_number":408,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":409,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"fad55976_9e9f0db4","line":406,"in_reply_to":"1aa78d24_866784b6","updated":"2016-07-15 15:33:08.000000000","message":"Yeah, the N release would have get to rid of the stale references in the database model left behind by N-1. Although we achieve the database migration itself in one cycle, there would be some code clean up left to performed in following cycle.","commit_id":"0cae98981df1479b0c111bb5d9b0deaa7853d609"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"3a45efedf08a429f5a77415ab970fe4b7c9ee6b6","unresolved":false,"context_lines":[{"line_number":95,"context_line":"In the presence of database changes it isn\u0027t yet possible to do rolling"},{"line_number":96,"context_line":"upgrades. The primary reason is the way we do database changes/migrations"},{"line_number":97,"context_line":"currently. A typical migration in OpenStack projects includes both schema and"},{"line_number":98,"context_line":"data migrations together. This increases the downtime during an upgrade as data"},{"line_number":99,"context_line":"migrations take longer than most schema changes, and this effect will be more"},{"line_number":100,"context_line":"pronounced on larger clouds.  While performing schema migrations are necessary"},{"line_number":101,"context_line":"during an upgrade (because the new code expects the new schema), data"}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_dcd0dbf8","line":98,"range":{"start_line":98,"start_character":16,"end_line":98,"end_character":24},"updated":"2016-07-20 13:52:06.000000000","message":"Nice observation!","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"3a45efedf08a429f5a77415ab970fe4b7c9ee6b6","unresolved":false,"context_lines":[{"line_number":111,"context_line":"Schema changes vary in nature depending upon the kind of changes they entail."},{"line_number":112,"context_line":"The changes could be \"additive\" or \"contractive\" in nature. Additive changes"},{"line_number":113,"context_line":"primarily deal with adding a table, column and/or constraint, whereas"},{"line_number":114,"context_line":"contractive changes deal with removing them. If the schema changes are strictly"},{"line_number":115,"context_line":"additive in nature, they could be applied to the database while the old"},{"line_number":116,"context_line":"services are still running (because the old services aren\u0027t concerned about new"},{"line_number":117,"context_line":"tables, columns and/or constraints as long as they have access to the ones they"}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_1ca6f352","line":114,"updated":"2016-07-20 13:52:06.000000000","message":"I think removing a constraint is in a somewhat different category then removing columns and tables - the fact of removing a constraint by itself wouldn\u0027t cause a compatibility issue.\n\nOn the other side, adding a constraint may lock DB tables, which is a different kind of issue.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bdc97c545c525471fca6ada8892763776ff810ea","unresolved":false,"context_lines":[{"line_number":111,"context_line":"Schema changes vary in nature depending upon the kind of changes they entail."},{"line_number":112,"context_line":"The changes could be \"additive\" or \"contractive\" in nature. Additive changes"},{"line_number":113,"context_line":"primarily deal with adding a table, column and/or constraint, whereas"},{"line_number":114,"context_line":"contractive changes deal with removing them. If the schema changes are strictly"},{"line_number":115,"context_line":"additive in nature, they could be applied to the database while the old"},{"line_number":116,"context_line":"services are still running (because the old services aren\u0027t concerned about new"},{"line_number":117,"context_line":"tables, columns and/or constraints as long as they have access to the ones they"}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_5681e7fa","line":114,"in_reply_to":"dada55a8_1ca6f352","updated":"2016-07-22 16:49:07.000000000","message":"Good catch, Greg!\nThere\u0027s a mention of how adding constraints could be disruptive in the following sections. Let me see what I can do to make this more explicit.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"3a45efedf08a429f5a77415ab970fe4b7c9ee6b6","unresolved":false,"context_lines":[{"line_number":328,"context_line":"Once all background database migrations are complete, the new column now has"},{"line_number":329,"context_line":"all the latest data and is ready for use. We can now turn off the"},{"line_number":330,"context_line":"compatibility mode after which the N services will read from and write to the"},{"line_number":331,"context_line":"new column as shown in the below diagram."},{"line_number":332,"context_line":""},{"line_number":333,"context_line":".. parsed-literal::"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_f3334d60","line":331,"updated":"2016-07-20 13:52:06.000000000","message":"I think you missed a step.\n\nThis would be ok if you incur downtime when switching the compatibility mode. But if the switch doesn\u0027t occur in all glance instances at once, there will be a situation where there are 2 types of glance instances which\n\n1. both make DB reads from different columns,\n2. the new one writes only to the new column.\n\nSo the data written by the new instance (with compatibility mode off) will be inaccessible to the old one. Also, if a row added by an old instance is modified by the new one, the old instance would still read only the outdated value.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"d80e47a64120d90407c08b49161325125197838c","unresolved":false,"context_lines":[{"line_number":328,"context_line":"Once all background database migrations are complete, the new column now has"},{"line_number":329,"context_line":"all the latest data and is ready for use. We can now turn off the"},{"line_number":330,"context_line":"compatibility mode after which the N services will read from and write to the"},{"line_number":331,"context_line":"new column as shown in the below diagram."},{"line_number":332,"context_line":""},{"line_number":333,"context_line":".. parsed-literal::"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"bacf61ea_3f997b6f","line":331,"in_reply_to":"dada55a8_0803c3b9","updated":"2016-08-03 15:44:56.000000000","message":"I think John Garbutt\u0027s idea of not writing to the new column when in compatibility mode could be something to consider, but it would have to nullify the new column when doing updates (to make sure the next version, with compatibility mode off knows which column contains the updated data). I\u0027m not sure this is a good solution for all cases, because it can be valuable data stored in there...","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bdc97c545c525471fca6ada8892763776ff810ea","unresolved":false,"context_lines":[{"line_number":328,"context_line":"Once all background database migrations are complete, the new column now has"},{"line_number":329,"context_line":"all the latest data and is ready for use. We can now turn off the"},{"line_number":330,"context_line":"compatibility mode after which the N services will read from and write to the"},{"line_number":331,"context_line":"new column as shown in the below diagram."},{"line_number":332,"context_line":""},{"line_number":333,"context_line":".. parsed-literal::"},{"line_number":334,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_0803c3b9","line":331,"in_reply_to":"dada55a8_f3334d60","updated":"2016-07-22 16:49:07.000000000","message":"Good catch again, Greg!\nThis could be solved by writing to both columns always,I guess. What do you think?","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"3a45efedf08a429f5a77415ab970fe4b7c9ee6b6","unresolved":false,"context_lines":[{"line_number":363,"context_line":"When all the rows are migrated as a result of both online and background"},{"line_number":364,"context_line":"migrations, the new column would be the source of truth henceforth. At this"},{"line_number":365,"context_line":"point, the old column is ready for removal. However, as N has references to"},{"line_number":366,"context_line":"the old column in code (for compatibility mode), we can\u0027t yet get rid of the"},{"line_number":367,"context_line":"old column. The old column can be removed only when the N services are"},{"line_number":368,"context_line":"completely rolled out, that is when N+1 is completely deployed. At this stage,"},{"line_number":369,"context_line":"we contract the database."},{"line_number":370,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_26b2c14c","line":367,"range":{"start_line":366,"start_character":49,"end_line":367,"end_character":10},"updated":"2016-07-20 13:52:06.000000000","message":"I think you could.\n\nYou can place a column under an \"if compatibility_mode \u003d\u003d enabled\" clause. It wouldn\u0027t be part of an SQLAlchemy model when the compatibility mode is disabled.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bdc97c545c525471fca6ada8892763776ff810ea","unresolved":false,"context_lines":[{"line_number":363,"context_line":"When all the rows are migrated as a result of both online and background"},{"line_number":364,"context_line":"migrations, the new column would be the source of truth henceforth. At this"},{"line_number":365,"context_line":"point, the old column is ready for removal. However, as N has references to"},{"line_number":366,"context_line":"the old column in code (for compatibility mode), we can\u0027t yet get rid of the"},{"line_number":367,"context_line":"old column. The old column can be removed only when the N services are"},{"line_number":368,"context_line":"completely rolled out, that is when N+1 is completely deployed. At this stage,"},{"line_number":369,"context_line":"we contract the database."},{"line_number":370,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_c8cd2b88","line":367,"range":{"start_line":366,"start_character":49,"end_line":367,"end_character":10},"in_reply_to":"dada55a8_26b2c14c","updated":"2016-07-22 16:49:07.000000000","message":"Ah, interesting. I\u0027ll explore this further.\nThanks for the input, Greg!","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"dec873533b086ad0258767c5adb114de7a7ea4c9","unresolved":false,"context_lines":[{"line_number":420,"context_line":""},{"line_number":421,"context_line":"We propose to make this available by extending the glance-manage utility with"},{"line_number":422,"context_line":"an expand command. The database could be expanded by running"},{"line_number":423,"context_line":"``glance-manage db_expand``."},{"line_number":424,"context_line":""},{"line_number":425,"context_line":".. parsed-literal::"},{"line_number":426,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_8a3d4291","line":423,"updated":"2016-07-21 09:26:22.000000000","message":"how these migration scripts is going to be delivered to Ops before N codebase is installed?","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bdc97c545c525471fca6ada8892763776ff810ea","unresolved":false,"context_lines":[{"line_number":420,"context_line":""},{"line_number":421,"context_line":"We propose to make this available by extending the glance-manage utility with"},{"line_number":422,"context_line":"an expand command. The database could be expanded by running"},{"line_number":423,"context_line":"``glance-manage db_expand``."},{"line_number":424,"context_line":""},{"line_number":425,"context_line":".. parsed-literal::"},{"line_number":426,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_a82277ff","line":423,"in_reply_to":"dada55a8_8a3d4291","updated":"2016-07-22 16:49:07.000000000","message":"Kairat, good question.\nWe essentially need to maintain two different migration streams in order to achieve expand and contract. From what I understand so far, this is not possible or straightforward with sqlalchemy-migrate. I\u0027m trying to see if there\u0027s a decent workaround to achieve this with sqlalchemy-migrate. \n\nBut, I don\u0027t know if a workaround is worth it if this means we have to eventually move to alembic, which inherently supports parallel migration streams.\n\nAlthough I plan to work on a PoC for Alembic soon, I don\u0027t know if this is a realistic option for this cycle.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"591c1fc4569366dc31c90891830b767e19e7b5e6","unresolved":false,"context_lines":[{"line_number":500,"context_line":" |.|           |  |       |             N"},{"line_number":501,"context_line":" |.|           |  |       |"},{"line_number":502,"context_line":" |.|           |  +-----------------+------+------------------"},{"line_number":503,"context_line":" |.|           |           \\\\        |      |"},{"line_number":504,"context_line":" |.|           |            |   Read/Write |                 |"},{"line_number":505,"context_line":" |.|           |            |       |      |                 |"},{"line_number":506,"context_line":" |.|           |       Read/Write   |    Write               |"}],"source_content_type":"text/x-rst","patch_set":10,"id":"fad55976_b0496091","line":503,"range":{"start_line":503,"start_character":27,"end_line":503,"end_character":45},"updated":"2016-07-15 15:08:36.000000000","message":"Extra \u0027\\\u0027 here.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"3a45efedf08a429f5a77415ab970fe4b7c9ee6b6","unresolved":false,"context_lines":[{"line_number":579,"context_line":" |.|             |                 Migrate                   |"},{"line_number":580,"context_line":" |.|             | \u003c---------------------------------------\u003e |"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"Contract"},{"line_number":584,"context_line":"^^^^^^^^"},{"line_number":585,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_664839cd","line":582,"updated":"2016-07-20 13:52:06.000000000","message":"I think in order to maintain uptime, you need to have a separate phase between \"Migrate\" and \"Contract\", in which N release is running in both compatibility mode enabled and disabled.\n\nThe instances that have the compatibility mode disabled, should still update the old column, so that instances which have compatibility mode enabled could read latest data.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bdc97c545c525471fca6ada8892763776ff810ea","unresolved":false,"context_lines":[{"line_number":579,"context_line":" |.|             |                 Migrate                   |"},{"line_number":580,"context_line":" |.|             | \u003c---------------------------------------\u003e |"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"Contract"},{"line_number":584,"context_line":"^^^^^^^^"},{"line_number":585,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_e84aafab","line":582,"in_reply_to":"dada55a8_664839cd","updated":"2016-07-22 16:49:07.000000000","message":"+1","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"dec873533b086ad0258767c5adb114de7a7ea4c9","unresolved":false,"context_lines":[{"line_number":587,"context_line":"mode* by toggling and reloading the configuration. The new column is now used"},{"line_number":588,"context_line":"for reads and writes exclusively. All features of N would now be"},{"line_number":589,"context_line":"functional. Although the old column is not used, it is referenced in N code"},{"line_number":590,"context_line":"(for compatibility mode). So, the old column needs to be preserved during the"},{"line_number":591,"context_line":"entire lifetime of N.  Hence, the earliest the old column could be removed is"},{"line_number":592,"context_line":"after the Deploy phase of N+1 (when only N+1 versions are running in a"},{"line_number":593,"context_line":"deployment)."}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_0a24b2c2","line":590,"updated":"2016-07-21 09:26:22.000000000","message":"So I have an example that I would like to clarify:\n3 controllers.\nI turn off compatibility mode on controller 1 and restarted glance - now it writes to new column only.\nControllers 2 and 3 still read from old column because it is in compatibility mode  - so it won\u0027t be able to receive updates for new column from controller 1 during restart time.\nHow this situation is going to covered with the current approach? Would you like to restart all glance services in very short period of time?","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"bdc97c545c525471fca6ada8892763776ff810ea","unresolved":false,"context_lines":[{"line_number":587,"context_line":"mode* by toggling and reloading the configuration. The new column is now used"},{"line_number":588,"context_line":"for reads and writes exclusively. All features of N would now be"},{"line_number":589,"context_line":"functional. Although the old column is not used, it is referenced in N code"},{"line_number":590,"context_line":"(for compatibility mode). So, the old column needs to be preserved during the"},{"line_number":591,"context_line":"entire lifetime of N.  Hence, the earliest the old column could be removed is"},{"line_number":592,"context_line":"after the Deploy phase of N+1 (when only N+1 versions are running in a"},{"line_number":593,"context_line":"deployment)."}],"source_content_type":"text/x-rst","patch_set":10,"id":"dada55a8_0893c3fb","line":590,"in_reply_to":"dada55a8_0a24b2c2","updated":"2016-07-22 16:49:07.000000000","message":"Kairat,\nThat\u0027s a good catch. Greg pointed out the same.\nI think we can solve this by writing to both columns even when we are out of the compatibility mode. That way, we are essentially just switching the read from old to new column by switch the compatibility mode off. The writes stay the same.\nWhat do you think?","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"591c1fc4569366dc31c90891830b767e19e7b5e6","unresolved":false,"context_lines":[{"line_number":780,"context_line":"   * If ``is_public`` is \u00271\u0027: set visibility to ``public``"},{"line_number":781,"context_line":"   * If ``is_public`` is \u00270\u0027: if the image has any members, set visibility to"},{"line_number":782,"context_line":"     ``shared``; otherwise set visibility to ``private``"},{"line_number":783,"context_line":""},{"line_number":784,"context_line":"#. The Contract phase: The only API nodes running are version N.  Compatability"},{"line_number":785,"context_line":"   mode is turned off, and users can now make the PATCH calls to set visibility"},{"line_number":786,"context_line":"   to community or shared.  The ``is_public`` column is no longer in use."}],"source_content_type":"text/x-rst","patch_set":10,"id":"fad55976_93d42648","line":783,"updated":"2016-07-15 15:08:36.000000000","message":"In addition to this, we should also go over the rows for which the \"visibility\" column is already set. We should compare the data from old and new columns and re-set the new column if they are not in sync. This is necessary because we may miss any updates made by N-1 to the old column after N has updated the same.\n\nEssentially, we need the background migrations to touch all the rows. This makes the terminating criteria for background migrations a bit tricky.","commit_id":"f5168608afeab2322761829e8fe95d966e49accc"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"cb65647c83a74d25eeeff4daafb99cd8f114da49","unresolved":false,"context_lines":[{"line_number":43,"context_line":"of a single release. Some OpenStack services, such as Cinder, that have"},{"line_number":44,"context_line":"addressed this problem have chosen to make database changes over a sequence of"},{"line_number":45,"context_line":"releases, but we believe that given the structure of Glance and typical usage"},{"line_number":46,"context_line":"patterns, database changes can be made and finalized within a single release."},{"line_number":47,"context_line":"Such an approach is preferable for an open source project in which the cast of"},{"line_number":48,"context_line":"characters may change considerably from cycle to cycle."},{"line_number":49,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_be6871f6","line":46,"updated":"2016-07-26 14:55:45.000000000","message":"This seems to conflict with the paragraph at line 386, where it says the contract happens during N+1","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"e566683b66a7817e884e1bd1fd334221c2a4e5c6","unresolved":false,"context_lines":[{"line_number":116,"context_line":"changes (addition/removal of table/columns) can be treated in a generic manner"},{"line_number":117,"context_line":"as follows. If the schema changes are strictly additive in nature, they could"},{"line_number":118,"context_line":"be applied to the database while the old services are still running (because"},{"line_number":119,"context_line":"the old services aren\u0027t concerned about new tables, columns and/or constraints"},{"line_number":120,"context_line":"as long as they have access to the ones they need). On the other hand, if the"},{"line_number":121,"context_line":"schema changes are purely contractive in nature, they must be delayed until a"},{"line_number":122,"context_line":"later point when all the old services are upgraded (because if we remove"}],"source_content_type":"text/x-rst","patch_set":12,"id":"9ad45d7e_c90fdfdf","line":119,"range":{"start_line":119,"start_character":60,"end_line":119,"end_character":78},"updated":"2016-08-09 04:41:36.000000000","message":"This is conflicting with line 114 which says: \"Barring the changes to constraints...\"","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":130,"context_line":"the additive migrations first and delay the contractive migrations until all"},{"line_number":131,"context_line":"the N-1 services are upgraded."},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"Adding/removing constraints can have a slightly different impact and may"},{"line_number":134,"context_line":"require extra caution and/or a different course of action. Depending on the"},{"line_number":135,"context_line":"database and the version being used, adding constraints may or may not be"},{"line_number":136,"context_line":"disruptive as latest versions of databases have improved capabilities to"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_b984e25d","line":133,"range":{"start_line":133,"start_character":39,"end_line":133,"end_character":57},"updated":"2016-07-27 10:30:04.000000000","message":"Honestly, I lump them into the contract phase, generally. Its just sometimes all the data is already there, so its technically the contract phase of a previous release (I just confused myself there, but hopefully that makes sense)","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":133,"context_line":"Adding/removing constraints can have a slightly different impact and may"},{"line_number":134,"context_line":"require extra caution and/or a different course of action. Depending on the"},{"line_number":135,"context_line":"database and the version being used, adding constraints may or may not be"},{"line_number":136,"context_line":"disruptive as latest versions of databases have improved capabilities to"},{"line_number":137,"context_line":"perform online DDL operations. Every addition of constraint must be carefully"},{"line_number":138,"context_line":"evaluated to avoid and/or minimize disruption. If the disruption is"},{"line_number":139,"context_line":"unavoidable in some circumstances, it could be a sensible compromise to have"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_1966ceec","line":136,"range":{"start_line":136,"start_character":33,"end_line":136,"end_character":69},"updated":"2016-07-27 10:30:04.000000000","message":"There is an annoying other case here. Add a column, that is populated with data online (often from another part of the DB). You can\u0027t add a unique constraint until all data migrations have completed.\n\nIts not a bit deal, just an issue with raising. Consider adding a uuid to a table that currently doesn\u0027t have one.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":166,"context_line":" |.|                         |     |               |     |"},{"line_number":167,"context_line":" |.|                         |     |               |     |"},{"line_number":168,"context_line":" |.|                                \u003c-------------\u003e"},{"line_number":169,"context_line":" |.|                                  Migrate Data"},{"line_number":170,"context_line":" |.|                                \u003c-------------\u003e"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_59e16629","line":169,"range":{"start_line":169,"start_character":38,"end_line":169,"end_character":50},"updated":"2016-07-27 10:30:04.000000000","message":"I think this is in the wrong place, you should migrate data only when you know all the services are \"new\".\n\nThat way you don\u0027t hit issues where old code has written over a row that was previously migrated, leaving you with corrupt data.\n\nLeaving a column as null, until you do the migrate, is a great way to simplify this process, I think.\n\n\nIts worth noting, this actually allows for some level of rollback to the old code, if things go badly running the new code before leaving the compat mode.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"4156556affed3f0e8544d1147810185f391998d0","unresolved":false,"context_lines":[{"line_number":166,"context_line":" |.|                         |     |               |     |"},{"line_number":167,"context_line":" |.|                         |     |               |     |"},{"line_number":168,"context_line":" |.|                                \u003c-------------\u003e"},{"line_number":169,"context_line":" |.|                                  Migrate Data"},{"line_number":170,"context_line":" |.|                                \u003c-------------\u003e"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"bacf61ea_399fdb04","line":169,"range":{"start_line":169,"start_character":38,"end_line":169,"end_character":50},"in_reply_to":"dada55a8_59e16629","updated":"2016-08-03 15:44:36.000000000","message":"+1","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":182,"context_line":"contractive migrations on the database.  (This phase is also called"},{"line_number":183,"context_line":"\"database contract\".)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"Solution"},{"line_number":187,"context_line":"--------"},{"line_number":188,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_39fc72b7","line":185,"updated":"2016-07-27 10:30:04.000000000","message":"PS, the above is quite solution-ey already, but thats fine.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"cb65647c83a74d25eeeff4daafb99cd8f114da49","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    to be strictly additive in nature, adding constraints can sometimes be"},{"line_number":204,"context_line":"    disruptive as they are known to lock the table.  This is alleviated in the"},{"line_number":205,"context_line":"    most recent versions of most major DBMS, so is probably not a concern for"},{"line_number":206,"context_line":"    simple changes."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":209,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_785c5119","line":206,"updated":"2016-07-26 14:55:45.000000000","message":"We keep talking about \"most recent versions of major DBMS\" in this spec - can we call out exactly which versions of which DBMS support things like this?\n\nI\u0027d be curious to see which versions support what we need here, and be able to compare that to which versions operators are currently running today, and which versions are packaged in distros. (e.g. mysql is at 5.5 in Trusty and 5.7 in Xenial, and I\u0027d expect most operators using Ubuntu are still on Trusty).","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"4156556affed3f0e8544d1147810185f391998d0","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    to be strictly additive in nature, adding constraints can sometimes be"},{"line_number":204,"context_line":"    disruptive as they are known to lock the table.  This is alleviated in the"},{"line_number":205,"context_line":"    most recent versions of most major DBMS, so is probably not a concern for"},{"line_number":206,"context_line":"    simple changes."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":209,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"}],"source_content_type":"text/x-rst","patch_set":12,"id":"bacf61ea_04d0ae52","line":206,"in_reply_to":"dada55a8_785c5119","updated":"2016-08-03 15:44:36.000000000","message":"MySQL version should be at least 5.6, that\u0027s when Online DDL was introduced for InnoDB tables.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    early phase of the rolling upgrade, some constraints may need to be handled"},{"line_number":211,"context_line":"    in code instead of relying on the DBMS.  Further, a \"bad\" constraint change"},{"line_number":212,"context_line":"    may only reveal itself at scale, so it\u0027s not clear how much we\u0027d be able to"},{"line_number":213,"context_line":"    rely on Grenade tests to detect such a change."},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"Compatibility Mode"},{"line_number":216,"context_line":"^^^^^^^^^^^^^^^^^^"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_b98a2219","line":213,"updated":"2016-07-27 10:30:04.000000000","message":"I think we need to look at some new tests for this as part of the turbo hipster test system that looks at DB migration performance.\n\nDoing a heap of updates to all tables in the database, while triggering the migration, might be a good way to try and catch that. But as Jim said, we should be specific.\n\nFWIW, I think its fine saying for before MySQL 5.6, you can\u0027t do a rolling upgrade. Lets do the easy thing in the first attempt.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":220,"context_line":"since N-1 services are still around and using the old column, we would end up"},{"line_number":221,"context_line":"having inconsistent data in the table as both N and N-1 services would miss"},{"line_number":222,"context_line":"the updates made by each other. Moreover, the new column would be empty"},{"line_number":223,"context_line":"initially. Hence, until N-1 is around, we need N to be reading from"},{"line_number":224,"context_line":"and writing to the old column to be compatible with N-1 as shown in the below"},{"line_number":225,"context_line":"diagram. We call this \"compatibility mode\". This way we ensure that the data"},{"line_number":226,"context_line":"modified by either version while they co-exist is readily available for both"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_59a7a6a6","line":223,"range":{"start_line":223,"start_character":18,"end_line":223,"end_character":23},"updated":"2016-07-27 10:30:04.000000000","message":"while?","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":224,"context_line":"and writing to the old column to be compatible with N-1 as shown in the below"},{"line_number":225,"context_line":"diagram. We call this \"compatibility mode\". This way we ensure that the data"},{"line_number":226,"context_line":"modified by either version while they co-exist is readily available for both"},{"line_number":227,"context_line":"to read."},{"line_number":228,"context_line":""},{"line_number":229,"context_line":".. parsed-literal::"},{"line_number":230,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_d936f64f","line":227,"updated":"2016-07-27 10:30:04.000000000","message":"As above, I think its simpler to only write to the old column until no N-1 services are running. At that point you can start the data migrations.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":236,"context_line":" |.|                   Read/Write         |   |"},{"line_number":237,"context_line":" |.|                       |       +------+   |"},{"line_number":238,"context_line":" |.|                       |       |          |"},{"line_number":239,"context_line":" |.|                       |   Read/Write   Write"},{"line_number":240,"context_line":" |.|                       |       |          |"},{"line_number":241,"context_line":" |.|                       |       |          |"},{"line_number":242,"context_line":" |.|                    +--v-------v-+--------v--+"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_99091e98","line":239,"range":{"start_line":239,"start_character":31,"end_line":239,"end_character":49},"updated":"2016-07-27 10:30:04.000000000","message":"Not sure I get this, I think we read/write from old, until we read from old and write to new once compat mode is off.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"Once all the N-1 services are upgraded, N services should be moved out of"},{"line_number":258,"context_line":"compatibility mode to use the new column. We propose to do this by introducing"},{"line_number":259,"context_line":"a configuration option to toggle compatibility mode. Initially, when N is"},{"line_number":260,"context_line":"deployed in compatibility mode, we keep this configuration option enabled."},{"line_number":261,"context_line":"To turn off the compatibility mode, we disable the configuration option and"},{"line_number":262,"context_line":"signal N services to reload the configuration (this is already available in"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_b962223c","line":259,"range":{"start_line":259,"start_character":26,"end_line":259,"end_character":51},"updated":"2016-07-27 10:30:04.000000000","message":"Take care here, I think given our need to allow N to run with the config of N-1, we need some commit or release specific value in that config (a bit like the RPC pin), or we need to do it automatically.\n\nMyself, I would go for the simple manual step in the first version, and consider the auto concept as a follow up spec (I suspect you will need to add infrastructure this cycle to help support that next cycle).","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":274,"context_line":"migrations*, which we now discuss."},{"line_number":275,"context_line":""},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"Online Migrations"},{"line_number":278,"context_line":"~~~~~~~~~~~~~~~~~"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"As shown in the above diagram, in addition to using the old column, N writes"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_594846b3","line":277,"updated":"2016-07-27 10:30:04.000000000","message":"I would call these Online Data Migrations.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":302,"context_line":"    wind up substituting complexity in python code (which Glance developers are"},{"line_number":303,"context_line":"    good at) for complexity in SQL (which may not be a strength, plus it would"},{"line_number":304,"context_line":"    probably differ for each DBMS).  So it looks like we\u0027re stuck with online"},{"line_number":305,"context_line":"    migrations."},{"line_number":306,"context_line":""},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"Background Migrations"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_b94ce29e","line":305,"updated":"2016-07-27 10:30:04.000000000","message":"yeah, this is way too complicated, just don\u0027t do any writing to the new column until you are out of the compatibility mode.\n\nThat also allows for some level of rollback.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":305,"context_line":"    migrations."},{"line_number":306,"context_line":""},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"Background Migrations"},{"line_number":309,"context_line":"~~~~~~~~~~~~~~~~~~~~~"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"While online data migrations make it possible for N to work with data in the"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_f99dba0a","line":308,"updated":"2016-07-27 10:30:04.000000000","message":"I would call these Background (or Forced?) Data Migrations","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":321,"context_line":"of migrating all the data at once, we limit the migration to a few rows at a"},{"line_number":322,"context_line":"time to reduce any impact on the database and thus minimize any disruption to"},{"line_number":323,"context_line":"the running services. This makes it possible for background migrations to be"},{"line_number":324,"context_line":"scheduled during off-peak hours until all rows are migrated."},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"These migrations should commence only after all the N-1 services are upgraded"},{"line_number":327,"context_line":"to N. When there are no N-1 services left, the only writes to the old column"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_548acd64","line":324,"updated":"2016-07-27 10:30:04.000000000","message":"For context, production deployments often have a DB read slave that is a read-only copy. We found they got \"behind\" the updates going into the master DB. This caused tooling issues.\n\nBut if you are close to the limit on your DB, reducing the load will reduce and timeouts your users request would otherwise see. So its good for multiple reasons.\n\nNo need to add this detail here, just felt the need to share that.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":334,"context_line":"this strategy, we have no \"stale data\" problem for the new column."},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"This achieves the second goal of compatibility mode, that is, the new column is"},{"line_number":337,"context_line":"completely prepared for use."},{"line_number":338,"context_line":""},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"Post-compatibility Mode"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_54b80d11","line":337,"updated":"2016-07-27 10:30:04.000000000","message":"Yeah, really this should just be finishing off rows that that online data hasn\u0027t had chance to hit.\n\nThinking about how you can tell if a row has been migrated or not. Its easier if you check that a column is no longer NULL, or something like that.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":351,"context_line":"transition happens instantaneously, we will have some services reading from"},{"line_number":352,"context_line":"the old column and others from the new. To keep the data in sync, services must"},{"line_number":353,"context_line":"write to the old column as well in post-compatibility mode. However, once all"},{"line_number":354,"context_line":"the nodes are out of compatibility mode, this write operation is redundant."},{"line_number":355,"context_line":""},{"line_number":356,"context_line":".. parsed-literal::"},{"line_number":357,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_b4d5091d","line":354,"updated":"2016-07-27 10:30:04.000000000","message":"This seems over complicated.\n\nIf you wait till no N-1 servers are around, then leave compat mode, all the new services need to do are complete the online data migration, before writing back the new data to the new location.\n\nUsually there is no need to write to both the old and the new location. There maybe some exceptions to that, if you have that data in two separate databases, and you need other transition things to happen (we are doing just that with some of the new scheduler transition).","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"4156556affed3f0e8544d1147810185f391998d0","unresolved":false,"context_lines":[{"line_number":351,"context_line":"transition happens instantaneously, we will have some services reading from"},{"line_number":352,"context_line":"the old column and others from the new. To keep the data in sync, services must"},{"line_number":353,"context_line":"write to the old column as well in post-compatibility mode. However, once all"},{"line_number":354,"context_line":"the nodes are out of compatibility mode, this write operation is redundant."},{"line_number":355,"context_line":""},{"line_number":356,"context_line":".. parsed-literal::"},{"line_number":357,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"bacf61ea_4b010e6a","line":354,"in_reply_to":"dada55a8_b4d5091d","updated":"2016-08-03 15:44:36.000000000","message":"I think the problem is that we don\u0027t store version information together with the data in the case of SQL schemas. So when you start writing and reading from the new column and the old version updates the old column, we don\u0027t have a way to distinguish where the up-to-date value is stored.\n\nSo to explain this in another way:\n\n1. We have to start writing to the new column at some point and we can\u0027t stop writing to the old column, because the old version still reads and writes only to the old column\n-\u003e So we start writing to the new column, but at the same time read and write from the old one.\n2. We want to start reading from the new column, but we can do that only when the first version exits, so that data doesn\u0027t get updated only in the old place.\n-\u003e So we upgrade all instances to the second version, migrate data and start introducing a third version, which still writes to both places, but reads from the new.\n3. We want to stop writing to the old column, but the third version still uses it for writes.\n-\u003e So after upgrading to the third version we introduce v4, which drops it from the schema.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":361,"context_line":" |.|                   --------+----------+-------------"},{"line_number":362,"context_line":" |.|                           |          |"},{"line_number":363,"context_line":" |.|                           |          |"},{"line_number":364,"context_line":" |.|                         Write    Read/Write"},{"line_number":365,"context_line":" |.|                           |          |"},{"line_number":366,"context_line":" |.|                           |          |"},{"line_number":367,"context_line":" |.|                       +---v----+-----v----+"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_745431c9","line":364,"range":{"start_line":364,"start_character":29,"end_line":364,"end_character":34},"updated":"2016-07-27 10:30:04.000000000","message":"Why? Surely its a Read?","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":389,"context_line":"the old column in code (for compatibility mode), we can\u0027t yet get rid of the"},{"line_number":390,"context_line":"old column. The old column can be removed only when the N services are"},{"line_number":391,"context_line":"completely rolled out, that is when N+1 is completely deployed. At this stage,"},{"line_number":392,"context_line":"we contract the database."},{"line_number":393,"context_line":""},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"Phases"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_d4acfda0","line":392,"updated":"2016-07-27 10:30:04.000000000","message":"Might be worth saying, you can only drop a column when all the sqlalchemy models being used to access the DB no longer have that column referenced?","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"cb65647c83a74d25eeeff4daafb99cd8f114da49","unresolved":false,"context_lines":[{"line_number":428,"context_line":" |.|"},{"line_number":429,"context_line":" |.|          \u003c------\u003e \u003c--------------\u003e \u003c-----------------------\u003e \u003c--------\u003e"},{"line_number":430,"context_line":" |.|           Expand       Deploy              Migrate            Contract"},{"line_number":431,"context_line":" |.|          \u003c------\u003e \u003c--------------\u003e \u003c-----------------------\u003e \u003c--------\u003e"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"Expand"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_1ee53da3","line":431,"updated":"2016-07-26 14:55:45.000000000","message":"This diagram seems to conflict with the paragraph at line 386, where it says the contract happens during N+1","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":428,"context_line":" |.|"},{"line_number":429,"context_line":" |.|          \u003c------\u003e \u003c--------------\u003e \u003c-----------------------\u003e \u003c--------\u003e"},{"line_number":430,"context_line":" |.|           Expand       Deploy              Migrate            Contract"},{"line_number":431,"context_line":" |.|          \u003c------\u003e \u003c--------------\u003e \u003c-----------------------\u003e \u003c--------\u003e"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"Expand"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_b4918949","line":431,"in_reply_to":"dada55a8_1ee53da3","updated":"2016-07-27 10:30:04.000000000","message":"Yeah, I think above you said its the release after, because of the sqlalchemy model still referencing the column.\n\nWe generally just put a TODO in the model saying remove me during release X.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":443,"context_line":""},{"line_number":444,"context_line":"We propose to make this available by extending the glance-manage utility with"},{"line_number":445,"context_line":"an expand command. The database could be expanded by running"},{"line_number":446,"context_line":"``glance-manage db_expand``."},{"line_number":447,"context_line":""},{"line_number":448,"context_line":".. parsed-literal::"},{"line_number":449,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_94bba5c3","line":446,"updated":"2016-07-27 10:30:04.000000000","message":"glance-manage db expand?","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":454,"context_line":" |.|      -------+-----------------------+------------------------+"},{"line_number":455,"context_line":" |.|             |                       |"},{"line_number":456,"context_line":" |.|             |           |           |                          |"},{"line_number":457,"context_line":" |.|          Read/Write     |        Read/Write                    |"},{"line_number":458,"context_line":" |.|             |       Expand N        |                          |"},{"line_number":459,"context_line":" |.|             |           |           |                     Start deploy"},{"line_number":460,"context_line":" |.|        +----v-----+     |      +----v-----+----------+         \u0026"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_74da7118","line":457,"range":{"start_line":457,"start_character":38,"end_line":457,"end_character":48},"updated":"2016-07-27 10:30:04.000000000","message":"Hmm, this seems to contradict some of the above things.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":479,"context_line":" |.|                         | \u003c--------------------------------- \u003e |"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"Deploy"},{"line_number":483,"context_line":"^^^^^^"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"Goal: Deploy N by upgrading N-1 in a rolling fashion and have both versions"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_b47b49f4","line":482,"updated":"2016-07-27 10:30:04.000000000","message":"So it turns out I have got bored of reading the spec at this point, because its been more than 30 mins reading this doc.\n\nLet me think of a simpler way to structure this...","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":549,"context_line":" |.|           | \u003c---------------------------------------- \u003e |"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"Migrate"},{"line_number":553,"context_line":"^^^^^^^"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"Goal: Populate the new column(s) for N to read from"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_74571126","line":552,"updated":"2016-07-27 10:30:04.000000000","message":"Migrate Data?","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":563,"context_line":""},{"line_number":564,"context_line":"The glance-manage utility can be extended to include a new command that"},{"line_number":565,"context_line":"migrates the data in batches. The batch size could be controlled with a"},{"line_number":566,"context_line":"parameter. For example: ``glance-manage db_migrate --rows\u003d10``."},{"line_number":567,"context_line":"Additionally, this command should ensure the compatibility mode is turned on"},{"line_number":568,"context_line":"by reading the configuration. If it isn\u0027t, no migrations would be performed."},{"line_number":569,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_547bedbd","line":566,"range":{"start_line":566,"start_character":40,"end_line":566,"end_character":50},"updated":"2016-07-27 10:30:04.000000000","message":"glance-manage db migrate_data ? or db online_data_migrate?","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"cb65647c83a74d25eeeff4daafb99cd8f114da49","unresolved":false,"context_lines":[{"line_number":634,"context_line":"    background migrations happen.  There shouldn\u0027t be any question of waiting"},{"line_number":635,"context_line":"    for migrations to be complete since the migration out of the old column was"},{"line_number":636,"context_line":"    completed a long time ago (that is, at the time N was taken out of"},{"line_number":637,"context_line":"    compatability mode)."},{"line_number":638,"context_line":""},{"line_number":639,"context_line":".. parsed-literal::"},{"line_number":640,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_fe3ca9e2","line":637,"updated":"2016-07-26 14:55:45.000000000","message":"+1, I believe this is what Nova and some other projects are doing.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":634,"context_line":"    background migrations happen.  There shouldn\u0027t be any question of waiting"},{"line_number":635,"context_line":"    for migrations to be complete since the migration out of the old column was"},{"line_number":636,"context_line":"    completed a long time ago (that is, at the time N was taken out of"},{"line_number":637,"context_line":"    compatability mode)."},{"line_number":638,"context_line":""},{"line_number":639,"context_line":".. parsed-literal::"},{"line_number":640,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_af4f7069","line":637,"in_reply_to":"dada55a8_fe3ca9e2","updated":"2016-07-27 10:30:04.000000000","message":"I would thinking about N+1 more.\n\nYou want to make sure all the data migrations have completed, then drop compatibility code for reading that in the code base (i.e. tidy up the sql-alchemy model).\n\nThat is the point you can contract, when only N+1 is running, so its N+2 when you could run the contract at the start of that cycle. But its also only N+1 when you can do the contract, really.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":674,"context_line":""},{"line_number":675,"context_line":""},{"line_number":676,"context_line":"Example"},{"line_number":677,"context_line":"-------"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"To understand how this would work in action, consider the following example of"},{"line_number":680,"context_line":"a Glance database change proposed for Newton."}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_af7650a1","line":677,"updated":"2016-07-27 10:30:04.000000000","message":"This sounds mad, but I would start with this, before going through all those details.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":693,"context_line":""},{"line_number":694,"context_line":"#. Pre-upgrade: Version N-1 code read/write to ``is_public``."},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"#. Expand phase: Add the ``visibility`` column."},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"#. The Deploy phase: Start some nodes running version N code in"},{"line_number":699,"context_line":"   compatibility mode.  The version N code will read/write to ``is_public``"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_4fb3544d","line":696,"range":{"start_line":696,"start_character":40,"end_line":696,"end_character":46},"updated":"2016-07-27 10:30:04.000000000","message":"nullable \u003d true, and default is null?","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":697,"context_line":""},{"line_number":698,"context_line":"#. The Deploy phase: Start some nodes running version N code in"},{"line_number":699,"context_line":"   compatibility mode.  The version N code will read/write to ``is_public``"},{"line_number":700,"context_line":"   and also make writes to ``visibility``."},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"   Here\u0027s an analysis of database activity in the compatibility mode."},{"line_number":703,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_cf7d846e","line":700,"range":{"start_line":700,"start_character":3,"end_line":700,"end_character":42},"updated":"2016-07-27 10:30:04.000000000","message":"Lets leave that out for now.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":699,"context_line":"   compatibility mode.  The version N code will read/write to ``is_public``"},{"line_number":700,"context_line":"   and also make writes to ``visibility``."},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"   Here\u0027s an analysis of database activity in the compatibility mode."},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"   * Write operations"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"     * The v1 API"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"       * nothing to worry about, has no concept of ``visibility``"},{"line_number":709,"context_line":""},{"line_number":710,"context_line":"     * The v2 API"},{"line_number":711,"context_line":""},{"line_number":712,"context_line":"       #. ``visibility`` set to ``public``"},{"line_number":713,"context_line":""},{"line_number":714,"context_line":"          * N-1: will put \u00271\u0027 in ``is_public``"},{"line_number":715,"context_line":"          * N: will put \u00271\u0027 in ``is_public``"},{"line_number":716,"context_line":"          * N: will put \u0027public\u0027 in ``visibility``"},{"line_number":717,"context_line":""},{"line_number":718,"context_line":"       #. ``visibility`` set to ``private``"},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"          * N-1: will put \u00270\u0027 in ``is_public``"},{"line_number":721,"context_line":"          * N: will put \u00270\u0027 in ``is_public``"},{"line_number":722,"context_line":"          * N: will put \u0027private\u0027 in ``visibility``"},{"line_number":723,"context_line":""},{"line_number":724,"context_line":"       #. ``visibility`` set to ``community``"},{"line_number":725,"context_line":""},{"line_number":726,"context_line":"          * N-1: call will fail at API level, will never hit the database"},{"line_number":727,"context_line":"          * N: will raise an exception while it is in compatibility mode."},{"line_number":728,"context_line":"          * NOTE: This is an example of an N feature that will not immediately"},{"line_number":729,"context_line":"            be available during the rolling upgrade.  From the end user point"},{"line_number":730,"context_line":"            of view, the N code is acting just like the N-1 code, that is, no"},{"line_number":731,"context_line":"            matter what API node handles the request, the result will be the"},{"line_number":732,"context_line":"            same.  We don\u0027t want to accept the request and write \u0027community\u0027"},{"line_number":733,"context_line":"            into the visibility column -- since neither N-1 nor N code is"},{"line_number":734,"context_line":"            reading that column currently, the image won\u0027t behave as if it\u0027s a"},{"line_number":735,"context_line":"            community image until we\u0027re out of compatability mode, and we don\u0027t"},{"line_number":736,"context_line":"            know how long this may be.  This would lead to a confusing"},{"line_number":737,"context_line":"            experience for end users.  It\u0027s better to just raise an exception"},{"line_number":738,"context_line":"            until the deployment is ready to handle community images."},{"line_number":739,"context_line":""},{"line_number":740,"context_line":"       #. ``visibility`` set to ``shared``"},{"line_number":741,"context_line":""},{"line_number":742,"context_line":"          * N-1: call will fail at API level, will never hit the database"},{"line_number":743,"context_line":"          * N: will write \u00270\u0027 in ``is_public``; this will allow image sharing"},{"line_number":744,"context_line":"            to continue to work properly on the release N-1 nodes as well as"},{"line_number":745,"context_line":"            the v1 API on all nodes.  (It will also allow image sharing to"},{"line_number":746,"context_line":"            work correctly on the release N code, given the adjustments"},{"line_number":747,"context_line":"            described below.)"},{"line_number":748,"context_line":"          * N: will write \u0027shared\u0027 in ``visibility``"},{"line_number":749,"context_line":"          * NOTE: Another option is to reject this call so that N and N-1 act"},{"line_number":750,"context_line":"            the same -- I\u0027m starting to lean toward that.  The N code will see"},{"line_number":751,"context_line":"            visibility \u003d\u003d shared in the model (see below), which is all the"},{"line_number":752,"context_line":"            code implementing sharing in N will care about anyway.  If we don\u0027t"},{"line_number":753,"context_line":"            reject the call, the end user will see different behavior depending"},{"line_number":754,"context_line":"            on what node the load balancer picks, and that\u0027s probably bad."},{"line_number":755,"context_line":""},{"line_number":756,"context_line":"   * Read operations"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"     * The v1 API"},{"line_number":759,"context_line":""},{"line_number":760,"context_line":"       * Since the ``is_public`` column is being populated correctly, current"},{"line_number":761,"context_line":"         reading should work fine"},{"line_number":762,"context_line":""},{"line_number":763,"context_line":"     * The v2 API"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"       #. Public image.  In this case, ``is_public`` \u003d\u003d 1."},{"line_number":766,"context_line":""},{"line_number":767,"context_line":"          * N-1: sqlalchemy layer converts to ``visibility`` \u003d\u003d ``public`` in"},{"line_number":768,"context_line":"            the model"},{"line_number":769,"context_line":"          * N: same as N-1"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":"       #. Private image. In this case, ``is_public`` \u003d\u003d 0."},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"          * N-1: sqlalchemy layer converts to ``visibilty`` \u003d\u003d ``private`` in"},{"line_number":774,"context_line":"            the model.  This is sufficient for the N-1 code to handle image"},{"line_number":775,"context_line":"            sharing correctly."},{"line_number":776,"context_line":"          * N: when ``is_public`` \u003d\u003d 0, the sqlalchemy layer checks to see if"},{"line_number":777,"context_line":"            the image has no members; if so, it sets ``visibilty`` to"},{"line_number":778,"context_line":"            ``private`` in the model."},{"line_number":779,"context_line":""},{"line_number":780,"context_line":"       #. Community image."},{"line_number":781,"context_line":""},{"line_number":782,"context_line":"          * N-1: cannot create a community image in N-1, so this situation"},{"line_number":783,"context_line":"            does not arise."},{"line_number":784,"context_line":"          * N: You cannot create a community image during Compatibility Mode,"},{"line_number":785,"context_line":"            so this situation does not arise."},{"line_number":786,"context_line":""},{"line_number":787,"context_line":"       #. Shared image."},{"line_number":788,"context_line":""},{"line_number":789,"context_line":"          * N-1: sqlalchemy layer converts to ``visibility`` \u003d\u003d ``private`` in"},{"line_number":790,"context_line":"            the model; that the image is shared is determined elsewhere."},{"line_number":791,"context_line":"          * N: when ``is_public`` \u003d\u003d 0, the sqlalchemy layer checks to see if"},{"line_number":792,"context_line":"            the image has at least one member; if so, it sets ``visibility`` to"},{"line_number":793,"context_line":"            ``shared`` in the model, which will allow the release N code to"},{"line_number":794,"context_line":"            handle sharing correctly."},{"line_number":795,"context_line":""},{"line_number":796,"context_line":"   * All N-1 nodes are allowed to drain and then they are stopped.  At"},{"line_number":797,"context_line":"     this point, all nodes online are running release N in compatibility"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_2fe0a028","line":794,"range":{"start_line":702,"start_character":3,"end_line":794,"end_character":37},"updated":"2016-07-27 10:30:04.000000000","message":"Move this section later, it will help folks read this example quickly.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":797,"context_line":"     this point, all nodes online are running release N in compatibility"},{"line_number":798,"context_line":"     mode."},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"#. The Migrate phase: Crawl the \u0027images\u0027 table.  For any row where"},{"line_number":801,"context_line":"   ``visibility`` is null, set the value for ``visibility`` as follows:"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"   * If ``is_public`` is \u00271\u0027: set visibility to ``public``"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_ef5688cc","line":800,"range":{"start_line":800,"start_character":22,"end_line":800,"end_character":47},"updated":"2016-07-27 10:30:04.000000000","message":"Thats what the glance-manage cmd does, I would talk first about how the N code now reads the visibility, if its null, it reads the old value.\n\nIf its not in compatibility mode, it writes the new format back into the DB, if its in compat mode, it doesn\u0027t etc.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":802,"context_line":""},{"line_number":803,"context_line":"   * If ``is_public`` is \u00271\u0027: set visibility to ``public``"},{"line_number":804,"context_line":"   * If ``is_public`` is \u00270\u0027: if the image has any members, set visibility to"},{"line_number":805,"context_line":"     ``shared``; otherwise set visibility to ``private``"},{"line_number":806,"context_line":""},{"line_number":807,"context_line":"#. The Contract phase: The only API nodes running are version N.  Compatability"},{"line_number":808,"context_line":"   mode is turned off, and users can now make the PATCH calls to set visibility"}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_8fd54c44","line":805,"updated":"2016-07-27 10:30:04.000000000","message":"Right, so at this point you have only N nodes running.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":803,"context_line":"   * If ``is_public`` is \u00271\u0027: set visibility to ``public``"},{"line_number":804,"context_line":"   * If ``is_public`` is \u00270\u0027: if the image has any members, set visibility to"},{"line_number":805,"context_line":"     ``shared``; otherwise set visibility to ``private``"},{"line_number":806,"context_line":""},{"line_number":807,"context_line":"#. The Contract phase: The only API nodes running are version N.  Compatability"},{"line_number":808,"context_line":"   mode is turned off, and users can now make the PATCH calls to set visibility"},{"line_number":809,"context_line":"   to community or shared.  The ``is_public`` column is no longer in use."}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_0fc2fc84","line":806,"updated":"2016-07-27 10:30:04.000000000","message":"I guess this is where I would talk explicitly about the glance-manage cmd that does the crawling of the images table.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":804,"context_line":"   * If ``is_public`` is \u00270\u0027: if the image has any members, set visibility to"},{"line_number":805,"context_line":"     ``shared``; otherwise set visibility to ``private``"},{"line_number":806,"context_line":""},{"line_number":807,"context_line":"#. The Contract phase: The only API nodes running are version N.  Compatability"},{"line_number":808,"context_line":"   mode is turned off, and users can now make the PATCH calls to set visibility"},{"line_number":809,"context_line":"   to community or shared.  The ``is_public`` column is no longer in use."},{"line_number":810,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_6f0298b5","line":807,"updated":"2016-07-27 10:30:04.000000000","message":"Erm, there is no contract phase here, its next cycle once the sqlalchemy model no longer references things.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":883,"context_line":""},{"line_number":884,"context_line":"Work Items"},{"line_number":885,"context_line":"----------"},{"line_number":886,"context_line":""},{"line_number":887,"context_line":"* Write documentation for rolling upgrade (developer docs)."},{"line_number":888,"context_line":""},{"line_number":889,"context_line":"* Write documentation for rolling upgrade (operator docs)."}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_94f3a572","line":886,"updated":"2016-07-27 10:30:04.000000000","message":"Honestly, we are missing lots of concrete detail here, on if you are using sqlalchemy migrate, or moving to alembic.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"cb65647c83a74d25eeeff4daafb99cd8f114da49","unresolved":false,"context_lines":[{"line_number":889,"context_line":"* Write documentation for rolling upgrade (operator docs)."},{"line_number":890,"context_line":""},{"line_number":891,"context_line":"* Work with the developers of Newton features that require database changes"},{"line_number":892,"context_line":"  to implement code to follow the rolling upgrade strategy.  These include:"},{"line_number":893,"context_line":""},{"line_number":894,"context_line":"  * community images and enhanced image sharing"},{"line_number":895,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_49389dd3","line":892,"updated":"2016-07-26 14:55:45.000000000","message":"Have any migrations already landed in Newton that break this strategy? If so, do you plan to change them to fit the rolling upgrade strategy? If they are changed, I think folks CD\u0027ing glance are going to get stuck, since the DB won\u0027t match the migrations anymore.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c26f2df3b3250a12fc5edf935acb5f0868dcc20","unresolved":false,"context_lines":[{"line_number":889,"context_line":"* Write documentation for rolling upgrade (operator docs)."},{"line_number":890,"context_line":""},{"line_number":891,"context_line":"* Work with the developers of Newton features that require database changes"},{"line_number":892,"context_line":"  to implement code to follow the rolling upgrade strategy.  These include:"},{"line_number":893,"context_line":""},{"line_number":894,"context_line":"  * community images and enhanced image sharing"},{"line_number":895,"context_line":""}],"source_content_type":"text/x-rst","patch_set":12,"id":"dada55a8_f458218c","line":892,"in_reply_to":"dada55a8_49389dd3","updated":"2016-07-27 10:30:04.000000000","message":"Very, very good question.\n\nIts fine adding this infrastructure to enable this strategy for next cycle, but I am curious what has already landed.","commit_id":"6cffc436acbfcba9bd42830a549eeb0d81d3669b"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":31,"context_line":".. note::"},{"line_number":32,"context_line":"    In what follows, we make the assumption that an operator interested"},{"line_number":33,"context_line":"    in rolling upgrades will meet us halfway, that is, will be using an"},{"line_number":34,"context_line":"    up-to-date version of the underlying DBMS that supports online schema"},{"line_number":35,"context_line":"    changes that allow as much concurrency as possible."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_8f025ab3","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":14},"updated":"2016-09-19 16:19:30.000000000","message":"Could use more specificity here. Since we\u0027re expecting triggers to be supported, we could say 9.0 for PostgreSQL and 5.0.2 for MySQL/MariaDB.","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"9f3c39183384cd024dc2ba4e57bd4aa32e16d47e","unresolved":false,"context_lines":[{"line_number":31,"context_line":".. note::"},{"line_number":32,"context_line":"    In what follows, we make the assumption that an operator interested"},{"line_number":33,"context_line":"    in rolling upgrades will meet us halfway, that is, will be using an"},{"line_number":34,"context_line":"    up-to-date version of the underlying DBMS that supports online schema"},{"line_number":35,"context_line":"    changes that allow as much concurrency as possible."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_c76b5b84","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":14},"in_reply_to":"7a8ec9b2_8f025ab3","updated":"2016-09-20 21:09:16.000000000","message":"Might also be valuable to note that these generations of PostgreSQL and MySQL date from Sept 2010 from Dec 2004 respectively? Probably should double check those dates as well if they are used.","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":54,"context_line":"Overview"},{"line_number":55,"context_line":"--------"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"The following diagram depicts a typical upgrade of an OpenStack service. The"},{"line_number":58,"context_line":"older services are shutdown completely (mostly during a maintenance window),"},{"line_number":59,"context_line":"the new code is deployed and finally the new services are started. Obviously,"},{"line_number":60,"context_line":"this involves some downtime for the users. To minimize/eliminate downtime, the"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_2fe146ff","line":57,"range":{"start_line":57,"start_character":39,"end_line":57,"end_character":40},"updated":"2016-09-19 16:19:30.000000000","message":"^ \"offline\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":58,"context_line":"older services are shutdown completely (mostly during a maintenance window),"},{"line_number":59,"context_line":"the new code is deployed and finally the new services are started. Obviously,"},{"line_number":60,"context_line":"this involves some downtime for the users. To minimize/eliminate downtime, the"},{"line_number":61,"context_line":"services can be upgraded in a rolling fashion, that is, upgrading few services"},{"line_number":62,"context_line":"at a time. This results in a situation where both old (say N-1) and new (say N)"},{"line_number":63,"context_line":"services must co-exist for a certain period of time. In a straightforward"},{"line_number":64,"context_line":"upgrade where the new services have no database changes associated with them,"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_2f86a613","line":61,"range":{"start_line":61,"start_character":65,"end_line":61,"end_character":69},"updated":"2016-09-19 16:19:30.000000000","message":"s/few/a few/","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":59,"context_line":"the new code is deployed and finally the new services are started. Obviously,"},{"line_number":60,"context_line":"this involves some downtime for the users. To minimize/eliminate downtime, the"},{"line_number":61,"context_line":"services can be upgraded in a rolling fashion, that is, upgrading few services"},{"line_number":62,"context_line":"at a time. This results in a situation where both old (say N-1) and new (say N)"},{"line_number":63,"context_line":"services must co-exist for a certain period of time. In a straightforward"},{"line_number":64,"context_line":"upgrade where the new services have no database changes associated with them,"},{"line_number":65,"context_line":"the services can co-exist right from the onset as both rely on the same schema."}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_8fc33a38","line":62,"range":{"start_line":62,"start_character":55,"end_line":62,"end_character":58},"updated":"2016-09-19 16:19:30.000000000","message":"s/say//\n(N \u0026 N-1 were already mentioned previously on lines 27-28)","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":99,"context_line":"This approach at times, depending on the nature of schema changes, is"},{"line_number":100,"context_line":"backwards-incompatible. That is, older services may not be able to run with new"},{"line_number":101,"context_line":"schema. This essentially limits the ability for old and new services to"},{"line_number":102,"context_line":"co-exist and consequently rolling upgrades."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"To achieve rolling upgrades, database migrations need to be done in such a way"},{"line_number":105,"context_line":"that both old and new services can co-exist over a period of time. A well known"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_8f76da04","line":102,"range":{"start_line":102,"start_character":25,"end_line":102,"end_character":26},"updated":"2016-09-19 16:19:30.000000000","message":"^ \"support\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"To achieve rolling upgrades, database migrations need to be done in such a way"},{"line_number":105,"context_line":"that both old and new services can co-exist over a period of time. A well known"},{"line_number":106,"context_line":"strategy is to re-imagine database changes in ``expand and contract`` style"},{"line_number":107,"context_line":"instead of one atomic change. With the expand and contract style, we achieve"},{"line_number":108,"context_line":"the desired schema changes in two distinct steps:"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    * **Expand**: In the ``expand`` step, we make ``only additive changes``"},{"line_number":111,"context_line":"      that are required by the new services. This keeps the schema intact for"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_0fb56a7d","line":108,"range":{"start_line":106,"start_character":15,"end_line":108,"end_character":48},"updated":"2016-09-19 16:19:30.000000000","message":"could reduce this to:\nbreak up the database changes into ``expand`` and ``contract`` phases:","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":112,"context_line":"      older services to run along with the new services. The typical schema"},{"line_number":113,"context_line":"      changes that fall into this category are adding columns and tables."},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    * **Contract**: All the other changes, that is ``non-additive changes``,"},{"line_number":116,"context_line":"      are grouped into ``contract`` step. Changes like removing a column, table"},{"line_number":117,"context_line":"      and/or constraints are made in this step."},{"line_number":118,"context_line":""}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_6f5a6e52","line":115,"range":{"start_line":115,"start_character":41,"end_line":115,"end_character":76},"updated":"2016-09-19 16:19:30.000000000","message":"\"are considered ``non-additive changes`` and\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":120,"context_line":"first (while keeping schema compatibility with old services) and delay the"},{"line_number":121,"context_line":"other changes until a later point in time. Therefore, we always first expand"},{"line_number":122,"context_line":"the database in order to start a rolling upgrade while the old services are"},{"line_number":123,"context_line":"still running. Once the database is expanded, the new columns and tables are"},{"line_number":124,"context_line":"created. However, they would be empty. At this point, we should start migrating"},{"line_number":125,"context_line":"the data over to the new column. But, at the same time, it is important to"},{"line_number":126,"context_line":"keep the new and old columns in sync. Any writes to old column must be sync-ed"},{"line_number":127,"context_line":"to the new column. And, vice-versa (although we don\u0027t write to the new column"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_8a3328f6","line":124,"range":{"start_line":123,"start_character":73,"end_line":124,"end_character":37},"updated":"2016-09-19 16:19:30.000000000","message":"\"have been created but are still empty.\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":123,"context_line":"still running. Once the database is expanded, the new columns and tables are"},{"line_number":124,"context_line":"created. However, they would be empty. At this point, we should start migrating"},{"line_number":125,"context_line":"the data over to the new column. But, at the same time, it is important to"},{"line_number":126,"context_line":"keep the new and old columns in sync. Any writes to old column must be sync-ed"},{"line_number":127,"context_line":"to the new column. And, vice-versa (although we don\u0027t write to the new column"},{"line_number":128,"context_line":"yet, we have to keep the old column in sync when the new services come up and"},{"line_number":129,"context_line":"start writing to the new column while the services co-exist). We use database"},{"line_number":130,"context_line":"triggers to keep the columns in sync."},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"We add the triggers to the database along with the additive changes"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_ead66c26","line":129,"range":{"start_line":126,"start_character":38,"end_line":129,"end_character":61},"updated":"2016-09-19 16:19:30.000000000","message":"This section is awkward. Perhaps it\u0027s enough to just say:\n\n\"Any writes to the old column must be sync-ed to the new column and vice-versa. We propose to use database triggers to achieve this.\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"We add the triggers to the database along with the additive changes"},{"line_number":133,"context_line":"during the database expand. At this point, we start migrating the data over to"},{"line_number":134,"context_line":"the new column. However, because the old services are live at this point, we"},{"line_number":135,"context_line":"migrate the data in small batches to avoid excessive load on the database and"},{"line_number":136,"context_line":"thereby any interruption to the old services. These migrations can be scheduled"},{"line_number":137,"context_line":"to run during low-traffic hours to minimize impact on older services. Once the"},{"line_number":138,"context_line":"data migrations finish, the new column is populated and ready for use, we start"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_cab450d6","line":135,"range":{"start_line":134,"start_character":14,"end_line":135,"end_character":17},"updated":"2016-09-19 16:19:30.000000000","message":"can remove this and join two sentences, i.e.\n\n\"we start migrating data over to the new column in small batches to avoid...\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"9f3c39183384cd024dc2ba4e57bd4aa32e16d47e","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"We add the triggers to the database along with the additive changes"},{"line_number":133,"context_line":"during the database expand. At this point, we start migrating the data over to"},{"line_number":134,"context_line":"the new column. However, because the old services are live at this point, we"},{"line_number":135,"context_line":"migrate the data in small batches to avoid excessive load on the database and"},{"line_number":136,"context_line":"thereby any interruption to the old services. These migrations can be scheduled"},{"line_number":137,"context_line":"to run during low-traffic hours to minimize impact on older services. Once the"},{"line_number":138,"context_line":"data migrations finish, the new column is populated and ready for use, we start"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_beeb8311","line":135,"range":{"start_line":134,"start_character":14,"end_line":135,"end_character":17},"in_reply_to":"7a8ec9b2_cab450d6","updated":"2016-09-20 21:09:16.000000000","message":"who is \"we\" in this case? Operators?","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"To summarize, as shown in the above diagram, we split the database migrations"},{"line_number":183,"context_line":"into schema and data migrations. The schema migrations can only either be"},{"line_number":184,"context_line":"strictly additive or contractive in nature, or a combination of both. Additive"},{"line_number":185,"context_line":"schema migrations are run before the upgrade begins to prepare the database"},{"line_number":186,"context_line":"for new services while it is still usable by old services."},{"line_number":187,"context_line":"(This phase is also called \"database expand\".) During database expand, we also"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_4a6cc036","line":184,"range":{"start_line":184,"start_character":44,"end_line":184,"end_character":68},"updated":"2016-09-19 16:19:30.000000000","message":"this confuses me, especially since you used the phrase \"only either\" earlier in the sentence. Perhaps can say instead: The schema migrations are separated into strictly additive and contractive phases.","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"Goal: Prepare database for N by expanding the database"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"As show in the below diagram, initially, we have N-1 reading from and writing"},{"line_number":210,"context_line":"to the old column. We then expand the schema for N which introduces the new"},{"line_number":211,"context_line":"column while N-1 is still running. This should have minimal to no impact on"},{"line_number":212,"context_line":"N-1 services."}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_4ada00eb","line":209,"range":{"start_line":209,"start_character":3,"end_line":209,"end_character":8},"updated":"2016-09-19 16:19:30.000000000","message":"s/show/shown/","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    online DDL capabilities in MySQL 5.6 for InnoDB. So, simple changes may not"},{"line_number":219,"context_line":"    be a concern."},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":222,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"},{"line_number":223,"context_line":"    early phase of the rolling upgrade, some constraints may need to be handled"},{"line_number":224,"context_line":"    in code instead of relying on the DBMS.  Further, a \"bad\" constraint change"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_ea4d8c9a","line":221,"range":{"start_line":221,"start_character":15,"end_line":221,"end_character":19},"updated":"2016-09-19 16:19:30.000000000","message":"s/flag/stress","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":274,"context_line":""},{"line_number":275,"context_line":"Goal: Populate the new column(s) for N to use"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"At this point, only release N code is running and it continues to read from and"},{"line_number":278,"context_line":"write to the old column as show in the below diagram. All writes made by N-1"},{"line_number":279,"context_line":"to the old column are synced with the new column. While the triggers slowly"},{"line_number":280,"context_line":"start populating the new column, we commence the background data migrations to"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_0a11d85d","line":277,"range":{"start_line":277,"start_character":28,"end_line":277,"end_character":29},"updated":"2016-09-19 16:19:30.000000000","message":"s/N/N-1/","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"As the new column is now ready to use, we start deploying N in small batches."},{"line_number":330,"context_line":"Release N-1 has no idea that an upgrade is occurring, but the release N code"},{"line_number":331,"context_line":"is co-existing with N-1 services as show in the below diagram. While N-1 and N"},{"line_number":332,"context_line":"services are using the old and new column respectively, the triggers are"},{"line_number":333,"context_line":"keeping the two columns in sync whenever there is a database write. This"},{"line_number":334,"context_line":"enables N to see the updates made by N-1 and vice-versa."}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_8cf505cd","line":331,"range":{"start_line":331,"start_character":36,"end_line":331,"end_character":40},"updated":"2016-09-19 16:19:30.000000000","message":"s/show/shown/","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":438,"context_line":" |.|              |"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":".. note::"},{"line_number":441,"context_line":"    In addition to removing the unused columns and tables, SQL constraints such"},{"line_number":442,"context_line":"    as nullability, unique and default must be set here."},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"Deliverable: We propose to make this available by extending the glance-manage"},{"line_number":445,"context_line":"utility with a contract command. The database could be contracted by running"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_ccc46d61","line":442,"range":{"start_line":441,"start_character":4,"end_line":442,"end_character":55},"updated":"2016-09-19 16:19:30.000000000","message":"I understand why, but perhaps a more detailed explanation is needed here.","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"9f3c39183384cd024dc2ba4e57bd4aa32e16d47e","unresolved":false,"context_lines":[{"line_number":438,"context_line":" |.|              |"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":".. note::"},{"line_number":441,"context_line":"    In addition to removing the unused columns and tables, SQL constraints such"},{"line_number":442,"context_line":"    as nullability, unique and default must be set here."},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"Deliverable: We propose to make this available by extending the glance-manage"},{"line_number":445,"context_line":"utility with a contract command. The database could be contracted by running"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_7f76523f","line":442,"range":{"start_line":441,"start_character":4,"end_line":442,"end_character":55},"in_reply_to":"7a8ec9b2_ccc46d61","updated":"2016-09-20 21:09:16.000000000","message":"+1 \n\nWhat about changes that do create table write locks? We should have a recommended strategy for dealing with them (such as accommodating a potential read-only mode in the service during contract).","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"9f3c39183384cd024dc2ba4e57bd4aa32e16d47e","unresolved":false,"context_lines":[{"line_number":466,"context_line":"   ``glance-manage db migrate --rows\u003d\u003cmax. row count\u003e``."},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"    Data migrations must be scheduled to run until no more rows are left to"},{"line_number":469,"context_line":"    migrate."},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"6. Start the Glance processes on the first node."},{"line_number":472,"context_line":""}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_1feaaeac","line":469,"updated":"2016-09-20 21:09:16.000000000","message":"To facilitate this logic, it is important for there to be a mechanism that allows either the rows remaining or the rows modified by the last migrate to be returned by some manage command.","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"9f3c39183384cd024dc2ba4e57bd4aa32e16d47e","unresolved":false,"context_lines":[{"line_number":477,"context_line":".. note::"},{"line_number":478,"context_line":"    Before stopping the Glance processes on a node, one may choose to wait"},{"line_number":479,"context_line":"    until all the existing connections drain out. This could be achieved by"},{"line_number":480,"context_line":"    taking the node out of rotation. This way all the requests that are"},{"line_number":481,"context_line":"    currently being processed will get a chance to finish processing."},{"line_number":482,"context_line":"    However, some Glance requests like uploading and downloading the images"},{"line_number":483,"context_line":"    may last a long time. This increases the wait time to drain out all"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_7f49f2cf","line":480,"range":{"start_line":480,"start_character":27,"end_line":480,"end_character":35},"updated":"2016-09-20 21:09:16.000000000","message":"maybe more specificity: \"the pool of backends for the load balancer\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":521,"context_line":"   * If ``is_public`` is \u00270\u0027: if the image has any members, set visibility to"},{"line_number":522,"context_line":"     ``shared``; otherwise set visibility to ``private``"},{"line_number":523,"context_line":""},{"line_number":524,"context_line":"   Migrate any data (using triggers) written by N-1 code to the old column"},{"line_number":525,"context_line":"   using the above criteria."},{"line_number":526,"context_line":""},{"line_number":527,"context_line":"#. Deploy: Deploy N code in a rolling fashion. N code will start using the"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_ec93e9fe","line":524,"range":{"start_line":524,"start_character":3,"end_line":524,"end_character":36},"updated":"2016-09-19 16:19:30.000000000","message":"\"While background migrations are occurring, any data written by N-1 services to the old column is sync-ed to the new column using triggers.\"","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":527,"context_line":"#. Deploy: Deploy N code in a rolling fashion. N code will start using the"},{"line_number":528,"context_line":"   ``visibility`` column."},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"   Here\u0027s an analysis of database activity."},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"   * Write operations"},{"line_number":533,"context_line":""}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_ac2e41a3","line":530,"range":{"start_line":530,"start_character":3,"end_line":530,"end_character":42},"updated":"2016-09-19 16:19:30.000000000","message":"This analysis only focuses on N code operations. Perhaps should say so, or add N-1 operations (i.e. changes to is_public)","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":559,"context_line":""},{"line_number":560,"context_line":"             .. note::"},{"line_number":561,"context_line":"              This essentially means that a community image will be"},{"line_number":562,"context_line":"              considered as private image by N-1. Thus, barring the owner,"},{"line_number":563,"context_line":"              a community image won\u0027t be visible to any one. Since N-1 has no"},{"line_number":564,"context_line":"              notion of  community images, this behavior can be seen as"},{"line_number":565,"context_line":"              consistent w.r.t N-1. However, it may be confusing the owner of"},{"line_number":566,"context_line":"              the community image for whom the image will appear as community"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_0f51e70e","line":563,"range":{"start_line":562,"start_character":50,"end_line":563,"end_character":59},"updated":"2016-09-19 16:19:30.000000000","message":"don\u0027t really need this sentence","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":565,"context_line":"              consistent w.r.t N-1. However, it may be confusing the owner of"},{"line_number":566,"context_line":"              the community image for whom the image will appear as community"},{"line_number":567,"context_line":"              with N and private with N-1. Thus, the owner may try to change"},{"line_number":568,"context_line":"              the visibility again. To discourage this, we may prohibit any"},{"line_number":569,"context_line":"              writes to the ``is_public`` column when it has \u00270\u0027 and"},{"line_number":570,"context_line":"              ``visibility`` column has ``community``. This could be done"},{"line_number":571,"context_line":"              again by using the same triggers that we added during database"}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_8fd97786","line":568,"range":{"start_line":568,"start_character":39,"end_line":568,"end_character":49},"updated":"2016-09-19 16:19:30.000000000","message":"How would this actually discourage the user? It may only confuse them further.","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"63663dffecb32585fbf22ec82cd1404ad3b5b5c0","unresolved":false,"context_lines":[{"line_number":660,"context_line":"------------------"},{"line_number":661,"context_line":""},{"line_number":662,"context_line":"The background data migration will consume extra database resources, but this"},{"line_number":663,"context_line":"can be mitigated if the migration script is carefully written."},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"Other deployer impact"},{"line_number":666,"context_line":"---------------------"}],"source_content_type":"text/x-rst","patch_set":14,"id":"5a8bc5a2_0d28bde1","line":663,"updated":"2016-09-23 15:39:36.000000000","message":"Also need to note that after expand and before the contract phase, the database may be running without appropriate constraints which could cause degrated query performance as some query plans related to expanded columns or tables may not be able to make use of consraint features such as unique indexes in constructing query plans.","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"dcd2f6c8f470f7387cd61bdaf722807c14e03c75","unresolved":false,"context_lines":[{"line_number":672,"context_line":"Developer impact"},{"line_number":673,"context_line":"----------------"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"Any developer working on a feature that requires database changes must write"},{"line_number":676,"context_line":"additional code to support the rolling upgrade strategy outlined in this"},{"line_number":677,"context_line":"document.  By confining the database changes to a single release, however,"},{"line_number":678,"context_line":"developers of release N+1 do not have to worry about completing procedures"},{"line_number":679,"context_line":"begun during the migration of release N-1 to N."},{"line_number":680,"context_line":""}],"source_content_type":"text/x-rst","patch_set":14,"id":"7a8ec9b2_8f78972d","line":677,"range":{"start_line":675,"start_character":0,"end_line":677,"end_character":8},"updated":"2016-09-19 16:19:30.000000000","message":"Isn\u0027t this actually obviated by use of triggers? Or do you mean the writing of the triggers when you say \"write additional code\"?","commit_id":"cf807501f6181198aeb41d351cbe2a47588aaead"}],"specs/ocata/approved/glance/database-strategy-for-rolling-upgrades.rst":[{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"f7baea09ac4615fcfb152964c088e46c3341b2ef","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"Goal: Prepare database for N by expanding the database"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"As show in the below diagram, initially, we have N-1 reading from and writing"},{"line_number":210,"context_line":"to the old column. We then expand the schema for N which introduces the new"},{"line_number":211,"context_line":"column while N-1 is still running. This should have minimal to no impact on"},{"line_number":212,"context_line":"N-1 services."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_66ebfe78","line":209,"range":{"start_line":209,"start_character":3,"end_line":209,"end_character":7},"updated":"2016-11-17 01:20:41.000000000","message":"s/show/shown/","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"59811687d8ecb6a67f0a25cdccdfafeecfe9b22f","unresolved":false,"context_lines":[{"line_number":206,"context_line":""},{"line_number":207,"context_line":"Goal: Prepare database for N by expanding the database"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"As show in the below diagram, initially, we have N-1 reading from and writing"},{"line_number":210,"context_line":"to the old column. We then expand the schema for N which introduces the new"},{"line_number":211,"context_line":"column while N-1 is still running. This should have minimal to no impact on"},{"line_number":212,"context_line":"N-1 services."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_2f5215de","line":209,"range":{"start_line":209,"start_character":3,"end_line":209,"end_character":7},"in_reply_to":"7a77a97e_66ebfe78","updated":"2016-11-21 21:56:10.000000000","message":"Done","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"f7baea09ac4615fcfb152964c088e46c3341b2ef","unresolved":false,"context_lines":[{"line_number":275,"context_line":"Goal: Populate the new column(s) for N to use"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"At this point, only release N code is running and it continues to read from and"},{"line_number":278,"context_line":"write to the old column as show in the below diagram. All writes made by N-1"},{"line_number":279,"context_line":"to the old column are synced with the new column. While the triggers slowly"},{"line_number":280,"context_line":"start populating the new column, we commence the background data migrations to"},{"line_number":281,"context_line":"populate data into the new column in a non-intrusive manner."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_a601963a","line":278,"range":{"start_line":278,"start_character":27,"end_line":278,"end_character":31},"updated":"2016-11-17 01:20:41.000000000","message":"s/show/shown/","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"59811687d8ecb6a67f0a25cdccdfafeecfe9b22f","unresolved":false,"context_lines":[{"line_number":275,"context_line":"Goal: Populate the new column(s) for N to use"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"At this point, only release N code is running and it continues to read from and"},{"line_number":278,"context_line":"write to the old column as show in the below diagram. All writes made by N-1"},{"line_number":279,"context_line":"to the old column are synced with the new column. While the triggers slowly"},{"line_number":280,"context_line":"start populating the new column, we commence the background data migrations to"},{"line_number":281,"context_line":"populate data into the new column in a non-intrusive manner."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_cf4a8127","line":278,"range":{"start_line":278,"start_character":27,"end_line":278,"end_character":31},"in_reply_to":"7a77a97e_a601963a","updated":"2016-11-21 21:56:10.000000000","message":"Done","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"f7baea09ac4615fcfb152964c088e46c3341b2ef","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"As the new column is now ready to use, we start deploying N in small batches."},{"line_number":330,"context_line":"Release N-1 has no idea that an upgrade is occurring, but the release N code"},{"line_number":331,"context_line":"is co-existing with N-1 services as show in the below diagram. While N-1 and N"},{"line_number":332,"context_line":"services are using the old and new column respectively, the triggers are"},{"line_number":333,"context_line":"keeping the two columns in sync whenever there is a database write. This"},{"line_number":334,"context_line":"enables N to see the updates made by N-1 and vice-versa."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_c6fa1243","line":331,"range":{"start_line":331,"start_character":36,"end_line":331,"end_character":40},"updated":"2016-11-17 01:20:41.000000000","message":"s/show/shown","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"59811687d8ecb6a67f0a25cdccdfafeecfe9b22f","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":"As the new column is now ready to use, we start deploying N in small batches."},{"line_number":330,"context_line":"Release N-1 has no idea that an upgrade is occurring, but the release N code"},{"line_number":331,"context_line":"is co-existing with N-1 services as show in the below diagram. While N-1 and N"},{"line_number":332,"context_line":"services are using the old and new column respectively, the triggers are"},{"line_number":333,"context_line":"keeping the two columns in sync whenever there is a database write. This"},{"line_number":334,"context_line":"enables N to see the updates made by N-1 and vice-versa."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_0f5559c5","line":331,"range":{"start_line":331,"start_character":36,"end_line":331,"end_character":40},"in_reply_to":"7a77a97e_c6fa1243","updated":"2016-11-21 21:56:10.000000000","message":"Done","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"f7baea09ac4615fcfb152964c088e46c3341b2ef","unresolved":false,"context_lines":[{"line_number":495,"context_line":"-------"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"To understand how this would work in action, consider the following example of"},{"line_number":498,"context_line":"a Glance database change proposed for Newton."},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"The \"old column\": Mitaka (release N-1): boolean ``is_public`` column in images"},{"line_number":501,"context_line":"table.  This column has nullable\u003dFalse and default\u003dFalse."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_269ca60e","line":498,"range":{"start_line":498,"start_character":38,"end_line":498,"end_character":44},"updated":"2016-11-17 01:20:41.000000000","message":"s/Newton/Ocata/","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"59811687d8ecb6a67f0a25cdccdfafeecfe9b22f","unresolved":false,"context_lines":[{"line_number":495,"context_line":"-------"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"To understand how this would work in action, consider the following example of"},{"line_number":498,"context_line":"a Glance database change proposed for Newton."},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"The \"old column\": Mitaka (release N-1): boolean ``is_public`` column in images"},{"line_number":501,"context_line":"table.  This column has nullable\u003dFalse and default\u003dFalse."}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_af5c65ee","line":498,"range":{"start_line":498,"start_character":38,"end_line":498,"end_character":44},"in_reply_to":"7a77a97e_269ca60e","updated":"2016-11-21 21:56:10.000000000","message":"Done","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"f7baea09ac4615fcfb152964c088e46c3341b2ef","unresolved":false,"context_lines":[{"line_number":497,"context_line":"To understand how this would work in action, consider the following example of"},{"line_number":498,"context_line":"a Glance database change proposed for Newton."},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"The \"old column\": Mitaka (release N-1): boolean ``is_public`` column in images"},{"line_number":501,"context_line":"table.  This column has nullable\u003dFalse and default\u003dFalse."},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"The \"new column\": Newton (release N) : enum (or string ... key point is it\u0027s a"}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_868bbac2","line":500,"range":{"start_line":500,"start_character":18,"end_line":500,"end_character":24},"updated":"2016-11-17 01:20:41.000000000","message":"s/Mitaka/Newton/","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"59811687d8ecb6a67f0a25cdccdfafeecfe9b22f","unresolved":false,"context_lines":[{"line_number":497,"context_line":"To understand how this would work in action, consider the following example of"},{"line_number":498,"context_line":"a Glance database change proposed for Newton."},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"The \"old column\": Mitaka (release N-1): boolean ``is_public`` column in images"},{"line_number":501,"context_line":"table.  This column has nullable\u003dFalse and default\u003dFalse."},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"The \"new column\": Newton (release N) : enum (or string ... key point is it\u0027s a"}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_ef6e5d95","line":500,"range":{"start_line":500,"start_character":18,"end_line":500,"end_character":24},"in_reply_to":"7a77a97e_868bbac2","updated":"2016-11-21 21:56:10.000000000","message":"Done","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"f7baea09ac4615fcfb152964c088e46c3341b2ef","unresolved":false,"context_lines":[{"line_number":500,"context_line":"The \"old column\": Mitaka (release N-1): boolean ``is_public`` column in images"},{"line_number":501,"context_line":"table.  This column has nullable\u003dFalse and default\u003dFalse."},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"The \"new column\": Newton (release N) : enum (or string ... key point is it\u0027s a"},{"line_number":504,"context_line":"different data type) ``visibility`` column in images table.  This column can"},{"line_number":505,"context_line":"have one of the values \u0027public\u0027, \u0027private\u0027, \u0027shared\u0027, \u0027community\u0027.  After the"},{"line_number":506,"context_line":"database contraction has completed, this column would have"}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_26c3c6ee","line":503,"range":{"start_line":503,"start_character":18,"end_line":503,"end_character":24},"updated":"2016-11-17 01:20:41.000000000","message":"s/Newton/Ocata/","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"59811687d8ecb6a67f0a25cdccdfafeecfe9b22f","unresolved":false,"context_lines":[{"line_number":500,"context_line":"The \"old column\": Mitaka (release N-1): boolean ``is_public`` column in images"},{"line_number":501,"context_line":"table.  This column has nullable\u003dFalse and default\u003dFalse."},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"The \"new column\": Newton (release N) : enum (or string ... key point is it\u0027s a"},{"line_number":504,"context_line":"different data type) ``visibility`` column in images table.  This column can"},{"line_number":505,"context_line":"have one of the values \u0027public\u0027, \u0027private\u0027, \u0027shared\u0027, \u0027community\u0027.  After the"},{"line_number":506,"context_line":"database contraction has completed, this column would have"}],"source_content_type":"text/x-rst","patch_set":15,"id":"7a77a97e_0f6c799b","line":503,"range":{"start_line":503,"start_character":18,"end_line":503,"end_character":24},"in_reply_to":"7a77a97e_26c3c6ee","updated":"2016-11-21 21:56:10.000000000","message":"Done","commit_id":"0fe0bf802ceb0e8ba391e84f8b584981a25f4b1c"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"a5401363c8cad11d0df7d023db98b524dba2d757","unresolved":false,"context_lines":[{"line_number":102,"context_line":"This approach at times, depending on the nature of schema changes, is"},{"line_number":103,"context_line":"backwards-incompatible. That is, older services may not be able to run with new"},{"line_number":104,"context_line":"schema. This essentially limits the ability for old and new services to"},{"line_number":105,"context_line":"co-exist and consequently rolling upgrades."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"To achieve rolling upgrades, database migrations need to be done in such a way"},{"line_number":108,"context_line":"that both old and new services can co-exist over a period of time. A well known"}],"source_content_type":"text/x-rst","patch_set":16,"id":"7a77a97e_65e1549a","line":105,"range":{"start_line":105,"start_character":13,"end_line":105,"end_character":42},"updated":"2016-11-22 21:32:38.000000000","message":"\"consequently \u003cprevents|disallows|prohibits|disables\u003e rolling upgrades\" ?","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"eb1471aef10a740751b2b83d00350b817ae19195","unresolved":false,"context_lines":[{"line_number":102,"context_line":"This approach at times, depending on the nature of schema changes, is"},{"line_number":103,"context_line":"backwards-incompatible. That is, older services may not be able to run with new"},{"line_number":104,"context_line":"schema. This essentially limits the ability for old and new services to"},{"line_number":105,"context_line":"co-exist and consequently rolling upgrades."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"To achieve rolling upgrades, database migrations need to be done in such a way"},{"line_number":108,"context_line":"that both old and new services can co-exist over a period of time. A well known"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_751de8bc","line":105,"range":{"start_line":105,"start_character":13,"end_line":105,"end_character":42},"in_reply_to":"7a77a97e_65e1549a","updated":"2016-11-22 22:02:23.000000000","message":"Done","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"a5401363c8cad11d0df7d023db98b524dba2d757","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    * **Contract**: All the other changes, that is ``non-additive changes``,"},{"line_number":119,"context_line":"      are grouped into ``contract`` step. Changes like removing a column, table"},{"line_number":120,"context_line":"      and/or constraints are made in this step."},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"This break up gives us the ability to perform the minimum required changes"},{"line_number":123,"context_line":"first (while keeping schema compatibility with old services) and delay the"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_75b6c83e","line":120,"range":{"start_line":120,"start_character":13,"end_line":120,"end_character":24},"updated":"2016-11-22 21:32:38.000000000","message":"Some constraints need to be removed in the expand phase, to allow triggers to work. Perhaps should add that to expand above and say that we may re-apply constraints in contract phase.","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"eb1471aef10a740751b2b83d00350b817ae19195","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    * **Contract**: All the other changes, that is ``non-additive changes``,"},{"line_number":119,"context_line":"      are grouped into ``contract`` step. Changes like removing a column, table"},{"line_number":120,"context_line":"      and/or constraints are made in this step."},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"This break up gives us the ability to perform the minimum required changes"},{"line_number":123,"context_line":"first (while keeping schema compatibility with old services) and delay the"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_75f9684d","line":120,"range":{"start_line":120,"start_character":13,"end_line":120,"end_character":24},"in_reply_to":"5a74a57a_75b6c83e","updated":"2016-11-22 22:02:23.000000000","message":"Done","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"a5401363c8cad11d0df7d023db98b524dba2d757","unresolved":false,"context_lines":[{"line_number":119,"context_line":"      are grouped into ``contract`` step. Changes like removing a column, table"},{"line_number":120,"context_line":"      and/or constraints are made in this step."},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"This break up gives us the ability to perform the minimum required changes"},{"line_number":123,"context_line":"first (while keeping schema compatibility with old services) and delay the"},{"line_number":124,"context_line":"other changes until a later point in time. Therefore, we always first expand"},{"line_number":125,"context_line":"the database in order to start a rolling upgrade while the old services are"}],"source_content_type":"text/x-rst","patch_set":16,"id":"7a77a97e_859590e5","line":122,"range":{"start_line":122,"start_character":5,"end_line":122,"end_character":13},"updated":"2016-11-22 21:32:38.000000000","message":"s/break up/breakup/","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"eb1471aef10a740751b2b83d00350b817ae19195","unresolved":false,"context_lines":[{"line_number":119,"context_line":"      are grouped into ``contract`` step. Changes like removing a column, table"},{"line_number":120,"context_line":"      and/or constraints are made in this step."},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"This break up gives us the ability to perform the minimum required changes"},{"line_number":123,"context_line":"first (while keeping schema compatibility with old services) and delay the"},{"line_number":124,"context_line":"other changes until a later point in time. Therefore, we always first expand"},{"line_number":125,"context_line":"the database in order to start a rolling upgrade while the old services are"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_959444e9","line":122,"range":{"start_line":122,"start_character":5,"end_line":122,"end_character":13},"in_reply_to":"7a77a97e_859590e5","updated":"2016-11-22 22:02:23.000000000","message":"Done","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"a5401363c8cad11d0df7d023db98b524dba2d757","unresolved":false,"context_lines":[{"line_number":129,"context_line":"keep the new and old columns in sync. Any writes to old column must be sync-ed"},{"line_number":130,"context_line":"to the new column. And, vice-versa (although we don\u0027t write to the new column"},{"line_number":131,"context_line":"yet, we have to keep the old column in sync when the new services come up and"},{"line_number":132,"context_line":"start writing to the new column while the services co-exist). We use database"},{"line_number":133,"context_line":"triggers to keep the columns in sync."},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"We add the triggers to the database along with the additive changes"},{"line_number":136,"context_line":"during the database expand. At this point, we start migrating the data over to"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_b586a063","line":133,"range":{"start_line":132,"start_character":69,"end_line":133,"end_character":8},"updated":"2016-11-22 21:32:38.000000000","message":"would it make sense to have \"database triggers\" in bold for emphasis?","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"eb1471aef10a740751b2b83d00350b817ae19195","unresolved":false,"context_lines":[{"line_number":129,"context_line":"keep the new and old columns in sync. Any writes to old column must be sync-ed"},{"line_number":130,"context_line":"to the new column. And, vice-versa (although we don\u0027t write to the new column"},{"line_number":131,"context_line":"yet, we have to keep the old column in sync when the new services come up and"},{"line_number":132,"context_line":"start writing to the new column while the services co-exist). We use database"},{"line_number":133,"context_line":"triggers to keep the columns in sync."},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"We add the triggers to the database along with the additive changes"},{"line_number":136,"context_line":"during the database expand. At this point, we start migrating the data over to"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_55aaac1a","line":133,"range":{"start_line":132,"start_character":69,"end_line":133,"end_character":8},"in_reply_to":"5a74a57a_b586a063","updated":"2016-11-22 22:02:23.000000000","message":"Done","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"a5401363c8cad11d0df7d023db98b524dba2d757","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"To summarize, as shown in the above diagram, we split the database migrations"},{"line_number":186,"context_line":"into schema and data migrations. The schema migrations can only either be"},{"line_number":187,"context_line":"strictly additive or contractive in nature, or a combination of both. Additive"},{"line_number":188,"context_line":"schema migrations are run before the upgrade begins to prepare the database"},{"line_number":189,"context_line":"for new services while it is still usable by old services."},{"line_number":190,"context_line":"(This phase is also called \"database expand\".) During database expand, we also"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_359370a5","line":187,"range":{"start_line":186,"start_character":59,"end_line":187,"end_character":8},"updated":"2016-11-22 21:32:38.000000000","message":"s/only either be strictly/be/","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"eb1471aef10a740751b2b83d00350b817ae19195","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"To summarize, as shown in the above diagram, we split the database migrations"},{"line_number":186,"context_line":"into schema and data migrations. The schema migrations can only either be"},{"line_number":187,"context_line":"strictly additive or contractive in nature, or a combination of both. Additive"},{"line_number":188,"context_line":"schema migrations are run before the upgrade begins to prepare the database"},{"line_number":189,"context_line":"for new services while it is still usable by old services."},{"line_number":190,"context_line":"(This phase is also called \"database expand\".) During database expand, we also"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_f53f38d4","line":187,"range":{"start_line":186,"start_character":59,"end_line":187,"end_character":8},"in_reply_to":"5a74a57a_359370a5","updated":"2016-11-22 22:02:23.000000000","message":"Done","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"a5401363c8cad11d0df7d023db98b524dba2d757","unresolved":false,"context_lines":[{"line_number":707,"context_line":"* Introduce expand/contract migration streams and the corresponding"},{"line_number":708,"context_line":"  glance-manage CLI."},{"line_number":709,"context_line":""},{"line_number":710,"context_line":"* Work with the developers of Newton features that require database changes"},{"line_number":711,"context_line":"  to implement code to follow the rolling upgrade strategy.  These include:"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"  * community images and enhanced image sharing"}],"source_content_type":"text/x-rst","patch_set":16,"id":"5a74a57a_b5edc027","line":710,"range":{"start_line":710,"start_character":30,"end_line":710,"end_character":36},"updated":"2016-11-22 21:32:38.000000000","message":"s/Newton/Ocata/","commit_id":"41fe1df813f39c97b74a2ae9446015ffab7a1935"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b26a77ee60018a0eb007517398e1df90b4f7b9d5","unresolved":false,"context_lines":[{"line_number":48,"context_line":"releases, but we believe that given the structure of Glance and typical usage"},{"line_number":49,"context_line":"patterns, database changes can be made and finalized within a single release."},{"line_number":50,"context_line":"Such an approach is preferable for an open source project in which the cast of"},{"line_number":51,"context_line":"characters may change considerably from cycle to cycle."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"We first present an overview of the upgrade strategy and then provide a"},{"line_number":54,"context_line":"detailed example of how this will work for a change that will be occurring in"}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_43981b6b","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":10},"updated":"2016-12-07 23:50:04.000000000","message":"nit: contributors?","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":48,"context_line":"releases, but we believe that given the structure of Glance and typical usage"},{"line_number":49,"context_line":"patterns, database changes can be made and finalized within a single release."},{"line_number":50,"context_line":"Such an approach is preferable for an open source project in which the cast of"},{"line_number":51,"context_line":"characters may change considerably from cycle to cycle."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"We first present an overview of the upgrade strategy and then provide a"},{"line_number":54,"context_line":"detailed example of how this will work for a change that will be occurring in"}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_fb08ca2f","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":10},"in_reply_to":"3a71b18c_43981b6b","updated":"2016-12-08 14:55:18.000000000","message":"I\u0027m going to leave it, \"characters\" pretty much describes the people working on Glance accurately!","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b26a77ee60018a0eb007517398e1df90b4f7b9d5","unresolved":false,"context_lines":[{"line_number":204,"context_line":"(This phase is also called \"database contract\".) The triggers are also dropped"},{"line_number":205,"context_line":"during database contract."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"Steps"},{"line_number":209,"context_line":"-----"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_665c45ee","line":207,"updated":"2016-12-07 23:50:04.000000000","message":"You might mention that this strategy requires the full expand / migrate / contract cycle (referred to as \u0027EMC\u0027 hereafter) for upgrade from N-2 to N-1 needs to complete before the expand phase for the upgrade from N-1 to N can begin.\n\nThere is no mention of how multiple migrations (such as ocata-expand01 and ocata-expand02 ...) are to be handled, but it matters.\n\nIf all expansions are done before data-migrations begin then potential interactions between triggers and data-migrations need to be considered by the each migration merged after the first within a release cycle. \n\nOn the other hand, while developers will not have to consider potential interactions there is an increased operator impact to managing upgrades if each EMC cycle must complete for each migration within an upgrade.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b6fd08753fc9124065011bb4c313f6eaee669ebf","unresolved":false,"context_lines":[{"line_number":204,"context_line":"(This phase is also called \"database contract\".) The triggers are also dropped"},{"line_number":205,"context_line":"during database contract."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"Steps"},{"line_number":209,"context_line":"-----"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_77775802","line":207,"in_reply_to":"3a71b18c_34ddde70","updated":"2016-12-08 22:35:53.000000000","message":"#1: That is given in my mind, but the question becomes:\n\nCan a new/evacuated node be brought up with N release adjacent to an N-2 deploy and have database EMC cycles be run or does the new/evacuated node need to be brought up with N-1 release first and EMC run before bringing it up with the N release to run another EMC?\n\nThis requirement to actually deploy and EMC with the N-1 release first very roughly doubles the time of the rolling maintenance windows which even with a zero-downtime (or zero-impact) upgrade model imposes additional burden on operators and makes upgrades harder to schedule and execute.\n\nThis would be made *significantly* worse if all glance API and Registry nodes need to be drained of connections and release upgraded before the second round of EMC can begin.\n\n#2 \u0026 #3: Yes, just mention that explicitly. It is not made clear here that the proposal is one EMC cycle per release rather than per migration and the trade-offs I noted WRT potential developer impact should be noted below.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"c0990ec15b5867ae429ba98eacee65b0e8522acf","unresolved":false,"context_lines":[{"line_number":204,"context_line":"(This phase is also called \"database contract\".) The triggers are also dropped"},{"line_number":205,"context_line":"during database contract."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"Steps"},{"line_number":209,"context_line":"-----"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_34ddde70","line":207,"in_reply_to":"3a71b18c_665c45ee","updated":"2016-12-08 21:37:24.000000000","message":"#1. Maybe we should mention this clearly but a typical upgrade is complete only when the entire EMC cycle is performed. If not, it is like starting another upgrade while one upgrade is already in process. That is, started N1-\u003eN upgrade while N2-\u003eN1 is already in progress, which shouldn\u0027t attempted with or without rolling upgrades.\n\n#2. Again, maybe we should mention this explicitly but an EMC cycle is not per migration in release. It is per release/upgrade. Whether we have zero, one or more migrations, each of the EMC phases will take into account all the migrations included in the release. Doing EMC per migration will break the rolling upgrade process. So, all expansions are done before data-migrations, all data-migrations are done before contractions.\n\n#3. Interactions between data-migrations and triggers is a possibility. Like Alex mentioned, if the migrations are independent, well, there is no issue. But, if we have migrations that are dependent, it probably depends from case to case. Can we maybe address both migrations in the same expand/migrate/contract scripts? We can always fix the migrations that are introduced in the same release. I\u0027m not ruling out the possibility that there could be other weird dependencies but I can\u0027t think of a concrete example at this point.\n\nSteve, not sure if I addressed your concerns here. Please let me know if I misunderstood you.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":204,"context_line":"(This phase is also called \"database contract\".) The triggers are also dropped"},{"line_number":205,"context_line":"during database contract."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"Steps"},{"line_number":209,"context_line":"-----"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_f6853fad","line":207,"in_reply_to":"3a71b18c_665c45ee","updated":"2016-12-08 14:55:18.000000000","message":"It would be good to hear Alex and Hemanth\u0027s thoughts about this.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"0355d1d4ecb6c08145690b4d7f3966a232abd88e","unresolved":false,"context_lines":[{"line_number":204,"context_line":"(This phase is also called \"database contract\".) The triggers are also dropped"},{"line_number":205,"context_line":"during database contract."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"Steps"},{"line_number":209,"context_line":"-----"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_d02a0490","line":207,"in_reply_to":"3a71b18c_f6853fad","updated":"2016-12-08 16:33:29.000000000","message":"I believe I\u0027m seeing two separate concerns that Steve raises here:\n\nThe first is inter-cycle upgrades and is regarding leap-frogging. I\u0027m inclined to think this should be either all or nothing approach. I don\u0027t think we should be silently or tacitly supporting leap-frogging, because it places constraints on the upgrades/migrations implementation and will require us to make compromises that would be hard to justify. Therefore we should either come out and say that we are supporting leap-frogging, in which case rolling upgrades become much more complicated (and not likely in Ocata), or we don\u0027t support it and make no claims about it. Specifically calling out the N-2-\u003eN-\u003e1-\u003e N sequence will make it clear that leap frogging is NOT supported.\n\nThe second issue is intra-cycle migrations. This is wholly dependent on the detailed nature of any particular cycle\u0027s migration(s). If there are multiple migrations which are independent of each other and are self contained, there should be no issues with running all expand operations, followed by all data migrations and then contractions. Current implementation is oriented towards this approach. If the migrations are inter-dependent, my suggestion would be to implement them as a single EMC. The latter has developer impact, but in both cases, operators see the equivalent of a single EMC cycle.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b26a77ee60018a0eb007517398e1df90b4f7b9d5","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    be a concern."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":234,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"},{"line_number":235,"context_line":"    early phase of the rolling upgrade, some constraints may need to be handled"},{"line_number":236,"context_line":"    in code instead of relying on the DBMS.  Further, a \"bad\" constraint change"},{"line_number":237,"context_line":"    may only reveal itself at scale, so it\u0027s not clear how much we\u0027d be able to"},{"line_number":238,"context_line":"    rely on Grenade tests to detect such a change."},{"line_number":239,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_46e669e9","line":236,"range":{"start_line":234,"start_character":59,"end_line":236,"end_character":43},"updated":"2016-12-07 23:50:04.000000000","message":"This strategy imposes a hard-stop on performing some database changes in a single cycle, and additionally puts a hard-stop on multiple cycle upgrades (such as N-2 to N) without several cycles of stabilization between the introduction of the constraint and the later reliance during rolling upgrades.\n\nEven if it is not explicitly supported in OpenStack generally or Glance specifically, introducing this limitation seems like it should be discouraged. A preference for applying constraints during contract cycles should address this concern.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"c0990ec15b5867ae429ba98eacee65b0e8522acf","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    be a concern."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":234,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"},{"line_number":235,"context_line":"    early phase of the rolling upgrade, some constraints may need to be handled"},{"line_number":236,"context_line":"    in code instead of relying on the DBMS.  Further, a \"bad\" constraint change"},{"line_number":237,"context_line":"    may only reveal itself at scale, so it\u0027s not clear how much we\u0027d be able to"},{"line_number":238,"context_line":"    rely on Grenade tests to detect such a change."},{"line_number":239,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_54c97a78","line":236,"range":{"start_line":234,"start_character":59,"end_line":236,"end_character":43},"in_reply_to":"3a71b18c_46e669e9","updated":"2016-12-08 21:37:24.000000000","message":"#1. +1 to adding constraints in the contract phase. We may have missed adding that detail here but that\u0027s the plan for sure. We did demonstrate addung the constraints in contract phase during the PoC. But, good catch, Steve!\n\n#2. I don\u0027t know if we should worry about leapfrogging just yet. It isn\u0027t something that\u0027s been kept in mind while drafting this strategy.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    be a concern."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":234,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"},{"line_number":235,"context_line":"    early phase of the rolling upgrade, some constraints may need to be handled"},{"line_number":236,"context_line":"    in code instead of relying on the DBMS.  Further, a \"bad\" constraint change"},{"line_number":237,"context_line":"    may only reveal itself at scale, so it\u0027s not clear how much we\u0027d be able to"},{"line_number":238,"context_line":"    rely on Grenade tests to detect such a change."},{"line_number":239,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_76992f1f","line":236,"range":{"start_line":234,"start_character":59,"end_line":236,"end_character":43},"in_reply_to":"3a71b18c_46e669e9","updated":"2016-12-08 14:55:18.000000000","message":"That\u0027s a good point.  I think this may be left over from an earlier draft (before we had triggers).","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b6fd08753fc9124065011bb4c313f6eaee669ebf","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    be a concern."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":234,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"},{"line_number":235,"context_line":"    early phase of the rolling upgrade, some constraints may need to be handled"},{"line_number":236,"context_line":"    in code instead of relying on the DBMS.  Further, a \"bad\" constraint change"},{"line_number":237,"context_line":"    may only reveal itself at scale, so it\u0027s not clear how much we\u0027d be able to"},{"line_number":238,"context_line":"    rely on Grenade tests to detect such a change."},{"line_number":239,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_f7c9a8ad","line":236,"range":{"start_line":234,"start_character":59,"end_line":236,"end_character":43},"in_reply_to":"3a71b18c_54c97a78","updated":"2016-12-08 22:35:53.000000000","message":"#1 I know that the contract phrase mentions it, but removing the reference here or editing it to express that they should happen later, not in expand or in code would work.\n\n#2 I know it wasn\u0027t explicitly stated as a desired outcome or anything but I did want to bring it up because as written now it does inhibit it. \n\nIf we can agree and document a stance regarding how operators should try to handle multiple upgrade cycles in series, as presumably described under deployer impacts and consistent with the rest of the spec, I\u0027ll be happy.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"0355d1d4ecb6c08145690b4d7f3966a232abd88e","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    be a concern."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    We want to flag this point for developers: it is imperative to restrict"},{"line_number":234,"context_line":"    adding constraints that can cause service disruption.  Thus, during the"},{"line_number":235,"context_line":"    early phase of the rolling upgrade, some constraints may need to be handled"},{"line_number":236,"context_line":"    in code instead of relying on the DBMS.  Further, a \"bad\" constraint change"},{"line_number":237,"context_line":"    may only reveal itself at scale, so it\u0027s not clear how much we\u0027d be able to"},{"line_number":238,"context_line":"    rely on Grenade tests to detect such a change."},{"line_number":239,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_4b856905","line":236,"range":{"start_line":234,"start_character":59,"end_line":236,"end_character":43},"in_reply_to":"3a71b18c_76992f1f","updated":"2016-12-08 16:33:29.000000000","message":"See my comments above about N-2 to N.\n\nI agree that we should apply the constraints during the contract phase. Perhaps we should also mention that an expand phase may remove some constraints previously imposed on a table, which would then be added back in the contract phase.\n\nOverall, I think this whole cautionary paragraph can be replaced with above.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b26a77ee60018a0eb007517398e1df90b4f7b9d5","unresolved":false,"context_lines":[{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"After expanding the database, we also add triggers that keep the old and new"},{"line_number":277,"context_line":"columns in sync."},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"Deliverable: We propose to make this available by extending the glance-manage"}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_e1459fb3","line":276,"range":{"start_line":276,"start_character":0,"end_line":276,"end_character":5},"updated":"2016-12-07 23:50:04.000000000","message":"nit: While","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"After expanding the database, we also add triggers that keep the old and new"},{"line_number":277,"context_line":"columns in sync."},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"Deliverable: We propose to make this available by extending the glance-manage"}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_76c04fe1","line":276,"range":{"start_line":276,"start_character":0,"end_line":276,"end_character":5},"in_reply_to":"3a71b18c_e1459fb3","updated":"2016-12-08 14:55:18.000000000","message":"Good catch, will change.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b26a77ee60018a0eb007517398e1df90b4f7b9d5","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"Deliverable: We propose to extend the glance-manage utility to migrate the"},{"line_number":331,"context_line":"data in batches. The batch size could be controlled with a parameter."},{"line_number":332,"context_line":"For example: ``glance-manage db migrate --rows\u003d10``."},{"line_number":333,"context_line":""},{"line_number":334,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_01c61b16","line":331,"range":{"start_line":331,"start_character":57,"end_line":331,"end_character":59},"updated":"2016-12-07 23:50:04.000000000","message":"nit: an optional\n\nWhen no limit on the rows is provided is a default used or are all migrations to be performed?","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":328,"context_line":""},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"Deliverable: We propose to extend the glance-manage utility to migrate the"},{"line_number":331,"context_line":"data in batches. The batch size could be controlled with a parameter."},{"line_number":332,"context_line":"For example: ``glance-manage db migrate --rows\u003d10``."},{"line_number":333,"context_line":""},{"line_number":334,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_367ed7ae","line":331,"range":{"start_line":331,"start_character":57,"end_line":331,"end_character":59},"in_reply_to":"3a71b18c_01c61b16","updated":"2016-12-08 14:55:18.000000000","message":"Ok, will add \"optional with a sensible default\" to this.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b26a77ee60018a0eb007517398e1df90b4f7b9d5","unresolved":false,"context_lines":[{"line_number":466,"context_line":"1. Backup Glance database."},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"2. Choose an arbitrary Glance node or provision a new node to install the new"},{"line_number":469,"context_line":"   release. If an existing Glance node is chosen, stop the Glance services."},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"3. Upgrade the above chosen node with new release and update the configuration"},{"line_number":472,"context_line":"   accordingly. However, Glance services MUST NOT be started just yet."}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_b7f045cb","line":469,"range":{"start_line":469,"start_character":50,"end_line":469,"end_character":54},"updated":"2016-12-07 23:50:04.000000000","message":"nit: gracefully stop","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":466,"context_line":"1. Backup Glance database."},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"2. Choose an arbitrary Glance node or provision a new node to install the new"},{"line_number":469,"context_line":"   release. If an existing Glance node is chosen, stop the Glance services."},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"3. Upgrade the above chosen node with new release and update the configuration"},{"line_number":472,"context_line":"   accordingly. However, Glance services MUST NOT be started just yet."}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_f608df2f","line":469,"range":{"start_line":469,"start_character":50,"end_line":469,"end_character":54},"in_reply_to":"3a71b18c_b7f045cb","updated":"2016-12-08 14:55:18.000000000","message":"Most definitely! will change.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":507,"context_line":"-------"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"To understand how this would work in action, consider the following example of"},{"line_number":510,"context_line":"a Glance database change proposed for Ocata."},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"The \"old column\": Newton (release N-1): boolean ``is_public`` column in images"},{"line_number":513,"context_line":"table.  This column has nullable\u003dFalse and default\u003dFalse."}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_fc28c187","line":510,"updated":"2016-12-08 14:55:18.000000000","message":"Need to add, \"this does not proscribe the actual database change.  It is put here as a realistic example for a sanity check of this proposal.\"","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b26a77ee60018a0eb007517398e1df90b4f7b9d5","unresolved":false,"context_lines":[{"line_number":675,"context_line":"------------------"},{"line_number":676,"context_line":""},{"line_number":677,"context_line":"The background data migration will consume extra database resources, but this"},{"line_number":678,"context_line":"can be mitigated if the migration script is carefully written."},{"line_number":679,"context_line":""},{"line_number":680,"context_line":"Other deployer impact"},{"line_number":681,"context_line":"---------------------"}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_b871157a","line":678,"range":{"start_line":678,"start_character":7,"end_line":678,"end_character":16},"updated":"2016-12-07 23:50:04.000000000","message":"nit: managed? minimized? mitigation suggests the impact may be eliminated. In some cases maybe that isn\u0027t possible.","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"383b405c6d244dc50c784536fbae52fd81b267f0","unresolved":false,"context_lines":[{"line_number":675,"context_line":"------------------"},{"line_number":676,"context_line":""},{"line_number":677,"context_line":"The background data migration will consume extra database resources, but this"},{"line_number":678,"context_line":"can be mitigated if the migration script is carefully written."},{"line_number":679,"context_line":""},{"line_number":680,"context_line":"Other deployer impact"},{"line_number":681,"context_line":"---------------------"}],"source_content_type":"text/x-rst","patch_set":17,"id":"3a71b18c_bc5d6917","line":678,"range":{"start_line":678,"start_character":7,"end_line":678,"end_character":16},"in_reply_to":"3a71b18c_b871157a","updated":"2016-12-08 14:55:18.000000000","message":"Good point, I\u0027ll probably go with \"managed\".","commit_id":"0a4b93b145e8b024b01bc73435d47d6ead6f7183"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"bd12de658deed8273cfd57494c10c29bda925f48","unresolved":false,"context_lines":[{"line_number":219,"context_line":"  database modification.  What we are proposing in this spec is that for each"},{"line_number":220,"context_line":"  release, there will be a *single* expand-migrate-contract operation from the"},{"line_number":221,"context_line":"  operator\u0027s point of view.  In other words, all feature teams will have to"},{"line_number":222,"context_line":"  coordinate so that all expands are performed, followed by all migrations, are"},{"line_number":223,"context_line":"  concluding with all contractions.  This will be easy for features whose"},{"line_number":224,"context_line":"  changes are completely independent, but may be more difficult for others."},{"line_number":225,"context_line":"  However, preserving zero-downtime database changes will be a Glance project"}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_0801a56a","line":222,"range":{"start_line":222,"start_character":60,"end_line":222,"end_character":79},"updated":"2016-12-08 23:50:51.000000000","message":"s/all migrations, are/all data migrations, and/","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"46013c0a921ed0877754a9c2a871e8a0903efe62","unresolved":false,"context_lines":[{"line_number":219,"context_line":"  database modification.  What we are proposing in this spec is that for each"},{"line_number":220,"context_line":"  release, there will be a *single* expand-migrate-contract operation from the"},{"line_number":221,"context_line":"  operator\u0027s point of view.  In other words, all feature teams will have to"},{"line_number":222,"context_line":"  coordinate so that all expands are performed, followed by all migrations, are"},{"line_number":223,"context_line":"  concluding with all contractions.  This will be easy for features whose"},{"line_number":224,"context_line":"  changes are completely independent, but may be more difficult for others."},{"line_number":225,"context_line":"  However, preserving zero-downtime database changes will be a Glance project"}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_35eb157a","line":222,"range":{"start_line":222,"start_character":60,"end_line":222,"end_character":79},"in_reply_to":"3a71b18c_0801a56a","updated":"2016-12-09 01:39:22.000000000","message":"Thanks for catching that.","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ef3c2469b4fc15aac4fc06a5b721633924a2d787","unresolved":false,"context_lines":[{"line_number":235,"context_line":"          only a suggestion, we can argue about the best wording on the patch"},{"line_number":236,"context_line":"          that modifies the spec template.)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"          * Glance is committed to zero-downtime database migrations."},{"line_number":239,"context_line":"            Explain what database migrations will accompany this change."},{"line_number":240,"context_line":"            Do they have the potential to interfere with the database"},{"line_number":241,"context_line":"            migrations for other specs that have been approved for this"},{"line_number":242,"context_line":"            cycle?"},{"line_number":243,"context_line":"  "},{"line_number":244,"context_line":"Keep in mind that our goal here is to achieve the upgrade tags.  While it\u0027s"},{"line_number":245,"context_line":"not *prohibited* to exceed them, they do specify a baseline for achievement"}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_b215624a","line":242,"range":{"start_line":238,"start_character":10,"end_line":242,"end_character":18},"updated":"2016-12-09 14:01:03.000000000","message":"This is a good change.","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"bd12de658deed8273cfd57494c10c29bda925f48","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            Do they have the potential to interfere with the database"},{"line_number":241,"context_line":"            migrations for other specs that have been approved for this"},{"line_number":242,"context_line":"            cycle?"},{"line_number":243,"context_line":"  "},{"line_number":244,"context_line":"Keep in mind that our goal here is to achieve the upgrade tags.  While it\u0027s"},{"line_number":245,"context_line":"not *prohibited* to exceed them, they do specify a baseline for achievement"},{"line_number":246,"context_line":"that\u0027s been adopted by the OpenStack community.  Hence simply meeting the"}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_483abd35","line":243,"updated":"2016-12-08 23:50:51.000000000","message":"nit: whitespace","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"46013c0a921ed0877754a9c2a871e8a0903efe62","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            Do they have the potential to interfere with the database"},{"line_number":241,"context_line":"            migrations for other specs that have been approved for this"},{"line_number":242,"context_line":"            cycle?"},{"line_number":243,"context_line":"  "},{"line_number":244,"context_line":"Keep in mind that our goal here is to achieve the upgrade tags.  While it\u0027s"},{"line_number":245,"context_line":"not *prohibited* to exceed them, they do specify a baseline for achievement"},{"line_number":246,"context_line":"that\u0027s been adopted by the OpenStack community.  Hence simply meeting the"}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_b5f72558","line":243,"in_reply_to":"3a71b18c_483abd35","updated":"2016-12-09 01:39:22.000000000","message":"Pesky whitespace!","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ef3c2469b4fc15aac4fc06a5b721633924a2d787","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"Deliverable: We propose to extend the glance-manage utility to migrate the data"},{"line_number":365,"context_line":"in batches. The batch size could be controlled with an optional parameter"},{"line_number":366,"context_line":"having a sensible default value."},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"For example: ``glance-manage db migrate --rows\u003d10``."},{"line_number":369,"context_line":""}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_35ba1c0b","line":366,"range":{"start_line":366,"start_character":0,"end_line":366,"end_character":32},"updated":"2016-12-09 14:01:03.000000000","message":"If it has a default value, how does one migrate all rows at once? I was under the impression that if one doesn\u0027t specify the max_rows arg, we\u0027ll migrate all rows.\nWe can probably have a special value reserved for all rows, say -1. But, I think we should look at what other projects are doing so that we remain consistent (to whatever extent possible).","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"27ca4ea1a752d5043f0a7d9f347fb150338b90cc","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"Deliverable: We propose to extend the glance-manage utility to migrate the data"},{"line_number":365,"context_line":"in batches. The batch size could be controlled with an optional parameter"},{"line_number":366,"context_line":"having a sensible default value."},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"For example: ``glance-manage db migrate --rows\u003d10``."},{"line_number":369,"context_line":""}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_cf0eb031","line":366,"range":{"start_line":366,"start_character":0,"end_line":366,"end_character":32},"in_reply_to":"3a71b18c_35ba1c0b","updated":"2016-12-09 17:04:01.000000000","message":"+1 Good catch Hemnth","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"2e601e11b29c2aaf96f8019b2114446b9d5e8b7f","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"Deliverable: We propose to extend the glance-manage utility to migrate the data"},{"line_number":365,"context_line":"in batches. The batch size could be controlled with an optional parameter"},{"line_number":366,"context_line":"having a sensible default value."},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"For example: ``glance-manage db migrate --rows\u003d10``."},{"line_number":369,"context_line":""}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_68267269","line":366,"range":{"start_line":366,"start_character":0,"end_line":366,"end_character":32},"in_reply_to":"3a71b18c_35ba1c0b","updated":"2016-12-09 18:11:14.000000000","message":"I don\u0027t understand this comment at all.  I thought the point of the \"batch\" parameter was to prevent database locking, i.e., migrate N rows, pause to yield any locks, then migrate the next N rows, etc.  Surely we don\u0027t want to only migrate N rows and then quit, leaving it up to the operator to remember to migrate the next rows?  We have to migrate all rows, the point of this parameter is to allow an operator to adjust how intensely glance-manage is going to hammer the database.","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"4ee0f352e76f9cd899707cf0cb11c3253e95879f","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"Deliverable: We propose to extend the glance-manage utility to migrate the data"},{"line_number":365,"context_line":"in batches. The batch size could be controlled with an optional parameter"},{"line_number":366,"context_line":"having a sensible default value."},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"For example: ``glance-manage db migrate --rows\u003d10``."},{"line_number":369,"context_line":""}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_e806021f","line":366,"range":{"start_line":366,"start_character":0,"end_line":366,"end_character":32},"in_reply_to":"3a71b18c_68267269","updated":"2016-12-09 18:25:54.000000000","message":"I think the idea behind migrating N rows was to migrate N rows in one run and then sit tight. The onus is on the operator to schedule the job to run as aggressively as he wants and also choose a suitable N for the intended schedule. \n\nSo, if max_rows are mentioned, our data migrate cli would just migrate max_rows across all migrations (maybe we shoud mention this explicitly again?)in one run and expect the operator to run it again and again until there are no more rows left to migrate. However, if an operator chooses to migrate all rows at once, for whatever reason, he\u0027d just not specify the max_rows option at all and we\u0027ll migrate all the rows at once.","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"948b9244f6b8b0bd8a6e7a0ea7bdcfbd8c8c6b7a","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"Deliverable: We propose to extend the glance-manage utility to migrate the data"},{"line_number":365,"context_line":"in batches. The batch size could be controlled with an optional parameter"},{"line_number":366,"context_line":"having a sensible default value."},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"For example: ``glance-manage db migrate --rows\u003d10``."},{"line_number":369,"context_line":""}],"source_content_type":"text/x-rst","patch_set":18,"id":"3a71b18c_4308b7d9","line":366,"range":{"start_line":366,"start_character":0,"end_line":366,"end_character":32},"in_reply_to":"3a71b18c_e806021f","updated":"2016-12-09 18:43:58.000000000","message":"Ok, got it now.  So we want to support the case where it\u0027s a large DB, could take 48 hours to migrate, but the operator only wants to run migrations at off-peak times.  Will revise to reflect that.","commit_id":"dcce176dee95544c7fe7faf6c55ed23aa25af4c9"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"715e956809020e1a8bc96d050b584269602e5d92","unresolved":false,"context_lines":[{"line_number":370,"context_line":"response if it\u0027s run and it finds that there are no rows that need to be"},{"line_number":371,"context_line":"migrated."},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"For example: ``glance-manage db migrate --max_rows\u003d10``."},{"line_number":374,"context_line":""},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"Deploy"}],"source_content_type":"text/x-rst","patch_set":21,"id":"1a6eadb0_68c8a775","line":373,"range":{"start_line":373,"start_character":29,"end_line":373,"end_character":39},"updated":"2016-12-12 17:03:38.000000000","message":"nit: I currently implemented this command as: \"db data_migrate\" to make sure there is no confusion of what exactly is being migrated. I\u0027m not dead set on this name however, so feel free to move forward with this.","commit_id":"95b4252065fd6398382db36950ccc9b20a1812c1"}]}
