)]}'
{"nova/objects/flavor.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"053545dfdd7dee7c951c62824e752919cbbeb857","unresolved":false,"context_lines":[{"line_number":615,"context_line":"    # keep it separate here"},{"line_number":616,"context_line":"    from nova.db.sqlalchemy import models"},{"line_number":617,"context_line":"    return [x[0] for x in context.session.query("},{"line_number":618,"context_line":"        models.InstanceTypes.id).limit(limit)]"},{"line_number":619,"context_line":""},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"def migrate_flavors(ctxt, count):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_e40a27d1","line":618,"updated":"2016-03-19 18:04:48.000000000","message":"Need to filter out soft deleted flavors here, or do a real deletion ourselves.","commit_id":"cd9560ed763967621372fc249fba93ec4177dd24"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4f6e640db68e7e6569ada752d5a27fc6c3998008","unresolved":false,"context_lines":[{"line_number":680,"context_line":"            LOG.warning(_LW(\u0027Flavor id %(id)i disappeared during migration\u0027),"},{"line_number":681,"context_line":"                        {\u0027id\u0027: flavor_id})"},{"line_number":682,"context_line":"        except (exception.FlavorExists, exception.FlavorIdExists) as e:"},{"line_number":683,"context_line":"            LOG.error(str(e))"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":19,"id":"da0c15f0_92fd043d","line":683,"updated":"2016-03-27 14:13:48.000000000","message":"Is this really an error, though? If a deployment has 2 cells, and each cell has the exact same flavors in its main cell DB, running nova-manage online_data_migrations in cell 1 would migrate all the flavors to the API database, but running the same command in cell 2 would produce a bunch of error messages, but these aren\u0027t really errors, right? Furthermore, this exception would be hit in the call to flavor._flavor_create(), and the call to db.flavor_destroy() to remove the flavor from cell 2\u0027s main DB would never be called, which actually *is* a problem :) So, I think right here you should be calling db.flavor_destroy() to be sure that the flavor is actually removed in the cell database even if it\u0027s already been migrated to the API database.","commit_id":"fb4b4aacdaf0e1623c0684cc9cb7ce8ccf18d789"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"722967ff6df64f3d0b3dc9f14de385adbaefd650","unresolved":false,"context_lines":[{"line_number":680,"context_line":"            LOG.warning(_LW(\u0027Flavor id %(id)i disappeared during migration\u0027),"},{"line_number":681,"context_line":"                        {\u0027id\u0027: flavor_id})"},{"line_number":682,"context_line":"        except (exception.FlavorExists, exception.FlavorIdExists) as e:"},{"line_number":683,"context_line":"            LOG.error(str(e))"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba0121b8_9803b50d","line":683,"in_reply_to":"da0c15f0_0e2c0daa","updated":"2016-03-28 15:22:05.000000000","message":"Talked this through with Dan on IRC. The conclusion I got to is that not deleting flavors on error here is the right move. Additionally resize in cellsv1 requires flavors to be in each cell db in order to work, so the side effect of not deleting flavors on error here will be to keep cellsv1 resize working.","commit_id":"fb4b4aacdaf0e1623c0684cc9cb7ce8ccf18d789"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"84582c136b60f4f9d0bdb4b832c0e96eecca3a7c","unresolved":false,"context_lines":[{"line_number":680,"context_line":"            LOG.warning(_LW(\u0027Flavor id %(id)i disappeared during migration\u0027),"},{"line_number":681,"context_line":"                        {\u0027id\u0027: flavor_id})"},{"line_number":682,"context_line":"        except (exception.FlavorExists, exception.FlavorIdExists) as e:"},{"line_number":683,"context_line":"            LOG.error(str(e))"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":19,"id":"da0c15f0_0e2c0daa","line":683,"in_reply_to":"da0c15f0_8b5f70e4","updated":"2016-03-28 15:03:34.000000000","message":"So the expectation is that the nova-manage online migration command needs to run in each cell? It will be problematic to remove flavors from child cells, but it should be fine to do in the parent cell. I think if we special case any cellsv2 related data migrations to exclude being run in child cells we should be fine. Not sure how amenable you are to that idea.","commit_id":"fb4b4aacdaf0e1623c0684cc9cb7ce8ccf18d789"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e529492c34a98e222e417f25146adbf113648d57","unresolved":false,"context_lines":[{"line_number":680,"context_line":"            LOG.warning(_LW(\u0027Flavor id %(id)i disappeared during migration\u0027),"},{"line_number":681,"context_line":"                        {\u0027id\u0027: flavor_id})"},{"line_number":682,"context_line":"        except (exception.FlavorExists, exception.FlavorIdExists) as e:"},{"line_number":683,"context_line":"            LOG.error(str(e))"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":19,"id":"da0c15f0_95b793d7","line":683,"in_reply_to":"da0c15f0_92fd043d","updated":"2016-03-28 13:48:19.000000000","message":"Yeah, good point. I feel like just deleting here is maybe too aggressive for the non-cell case. Cells people are used to hacking their database to keep things running, but that\u0027s less true of the regular deployers. Also, I\u0027m not sure that deleting the flavors is really the right thing for the current cells deployers to do, since they\u0027re going to run newton in cellsv1 mode still.\n\nI kinda want this to take a flag that indicates it should do the cleanup even on error, but since this is a generic interface for migrations, that\u0027s a little harder than just slapping a flag argument in here.\n\nWhat if we make this check some cells-related configs to decide whether or not to raise an error?","commit_id":"fb4b4aacdaf0e1623c0684cc9cb7ce8ccf18d789"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"57282dac6c5eafa95a042522dfb1851d5a6e995a","unresolved":false,"context_lines":[{"line_number":680,"context_line":"            LOG.warning(_LW(\u0027Flavor id %(id)i disappeared during migration\u0027),"},{"line_number":681,"context_line":"                        {\u0027id\u0027: flavor_id})"},{"line_number":682,"context_line":"        except (exception.FlavorExists, exception.FlavorIdExists) as e:"},{"line_number":683,"context_line":"            LOG.error(str(e))"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":19,"id":"da0c15f0_b0ec6590","line":683,"in_reply_to":"da0c15f0_95b793d7","updated":"2016-03-28 14:12:51.000000000","message":"I have a document on upgrades which I need to clean up and get more feedback on, but the current plan is that this migration would not ever hit multiple cells. The relevant line is https://review.openstack.org/#/c/267153/1/doc/source/cells.rst@227. The general idea is that for most purposes the current v1 parent cell becomes the equivalent of a non cells deployment, i.e. these migrations only ever happen out of there so it\u0027s not really a multiple cells scenario.","commit_id":"fb4b4aacdaf0e1623c0684cc9cb7ce8ccf18d789"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5e006f20ab1733a6c31df1c8d6740041ded7c6ea","unresolved":false,"context_lines":[{"line_number":680,"context_line":"            LOG.warning(_LW(\u0027Flavor id %(id)i disappeared during migration\u0027),"},{"line_number":681,"context_line":"                        {\u0027id\u0027: flavor_id})"},{"line_number":682,"context_line":"        except (exception.FlavorExists, exception.FlavorIdExists) as e:"},{"line_number":683,"context_line":"            LOG.error(str(e))"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":19,"id":"da0c15f0_8b5f70e4","line":683,"in_reply_to":"da0c15f0_b0ec6590","updated":"2016-03-28 14:21:29.000000000","message":"Yeah, but there is a problem. This gets called as part of the generic online_data_migations command in nova-manage, along with several other things. The cellsv1 people will continue to have to run that in newton and probably beyond to get the things they need (like the pci migration, the uuids, etc). So, we can\u0027t just have them not run it, and also deleting things in their database is also not super awesome.","commit_id":"fb4b4aacdaf0e1623c0684cc9cb7ce8ccf18d789"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f0976f819ffeb1f85b1fb086c33a19227e049b8","unresolved":false,"context_lines":[{"line_number":702,"context_line":"        # we need to reset this to avoid a failure on the next flavor creation."},{"line_number":703,"context_line":"        engine.execute("},{"line_number":704,"context_line":"            text(\u0027ALTER SEQUENCE flavors_id_seq RESTART WITH %i;\u0027 % ("},{"line_number":705,"context_line":"                value)))"},{"line_number":706,"context_line":""},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"@db_api.api_context_manager.reader"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba0121b8_4b9c295d","line":705,"updated":"2016-03-30 15:22:29.000000000","message":"woah, nice catch... I guess you had hard times figuring that out.","commit_id":"de28c108f4cc124e202b1fa1974e6778c38fec90"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f0976f819ffeb1f85b1fb086c33a19227e049b8","unresolved":false,"context_lines":[{"line_number":712,"context_line":""},{"line_number":713,"context_line":"def migrate_flavor_reset_autoincrement(ctxt, count):"},{"line_number":714,"context_line":"    max_id \u003d _get_max_flavor_id(ctxt)"},{"line_number":715,"context_line":"    _adjust_autoincrement(ctxt, max_id + 1)"},{"line_number":716,"context_line":"    return 0, 0"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba0121b8_4bea69ad","line":715,"updated":"2016-03-30 15:22:29.000000000","message":"nit: maybe calling this just for postgre should have been checked before and not in the _adjust_autoincrement() method given most of our operators use MySQL but that\u0027s fine.","commit_id":"de28c108f4cc124e202b1fa1974e6778c38fec90"}]}
