)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"68cbd39b984699a8cbe13ac0b09b9894fb4b6009","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"    # column \u0027deleted\u0027 in \u0027tags\u0027 table."},{"line_number":1802,"context_line":"    context.session.query(models.Tag).filter_by("},{"line_number":1803,"context_line":"        resource_id\u003dinstance_uuid).delete()"},{"line_number":1804,"context_line":"    context.session.query(models.ConsoleAuthToken).filter_by("},{"line_number":1805,"context_line":"        instance_uuid\u003dinstance_uuid).delete()"},{"line_number":1806,"context_line":""},{"line_number":1807,"context_line":"    return instance_ref"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_569d1dba","line":1804,"updated":"2016-06-16 23:30:23.000000000","message":"Is there a reason why the test for this can\u0027t exist in this change? I\u0027m guessing because the DB APIs to create the console auth token is in the next change...","commit_id":"eefbb935ae517b82ffdd80b2646ec3020604ea3b"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"e8bdd7a5f6fb853b93003b48ad0e9a7067836695","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"    # column \u0027deleted\u0027 in \u0027tags\u0027 table."},{"line_number":1802,"context_line":"    context.session.query(models.Tag).filter_by("},{"line_number":1803,"context_line":"        resource_id\u003dinstance_uuid).delete()"},{"line_number":1804,"context_line":"    context.session.query(models.ConsoleAuthToken).filter_by("},{"line_number":1805,"context_line":"        instance_uuid\u003dinstance_uuid).delete()"},{"line_number":1806,"context_line":""},{"line_number":1807,"context_line":"    return instance_ref"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_8778dc7f","line":1804,"in_reply_to":"7aa08908_569d1dba","updated":"2016-06-17 15:24:07.000000000","message":"Yes, that\u0027s exactly right. I started putting the test in here but then realised I would need to squash the changes. Thought it would be better to leave as is. You can see the tests in the next change.","commit_id":"eefbb935ae517b82ffdd80b2646ec3020604ea3b"}],"nova/db/sqlalchemy/migrate_repo/versions/333_add_console_auth_tokens_table.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"8ad92d87c79010cb65108b10230f350a6045b406","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        Column(\u0027created_at\u0027, DateTime),"},{"line_number":32,"context_line":"        Column(\u0027updated_at\u0027, DateTime),"},{"line_number":33,"context_line":"        Column(\u0027id\u0027, Integer, primary_key\u003dTrue, nullable\u003dFalse),"},{"line_number":34,"context_line":"        Column(\u0027token_hash\u0027, String(255), nullable\u003dFalse),"},{"line_number":35,"context_line":"        Column(\u0027console_type\u0027, String(255), nullable\u003dFalse),"},{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_4267b7b6","line":34,"updated":"2016-06-08 14:47:50.000000000","message":"Which kind of hash are you planning to use ?","commit_id":"e5fc6c5e68ab64a6660ea8d9f92322db2a64d752"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"45891d2e2bf872b1d2af1aa9fb07bdb0c43ed03a","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027internal_access_path\u0027, String(255)),"},{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027expires\u0027),"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_54897974","line":39,"updated":"2016-06-07 17:53:28.000000000","message":"It would probably be good to create a foreign key to the instances table for this. We would also want to make sure the archive command works with that though, i.e. when we delete the instance do we also delete the related console auth token(s)?","commit_id":"e5fc6c5e68ab64a6660ea8d9f92322db2a64d752"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"96e78b7b295234053929e09d9fbc29344e01d0bb","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027internal_access_path\u0027, String(255)),"},{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027expires\u0027),"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_8bf1c56d","line":39,"in_reply_to":"7aa08908_54897974","updated":"2016-06-09 10:53:38.000000000","message":"Actually, these records are likely to be much more transient than instances. Once they expire they are not used and they get garbage collected by the host looking up the host field. So I think its unnecessary in this case. But thanks for the comment - I did ask. Just going with Jay\u0027s suggestion.","commit_id":"e5fc6c5e68ab64a6660ea8d9f92322db2a64d752"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"8ad92d87c79010cb65108b10230f350a6045b406","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027internal_access_path\u0027, String(255)),"},{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027expires\u0027),"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_e27b4379","line":39,"in_reply_to":"7aa08908_54897974","updated":"2016-06-08 14:47:50.000000000","message":"We actually have a method to do that in compute/manager.py: _clean_instance_console_token.  (probably why you have added an index here) . Then I guess the index in \u0027expires\u0027 is to create a periodic task to remove all expired token.","commit_id":"e5fc6c5e68ab64a6660ea8d9f92322db2a64d752"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"45891d2e2bf872b1d2af1aa9fb07bdb0c43ed03a","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        mysql_charset\u003d\u0027utf8\u0027"},{"line_number":47,"context_line":"    )"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    # NOTE(PaulMurray): DB2 creates an index when a unique constraint is"},{"line_number":50,"context_line":"    # created so trying to add a second index on the name column will fail"},{"line_number":51,"context_line":"    # with error SQL0605W, so omit the index in the case of DB2."},{"line_number":52,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_d4ae09e5","line":49,"updated":"2016-06-07 17:53:28.000000000","message":"We no longer support DB2 so drop this.","commit_id":"e5fc6c5e68ab64a6660ea8d9f92322db2a64d752"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"96e78b7b295234053929e09d9fbc29344e01d0bb","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        mysql_charset\u003d\u0027utf8\u0027"},{"line_number":47,"context_line":"    )"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    # NOTE(PaulMurray): DB2 creates an index when a unique constraint is"},{"line_number":50,"context_line":"    # created so trying to add a second index on the name column will fail"},{"line_number":51,"context_line":"    # with error SQL0605W, so omit the index in the case of DB2."},{"line_number":52,"context_line":"    if migrate_engine.name !\u003d \u0027ibm_db_sa\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_d7d4d6be","line":49,"in_reply_to":"7aa08908_d4ae09e5","updated":"2016-06-09 10:53:38.000000000","message":"Done","commit_id":"e5fc6c5e68ab64a6660ea8d9f92322db2a64d752"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"442fdc3bcbf89795f2cda017e083e957c5a3388b","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027expires\u0027),"},{"line_number":43,"context_line":"        Index(\u0027console_auth_tokens_token_hash_idx\u0027, \u0027token_hash\u0027),"},{"line_number":44,"context_line":"        UniqueConstraint(\u0027token_hash\u0027,"},{"line_number":45,"context_line":"                         name\u003d\u0027uniq_console_auth_tokens0token_hash\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"7aa08908_248ef82d","line":42,"updated":"2016-06-08 14:57:12.000000000","message":"According to the following patch  you are going to scan on expires+host so this index should be based of the fields expires and host.","commit_id":"2167561bba153a06699580db5ce9d903046973ba"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"48813c5f1c1dfa99586b71931ba97bbff596eb5f","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"},{"line_number":43,"context_line":"        Index(\u0027console_auth_tokens_token_hash_idx\u0027, \u0027token_hash\u0027),"},{"line_number":44,"context_line":"        UniqueConstraint(\u0027token_hash\u0027,"},{"line_number":45,"context_line":"                         name\u003d\u0027uniq_console_auth_tokens0token_hash\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"7aa08908_042a9f2c","line":42,"updated":"2016-06-09 13:39:16.000000000","message":"Yes that correlate better the request in flowing patch. thanks.","commit_id":"a755f629f845b66f19aaaedc2eab3c4febb7f5e5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"898dbd0a0ea8ddfb8da7053abe1798f06d251f94","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        mysql_charset\u003d\u0027utf8\u0027"},{"line_number":48,"context_line":"    )"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    auth_tokens.create()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7aa08908_adba8008","line":50,"updated":"2016-06-09 17:32:54.000000000","message":"This needs to be idempotent, right? Create only if not existing..\n\nWe have probably been slipping with that a bit recently, but we should be diligent I think.","commit_id":"a755f629f845b66f19aaaedc2eab3c4febb7f5e5"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"c12ac1f07aafdef89dfabbb07b59205c19828b4b","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        mysql_charset\u003d\u0027utf8\u0027"},{"line_number":48,"context_line":"    )"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    auth_tokens.create()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7aa08908_0cc5765a","line":50,"in_reply_to":"7aa08908_adba8008","updated":"2016-06-10 08:41:44.000000000","message":"You\u0027re absolutely right - I didn\u0027t even know about that option. Thanks","commit_id":"a755f629f845b66f19aaaedc2eab3c4febb7f5e5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e3bf152ca817b37cf6c05271aef4654edc05ed3b","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027internal_access_path\u0027, String(255)),"},{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_c103f440","line":39,"updated":"2016-06-12 15:18:54.000000000","message":"I still wonder about the need for a foreign key here so the archive command fails properly if things aren\u0027t deleted in the proper order.","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"761bf0d8ffaefaab48dbd95387591670b9634625","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027internal_access_path\u0027, String(255)),"},{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_92aec32d","line":39,"in_reply_to":"7aa08908_36b26a07","updated":"2016-06-15 15:55:39.000000000","message":"I played around with tags today. I created a server, added tag to it, and then deleted (soft delete) the server. The tag is deleted too, because:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L1802\n\nSo I think we need to do that with these also otherwise they are going to be orphaned when the instance is deleted.","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"47d214bbc1ba40f8865adb809c5e3d1b23b5e667","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027internal_access_path\u0027, String(255)),"},{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_6d14d59e","line":39,"in_reply_to":"7aa08908_92aec32d","updated":"2016-06-16 17:45:51.000000000","message":"I copied what they did for Tags and it seems to work ok. I added tests in the following patch.","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c7f40b23c80731fe525fa28a3666738dc9b0695e","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        Column(\u0027host\u0027, String(255), nullable\u003dFalse),"},{"line_number":37,"context_line":"        Column(\u0027port\u0027, Integer, nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027internal_access_path\u0027, String(255)),"},{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_36b26a07","line":39,"in_reply_to":"7aa08908_c103f440","updated":"2016-06-15 14:06:41.000000000","message":"OK, so this isn\u0027t soft deleted, I see that now (actually saw it before but guess I forgot about it or didn\u0027t make the connection).\n\nThat makes this like the tags table, which has a backref to the instances.uuid column:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/models.py#L1447\n\nBut I\u0027m wondering if that actually creates a foreign key in the model - it must not else schema validation would fail wouldn\u0027t it? Or do we not validate the schema against the models anymore since we dropped jerdfelt\u0027s changes?\n\nThe other thing I wonder is what happens if you have a resource like this on an instance and then delete the instance and archive it, does that fail because of the backref or just get orphaned? I need to test that out with the tags table.","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"68cbd39b984699a8cbe13ac0b09b9894fb4b6009","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"},{"line_number":43,"context_line":"        Index(\u0027console_auth_tokens_token_hash_idx\u0027, \u0027token_hash\u0027),"},{"line_number":44,"context_line":"        UniqueConstraint(\u0027token_hash\u0027,"},{"line_number":45,"context_line":"                         name\u003d\u0027uniq_console_auth_tokens0token_hash\u0027),"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_b608c129","line":42,"range":{"start_line":42,"start_character":35,"end_line":42,"end_character":41},"updated":"2016-06-16 23:30:23.000000000","message":"Should be ..._host_expires_idx?","commit_id":"eefbb935ae517b82ffdd80b2646ec3020604ea3b"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"e8bdd7a5f6fb853b93003b48ad0e9a7067836695","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        Column(\u0027instance_uuid\u0027, String(36), nullable\u003dFalse),"},{"line_number":40,"context_line":"        Column(\u0027expires\u0027, Integer, nullable\u003dFalse),"},{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_active_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"},{"line_number":43,"context_line":"        Index(\u0027console_auth_tokens_token_hash_idx\u0027, \u0027token_hash\u0027),"},{"line_number":44,"context_line":"        UniqueConstraint(\u0027token_hash\u0027,"},{"line_number":45,"context_line":"                         name\u003d\u0027uniq_console_auth_tokens0token_hash\u0027),"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_9b0ae91e","line":42,"range":{"start_line":42,"start_character":35,"end_line":42,"end_character":41},"in_reply_to":"7aa08908_b608c129","updated":"2016-06-17 15:24:07.000000000","message":"Done","commit_id":"eefbb935ae517b82ffdd80b2646ec3020604ea3b"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"d78ab64bf961bc8e856119d0b2e8f6da69e11e58","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_host_expires_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"},{"line_number":43,"context_line":"        Index(\u0027console_auth_tokens_token_hash_idx\u0027, \u0027token_hash\u0027),"},{"line_number":44,"context_line":"        UniqueConstraint(\u0027token_hash\u0027,"},{"line_number":45,"context_line":"                         name\u003d\u0027uniq_console_auth_tokens0token_hash\u0027),"},{"line_number":46,"context_line":"        mysql_engine\u003d\u0027InnoDB\u0027,"},{"line_number":47,"context_line":"        mysql_charset\u003d\u0027utf8\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a9d85d2_5d5f4272","line":44,"updated":"2016-06-20 16:00:14.000000000","message":"It\u0027s not clear to me why uniqueness is being enforced in the db here. Hopefully there would not be collisions between token hashes but this seems like the wrong place to enforce it. But maybe I\u0027m missing something.","commit_id":"718fca9de44aa06ede8d91a9df667c82e7be81d0"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"b68beca52f8a3e1eff3774db954ebca8e951e5ad","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_host_expires_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"},{"line_number":43,"context_line":"        Index(\u0027console_auth_tokens_token_hash_idx\u0027, \u0027token_hash\u0027),"},{"line_number":44,"context_line":"        UniqueConstraint(\u0027token_hash\u0027,"},{"line_number":45,"context_line":"                         name\u003d\u0027uniq_console_auth_tokens0token_hash\u0027),"},{"line_number":46,"context_line":"        mysql_engine\u003d\u0027InnoDB\u0027,"},{"line_number":47,"context_line":"        mysql_charset\u003d\u0027utf8\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_c60426c8","line":44,"in_reply_to":"5a9d85d2_463bbdd1","updated":"2016-06-21 18:00:00.000000000","message":"I think I need to look at the later patches to see how this is used. I would expect that the (instance_uuid, token_hash) would need to be unique as hopefully lookups are not being done purely by the token hash.\n\nAnyways, this is not really a problem I am just not seeing the necessity.","commit_id":"718fca9de44aa06ede8d91a9df667c82e7be81d0"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"eb6d0533c7a2ebeba5da3d9339b4c8414a0201b5","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        Index(\u0027console_auth_tokens_instance_uuid_idx\u0027, \u0027instance_uuid\u0027),"},{"line_number":42,"context_line":"        Index(\u0027console_auth_tokens_host_expires_idx\u0027, \u0027host\u0027, \u0027expires\u0027),"},{"line_number":43,"context_line":"        Index(\u0027console_auth_tokens_token_hash_idx\u0027, \u0027token_hash\u0027),"},{"line_number":44,"context_line":"        UniqueConstraint(\u0027token_hash\u0027,"},{"line_number":45,"context_line":"                         name\u003d\u0027uniq_console_auth_tokens0token_hash\u0027),"},{"line_number":46,"context_line":"        mysql_engine\u003d\u0027InnoDB\u0027,"},{"line_number":47,"context_line":"        mysql_charset\u003d\u0027utf8\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a9d85d2_463bbdd1","line":44,"in_reply_to":"5a9d85d2_5d5f4272","updated":"2016-06-21 13:32:26.000000000","message":"The token hash has to be unique, so why would we not make the column unique?\n\nAdditionally, the only way to check for uniqueness in the code would be to do a lookup in the table before updating it with the new row in a single transaction. So using this constraint is also the right way to do that.","commit_id":"718fca9de44aa06ede8d91a9df667c82e7be81d0"}],"nova/db/sqlalchemy/models.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c7f40b23c80731fe525fa28a3666738dc9b0695e","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"    host \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":1550,"context_line":"    port \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":1551,"context_line":"    internal_access_path \u003d Column(String(255))"},{"line_number":1552,"context_line":"    instance_uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1553,"context_line":"    expires \u003d Column(Integer, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_5677363b","line":1552,"range":{"start_line":1552,"start_character":4,"end_line":1552,"end_character":54},"updated":"2016-06-15 14:06:41.000000000","message":"Shouldn\u0027t we still delete these when the instance is deleted, else they are going to be orphaned and clutter up the database.","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"47d214bbc1ba40f8865adb809c5e3d1b23b5e667","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"    host \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":1550,"context_line":"    port \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":1551,"context_line":"    internal_access_path \u003d Column(String(255))"},{"line_number":1552,"context_line":"    instance_uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1553,"context_line":"    expires \u003d Column(Integer, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_edf2859a","line":1552,"range":{"start_line":1552,"start_character":4,"end_line":1552,"end_character":54},"in_reply_to":"7aa08908_122f73a8","updated":"2016-06-16 17:45:51.000000000","message":"I copied what they did for Tags and it seems to work ok. I added tests in the following patch.","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"761bf0d8ffaefaab48dbd95387591670b9634625","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"    host \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":1550,"context_line":"    port \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":1551,"context_line":"    internal_access_path \u003d Column(String(255))"},{"line_number":1552,"context_line":"    instance_uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1553,"context_line":"    expires \u003d Column(Integer, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_122f73a8","line":1552,"range":{"start_line":1552,"start_character":4,"end_line":1552,"end_character":54},"in_reply_to":"7aa08908_3158b48a","updated":"2016-06-15 15:55:39.000000000","message":"I guess I was looking for the same thing that we do for tags:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L1802\n\nNot a periodic task or something in the compute manager, but a hard-delete when the instance is deleted from the DB. Does that break anything with how these resources are going to be used?","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"92122a80eb55d4fd0ea36c31ab61398dcaedb606","unresolved":false,"context_lines":[{"line_number":1549,"context_line":"    host \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":1550,"context_line":"    port \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":1551,"context_line":"    internal_access_path \u003d Column(String(255))"},{"line_number":1552,"context_line":"    instance_uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":1553,"context_line":"    expires \u003d Column(Integer, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_3158b48a","line":1552,"range":{"start_line":1552,"start_character":4,"end_line":1552,"end_character":54},"in_reply_to":"7aa08908_5677363b","updated":"2016-06-15 14:33:21.000000000","message":"Do you mean through the data model - i.e. a cascading delete? I don\u0027t see that done in other tables.\n\nSee https://review.openstack.org/#/c/325381/5/nova/compute/manager.py for cleanup. These will be deleted when an instance is deleted (see L5380) or periodically when they expire (L6712).\n\nI guess it is possible that for some reason those two don\u0027t happen...","commit_id":"1a4250176cdd41015d4d14ae547dc97cb77d7679"}]}
