)]}'
{"keystone/common/sql/expand_repo/versions/022_expand_add_default_project_id_index.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ff2f646be15d0fc62be51e9854c8d6b03ad774ca","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    meta \u003d sql.MetaData()"},{"line_number":18,"context_line":"    meta.bind \u003d migrate_engine"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    index_found \u003d False"},{"line_number":21,"context_line":"    indexes \u003d sql.inspect(migrate_engine).get_indexes(\u0027user\u0027)"},{"line_number":22,"context_line":"    for index in indexes:"},{"line_number":23,"context_line":"        if index[\u0027name\u0027] \u003d\u003d \u0027ix_default_project_id\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_c56e2f2e","line":20,"updated":"2018-04-20 20:32:13.000000000","message":"I\u0027ll have to double check with Morgan, but I\u0027m not sure we can make a change like this.\n\nOnce a migration is landed, it\u0027s really hard to make modifications to it. Mainly because once a deployment moves past version 22, they\u0027ll never rerun the script short of recreating the database (even though that might not matter in this particular case).","commit_id":"80076132ebf9ceee086929ac29c89d5273f5ec7c"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"5f1043720b682200f35c59826b25dacc011d2e58","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    meta \u003d sql.MetaData()"},{"line_number":18,"context_line":"    meta.bind \u003d migrate_engine"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    index_found \u003d False"},{"line_number":21,"context_line":"    indexes \u003d sql.inspect(migrate_engine).get_indexes(\u0027user\u0027)"},{"line_number":22,"context_line":"    for index in indexes:"},{"line_number":23,"context_line":"        if index[\u0027name\u0027] \u003d\u003d \u0027ix_default_project_id\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_0f30a7e7","line":20,"in_reply_to":"9f6a8fd7_b1149945","updated":"2018-04-23 15:20:22.000000000","message":"The reason the problem happens here is because in the rhos downstream build (OSP 10 and 11) , we backported the fix for\nhttps://bugzilla.redhat.com/show_bug.cgi?id\u003d1541142, which includes migration 22.  In the backport, the migration was placed in the placeholder spots (5 and 17 iirc).\n\nAfter that happened and the system was migrated from OSP 10-\u003e11-\u003e12 in migration testing, and the script was rerun.  Not being idempotent, the upgrade broke.\n\nWe have not seen this elsewhere yet because the backport was only done downstream in RHOS.  This admittedly was an oversight.  The backport should have been submitted upstream first.  If we choose to do that -- and we\u0027re deciding if it makes sense to do so -- then the fact that the migration is not idempotent will be an issue everywhere (not just in downstream RHOS tripleo)\n\nAs for changing the migration after the fact, this should not be an issue for instances where the script has already run, this should not be an issue because we\u0027re not changing what happens.  It really should be enforced that all migration scripts be idempotent in case they are backported later.","commit_id":"80076132ebf9ceee086929ac29c89d5273f5ec7c"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"87c29506928979232ad3f48e10db6bd093cbdb3a","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    meta \u003d sql.MetaData()"},{"line_number":18,"context_line":"    meta.bind \u003d migrate_engine"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    index_found \u003d False"},{"line_number":21,"context_line":"    indexes \u003d sql.inspect(migrate_engine).get_indexes(\u0027user\u0027)"},{"line_number":22,"context_line":"    for index in indexes:"},{"line_number":23,"context_line":"        if index[\u0027name\u0027] \u003d\u003d \u0027ix_default_project_id\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_b1149945","line":20,"in_reply_to":"9f6a8fd7_c56e2f2e","updated":"2018-04-21 00:15:40.000000000","message":"How did this get broken with Triple O. It sounds like somehow this index was already created in Triple O (undercloud). I\u0027m not sure how that occurred, as this is the first I\u0027ve heard of this issue. I am simply curious what is so different about Triple O deployments that has run into this issue (compared with... everyone else)\n\n\n\u003d\u003d If this is something that actually needs new functionality in the migration \u003d\u003d\n\nThe correct mechanism is to create a new migration (new top number) that does this work and it needs to be idempotent -- IF there is a case where clouds may not have the index when past migration 22.\n\nWe need to also add the same migration (duplicate) in one of the place-holder slots.\n\nWhen backporting happens (Queens), just the placeholder is backported. *IF* it is backported further back, then the placeholder for the previous release must also be created (Queens) and just the earliest placeholder is backported to Pike. \n\nIs this simply because in some cases this index already exists -- so deployements all have this index -- but some error on this upgrade.","commit_id":"80076132ebf9ceee086929ac29c89d5273f5ec7c"}]}
