)]}'
{"cinder/db/api.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9311ba0aeaa42bd998e69d659fb2aa62e880398f","unresolved":false,"context_lines":[{"line_number":146,"context_line":"    :param is_up: Boolean value to filter based on the cluster\u0027s up status."},{"line_number":147,"context_line":"    :param get_services: If we want to load all services from this cluster."},{"line_number":148,"context_line":"    :param services_summary: If we want to load num_nodes and"},{"line_number":149,"context_line":"                             num_down_nodes fields."},{"line_number":150,"context_line":"    :param read_deleted: Filtering based on delete status. Default value is"},{"line_number":151,"context_line":"                         \"no\"."},{"line_number":152,"context_line":"    :param filters: Field based filters in the form of key/value."}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_a627acc8","line":149,"updated":"2016-06-24 11:39:42.000000000","message":"nit: num_hosts and num_down_hosts","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9311ba0aeaa42bd998e69d659fb2aa62e880398f","unresolved":false,"context_lines":[{"line_number":163,"context_line":"    :param is_up: Boolean value to filter based on the cluster\u0027s up status."},{"line_number":164,"context_line":"    :param get_services: If we want to load all services from this cluster."},{"line_number":165,"context_line":"    :param services_summary: If we want to load num_nodes and"},{"line_number":166,"context_line":"                             num_down_nodes fields."},{"line_number":167,"context_line":"    :param read_deleted: Filtering based on delete status. Default value is"},{"line_number":168,"context_line":"                         \"no\"."},{"line_number":169,"context_line":"    :param filters: Field based filters in the form of key/value."}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_c62ab88f","line":166,"updated":"2016-06-24 11:39:42.000000000","message":"nit: num_hosts and num_down_hosts","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e3927b40206e553016b2ea8b73a62b9277029582","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                             num_down_hosts fields."},{"line_number":157,"context_line":"    :param read_deleted: Filtering based on delete status. Default value is"},{"line_number":158,"context_line":"                         \"no\"."},{"line_number":159,"context_line":"    :param filters: Field based filters in the form of key/value."},{"line_number":160,"context_line":"    :param name_match_level: \u0027pool\u0027, \u0027backend\u0027, or \u0027host\u0027 for name filter (as"},{"line_number":161,"context_line":"                             defined in _filter_host method)"},{"line_number":162,"context_line":"    :raise ClusterNotFound: If cluster doesn\u0027t exist."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":"    return IMPL.cluster_get(context, id, is_up, get_services, services_summary,"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_ef2e3af9","line":161,"range":{"start_line":159,"start_character":0,"end_line":161,"end_character":60},"updated":"2016-07-22 15:59:34.000000000","message":"It\u0027s ordered differently in parameter list.","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4b30b731507a28c955d7e589ac1da3053d3b9565","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                             num_down_hosts fields."},{"line_number":157,"context_line":"    :param read_deleted: Filtering based on delete status. Default value is"},{"line_number":158,"context_line":"                         \"no\"."},{"line_number":159,"context_line":"    :param filters: Field based filters in the form of key/value."},{"line_number":160,"context_line":"    :param name_match_level: \u0027pool\u0027, \u0027backend\u0027, or \u0027host\u0027 for name filter (as"},{"line_number":161,"context_line":"                             defined in _filter_host method)"},{"line_number":162,"context_line":"    :raise ClusterNotFound: If cluster doesn\u0027t exist."},{"line_number":163,"context_line":"    \"\"\""},{"line_number":164,"context_line":"    return IMPL.cluster_get(context, id, is_up, get_services, services_summary,"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_85f83fc6","line":161,"range":{"start_line":159,"start_character":0,"end_line":161,"end_character":60},"in_reply_to":"dada55a8_ef2e3af9","updated":"2016-07-22 16:09:32.000000000","message":"Done","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e3927b40206e553016b2ea8b73a62b9277029582","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"def cluster_destroy(context, id):"},{"line_number":201,"context_line":"    \"\"\"Destroy the cluster or raise if it does not exist or has hosts.\"\"\""},{"line_number":202,"context_line":"    return IMPL.cluster_destroy(context, id)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_af1c42c2","line":201,"range":{"start_line":201,"start_character":0,"end_line":201,"end_character":73},"updated":"2016-07-22 15:59:34.000000000","message":"You can list exceptions in the docstring.","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4b30b731507a28c955d7e589ac1da3053d3b9565","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"def cluster_destroy(context, id):"},{"line_number":201,"context_line":"    \"\"\"Destroy the cluster or raise if it does not exist or has hosts.\"\"\""},{"line_number":202,"context_line":"    return IMPL.cluster_destroy(context, id)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_65f54bca","line":201,"range":{"start_line":201,"start_character":0,"end_line":201,"end_character":73},"in_reply_to":"dada55a8_af1c42c2","updated":"2016-07-22 16:09:32.000000000","message":"Done","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"}],"cinder/db/sqlalchemy/api.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bb61cbe0ff81a2b271cd1c3a31164a44f75a04c7","unresolved":false,"context_lines":[{"line_number":594,"context_line":"            # problems at the OVO level"},{"line_number":595,"context_line":"            cluster_ref.last_heartbeat \u003d None"},{"line_number":596,"context_line":"            return cluster_ref"},{"line_number":597,"context_line":"    # If we had a race condition (exists anothe cluster with the same name that"},{"line_number":598,"context_line":"    # is not deleted) raise Duplicate exception."},{"line_number":599,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":600,"context_line":"        raise exception.ClusterExists(name\u003dvalues.get(\u0027name\u0027))"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_d55e8e75","line":597,"range":{"start_line":597,"start_character":41,"end_line":597,"end_character":47},"updated":"2016-06-21 17:10:51.000000000","message":"nit: another\n\nnit: This whole sentence is not very clear.","commit_id":"14d0a34c078ff949e8bf40d4bb9410d81b72c02e"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"71efba773902024ec4ea27add5a12b4a2eb9f88e","unresolved":false,"context_lines":[{"line_number":1502,"context_line":"        # If we want do do a partial rename and we haven\u0027t set the cluster"},{"line_number":1503,"context_line":"        # already, the value we want to set is a SQL replace of existing field"},{"line_number":1504,"context_line":"        # value."},{"line_number":1505,"context_line":"        if partial_rename and isinstance(cluster, six.string_types):"},{"line_number":1506,"context_line":"            cluster \u003d func.replace(getattr(model, field), value, cluster)"},{"line_number":1507,"context_line":""},{"line_number":1508,"context_line":"    query \u003d query.filter_by(**filters)"},{"line_number":1509,"context_line":"    result \u003d query.update({\u0027cluster_name\u0027: cluster}, synchronize_session\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_053284f1","line":1506,"range":{"start_line":1505,"start_character":0,"end_line":1506,"end_character":73},"updated":"2016-06-22 08:45:14.000000000","message":"I don\u0027t think parital_rename is needed. \nAs cluster_name is primary key in cluster table, every time before we set the cluster_name of resources, we have made sure that the cluster exists in db which is a full name.\n\nThe only place that cluster_name is partial occurs in resource queries.\n\nIt increases the complexity.","commit_id":"14d0a34c078ff949e8bf40d4bb9410d81b72c02e"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ce4377632e3978e0f07117ff4fdc65ef2b7296f5","unresolved":false,"context_lines":[{"line_number":1502,"context_line":"        # If we want do do a partial rename and we haven\u0027t set the cluster"},{"line_number":1503,"context_line":"        # already, the value we want to set is a SQL replace of existing field"},{"line_number":1504,"context_line":"        # value."},{"line_number":1505,"context_line":"        if partial_rename and isinstance(cluster, six.string_types):"},{"line_number":1506,"context_line":"            cluster \u003d func.replace(getattr(model, field), value, cluster)"},{"line_number":1507,"context_line":""},{"line_number":1508,"context_line":"    query \u003d query.filter_by(**filters)"},{"line_number":1509,"context_line":"    result \u003d query.update({\u0027cluster_name\u0027: cluster}, synchronize_session\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_28730d82","line":1506,"range":{"start_line":1505,"start_character":0,"end_line":1506,"end_character":73},"in_reply_to":"3aaa91ec_053284f1","updated":"2016-06-22 10:57:55.000000000","message":"Originally I didn\u0027t add this functionality, as can be seen in patch 1, but then I realized that was both a problem and something that would be useful for users.\n\nIt was a problem because on the Job Distribution mechanism, when we detect that the node has been added to a cluster what we do is move all it\u0027s resources to that cluster automatically [1], and we don\u0027t have the pool information there, so we need to do a partial rename and leave the pool as it is.\n\nAs for the user related usefulness, on the cinder-manage command we may have renamed a cluster and we want to include all backend resources instead of going one by one (here we would just use the old cluster name and not add the backend part), or we may want to rename a cluster that went from a multibackend configuration with only 1 backend to single backend configuration (here we could use the `--full-rename` parameter and use just the cluster name).\n\nIf I haven\u0027t presented my reasons clearly, please ping me on IRC and I\u0027ll try to do a better job.\n\n[1]: https://review.openstack.org/#/c/327687/4/cinder/volume/manager.py@363\n\n[2]: https://review.openstack.org/#/c/327688/4/cinder/cmd/manage.py@556","commit_id":"14d0a34c078ff949e8bf40d4bb9410d81b72c02e"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"673a306d4fbb5024f4a64b20879c4778a268d6ef","unresolved":false,"context_lines":[{"line_number":1502,"context_line":"        # If we want do do a partial rename and we haven\u0027t set the cluster"},{"line_number":1503,"context_line":"        # already, the value we want to set is a SQL replace of existing field"},{"line_number":1504,"context_line":"        # value."},{"line_number":1505,"context_line":"        if partial_rename and isinstance(cluster, six.string_types):"},{"line_number":1506,"context_line":"            cluster \u003d func.replace(getattr(model, field), value, cluster)"},{"line_number":1507,"context_line":""},{"line_number":1508,"context_line":"    query \u003d query.filter_by(**filters)"},{"line_number":1509,"context_line":"    result \u003d query.update({\u0027cluster_name\u0027: cluster}, synchronize_session\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_1ad421bb","line":1506,"range":{"start_line":1505,"start_character":0,"end_line":1506,"end_character":73},"in_reply_to":"3aaa91ec_28730d82","updated":"2016-06-24 06:07:25.000000000","message":"oh, I understand both the function and the partial_renmame parameter is needed.","commit_id":"14d0a34c078ff949e8bf40d4bb9410d81b72c02e"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9311ba0aeaa42bd998e69d659fb2aa62e880398f","unresolved":false,"context_lines":[{"line_number":553,"context_line":"    :param is_up: Boolean value to filter based on the cluster\u0027s up status."},{"line_number":554,"context_line":"    :param get_services: If we want to load all services from this cluster."},{"line_number":555,"context_line":"    :param services_summary: If we want to load num_nodes and"},{"line_number":556,"context_line":"                             num_down_nodes fields."},{"line_number":557,"context_line":"    :param read_deleted: Filtering based on delete status. Default value is"},{"line_number":558,"context_line":"                         \"no\"."},{"line_number":559,"context_line":"    :param filters: Field based filters in the form of key/value."}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_a60e8c38","line":556,"updated":"2016-06-24 11:39:42.000000000","message":"nit: num_hosts and num_down_hosts","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9311ba0aeaa42bd998e69d659fb2aa62e880398f","unresolved":false,"context_lines":[{"line_number":576,"context_line":"    :param is_up: Boolean value to filter based on the cluster\u0027s up status."},{"line_number":577,"context_line":"    :param get_services: If we want to load all services from this cluster."},{"line_number":578,"context_line":"    :param services_summary: If we want to load num_nodes and"},{"line_number":579,"context_line":"                             num_down_nodes fields."},{"line_number":580,"context_line":"    :param read_deleted: Filtering based on delete status. Default value is"},{"line_number":581,"context_line":"                         \"no\"."},{"line_number":582,"context_line":"    :param filters: Field based filters in the form of key/value."}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_2101e605","line":579,"updated":"2016-06-24 11:39:42.000000000","message":"nit: num_hosts and num_down_hosts","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e26447e54d1465fe2f6fe2f372ea10b1e77f01e0","unresolved":false,"context_lines":[{"line_number":636,"context_line":"        # This will fail if the cluster doesn\u0027t exist raising the right"},{"line_number":637,"context_line":"        # exception"},{"line_number":638,"context_line":"        cluster_get(context, id\u003did)"},{"line_number":639,"context_line":"        # If it doesn\u0027t fail, then the problem is that there are nodes"},{"line_number":640,"context_line":"        raise exception.ClusterHasHosts(id\u003did)"},{"line_number":641,"context_line":""},{"line_number":642,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_01894a75","line":639,"range":{"start_line":639,"start_character":65,"end_line":639,"end_character":70},"updated":"2016-06-24 12:44:32.000000000","message":"nit: hosts","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e26447e54d1465fe2f6fe2f372ea10b1e77f01e0","unresolved":false,"context_lines":[{"line_number":1491,"context_line":"    providing host/cluster level information, and preserve pool information if"},{"line_number":1492,"context_line":"    we only provide backend level information."},{"line_number":1493,"context_line":""},{"line_number":1494,"context_line":"    For example when we include a node in a cluster we receive calls with"},{"line_number":1495,"context_line":"    filters like {\u0027host\u0027: \u0027localhost@lvmdriver-1\u0027} and cluster with something"},{"line_number":1496,"context_line":"    like \u0027mycluster@lvmdriver-1\u0027.  Since in the DB the resources will have the"},{"line_number":1497,"context_line":"    host field set to something like \u0027localhost@lvmdriver-1#lvmdriver-1\u0027 we"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_a14dd63f","line":1494,"range":{"start_line":1494,"start_character":34,"end_line":1494,"end_character":38},"updated":"2016-06-24 12:44:32.000000000","message":"nit: host","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"}],"cinder/db/sqlalchemy/migrate_repo/versions/075_add_cluster_and_fields.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d0db4bc2eb933eb51ebd90238d0409237a8207b5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        Column(\u0027binary\u0027, String(255), nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027disabled\u0027, Boolean(), default\u003dFalse),"},{"line_number":39,"context_line":"        Column(\u0027disabled_reason\u0027, String(255)),"},{"line_number":40,"context_line":"        Column(\u0027race_preventer\u0027, Integer, nullable\u003dFalse, default\u003d0),"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        # To remove potential races on creation we have a constraint set on"},{"line_number":43,"context_line":"        # name and race_preventer fields, and we set value on creation to 0, so"},{"line_number":44,"context_line":"        # 2 clusters with the same name will fail this constraint.  On deletion"},{"line_number":45,"context_line":"        # we change this field to the same value as the id which will be unique"},{"line_number":46,"context_line":"        # and will not conflict with the creation of another cluster with the"},{"line_number":47,"context_line":"        # same name."},{"line_number":48,"context_line":"        UniqueConstraint(\u0027name\u0027, \u0027binary\u0027, \u0027race_preventer\u0027),"},{"line_number":49,"context_line":"        mysql_engine\u003d\u0027InnoDB\u0027,"},{"line_number":50,"context_line":"        mysql_charset\u003d\u0027utf8\u0027,"},{"line_number":51,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_54a43f07","line":48,"range":{"start_line":40,"start_character":0,"end_line":48,"end_character":61},"updated":"2016-07-22 15:46:39.000000000","message":"Why not add `deleted` column as Integer and use oslo.db\u0027s soft_delete? We\u0027re already doing such thing in VolumeTypeProjects.","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4b30b731507a28c955d7e589ac1da3053d3b9565","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        Column(\u0027binary\u0027, String(255), nullable\u003dFalse),"},{"line_number":38,"context_line":"        Column(\u0027disabled\u0027, Boolean(), default\u003dFalse),"},{"line_number":39,"context_line":"        Column(\u0027disabled_reason\u0027, String(255)),"},{"line_number":40,"context_line":"        Column(\u0027race_preventer\u0027, Integer, nullable\u003dFalse, default\u003d0),"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        # To remove potential races on creation we have a constraint set on"},{"line_number":43,"context_line":"        # name and race_preventer fields, and we set value on creation to 0, so"},{"line_number":44,"context_line":"        # 2 clusters with the same name will fail this constraint.  On deletion"},{"line_number":45,"context_line":"        # we change this field to the same value as the id which will be unique"},{"line_number":46,"context_line":"        # and will not conflict with the creation of another cluster with the"},{"line_number":47,"context_line":"        # same name."},{"line_number":48,"context_line":"        UniqueConstraint(\u0027name\u0027, \u0027binary\u0027, \u0027race_preventer\u0027),"},{"line_number":49,"context_line":"        mysql_engine\u003d\u0027InnoDB\u0027,"},{"line_number":50,"context_line":"        mysql_charset\u003d\u0027utf8\u0027,"},{"line_number":51,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_aaeef0b1","line":48,"range":{"start_line":40,"start_character":0,"end_line":48,"end_character":61},"in_reply_to":"dada55a8_54a43f07","updated":"2016-07-22 16:09:32.000000000","message":"That\u0027s inefficient, because soft_delete requires us to retrieve the data from the DB first to have a SQLAlchemy ORM instance first.\n\nI like the idea of using the deleted field as an int, but I think that\u0027s something we should change in all tables, not just a couple of them, as I think it\u0027s a hack (I don\u0027t like to use DB field polymorphism unless it\u0027s strictly necessary) if all other tables handle it as a boolean.","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d0db4bc2eb933eb51ebd90238d0409237a8207b5","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    # Create constraint between service and cluster tables."},{"line_number":62,"context_line":"    service \u003d Table(\u0027services\u0027, meta, autoload\u003dTrue)"},{"line_number":63,"context_line":"    ForeignKeyConstraint([service.c.cluster_name], [cluster.c.name])"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_5911185d","line":63,"range":{"start_line":63,"start_character":0,"end_line":63,"end_character":68},"updated":"2016-07-22 15:46:39.000000000","message":"I think this will do nothing - you need `.create()` at the end. According to [1] this will be in-place for MySQL if we disable foreign key check for the time of the migration. It may be however dangerous if we\u0027re relying on that somewhere. What do you think?\n\n[1] https://dev.mysql.com/doc/refman/5.7/en/innodb-create-index-overview.html#innodb-online-ddl-summary-grid","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4b30b731507a28c955d7e589ac1da3053d3b9565","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    # Create constraint between service and cluster tables."},{"line_number":62,"context_line":"    service \u003d Table(\u0027services\u0027, meta, autoload\u003dTrue)"},{"line_number":63,"context_line":"    ForeignKeyConstraint([service.c.cluster_name], [cluster.c.name])"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_8a24ccc6","line":63,"range":{"start_line":63,"start_character":0,"end_line":63,"end_character":68},"in_reply_to":"dada55a8_5911185d","updated":"2016-07-22 16:09:32.000000000","message":"I\u0027ll add the .create(), as for the other mater, we don\u0027t rely on it in any way.","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"903f03599ef46e4634541920b82a279950a59255","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    # Create constraint between service and cluster tables."},{"line_number":62,"context_line":"    service \u003d Table(\u0027services\u0027, meta, autoload\u003dTrue)"},{"line_number":63,"context_line":"    ForeignKeyConstraint([service.c.cluster_name], [cluster.c.name])"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_68807f47","line":63,"range":{"start_line":63,"start_character":0,"end_line":63,"end_character":68},"in_reply_to":"dada55a8_8a24ccc6","updated":"2016-07-22 16:34:59.000000000","message":"Ok, I have to remove the constraint, because they only work if the \u0027name\u0027 is a primary key or unique, and since we don\u0027t do hard deletes it cannot work.   We don\u0027t use it anyway, so it won\u0027t be a problem.","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"}],"cinder/db/sqlalchemy/models.py":[{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"62629f19fc3fa371c4c60c5de56e62c2837a2b3e","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    binary \u003d Column(String(255))"},{"line_number":69,"context_line":"    # We want to overwrite default updated_at definition so we timestamp at"},{"line_number":70,"context_line":"    # creation as well, so we only need to check updated_at for the heartbeat"},{"line_number":71,"context_line":"    updated_at \u003d Column(DateTime, default\u003dtimeutils.utcnow,"},{"line_number":72,"context_line":"                        onupdate\u003dtimeutils.utcnow)"},{"line_number":73,"context_line":"    topic \u003d Column(String(255))"},{"line_number":74,"context_line":"    report_count \u003d Column(Integer, nullable\u003dFalse, default\u003d0)"},{"line_number":75,"context_line":"    disabled \u003d Column(Boolean, default\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_d6fdc66f","line":72,"range":{"start_line":71,"start_character":0,"end_line":72,"end_character":50},"updated":"2016-06-28 08:14:10.000000000","message":"Hi Gorka, I tried your patch https://review.openstack.org/#/c/327688/, and found that the updated_at is Null when a cluster is created. \n\nSeems it conflicts with the definition here.\n\nmysql\u003e select created_at, updated_at from clusters;\n+---------------------+------------+\n| created_at          | updated_at |\n+---------------------+------------+\n| 2016-06-28 08:11:10 | NULL       |\n+---------------------+------------+\n1 row in set (0.00 sec)","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"49a5220a5eb22d71f2ae03e24c146cb222178d75","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    binary \u003d Column(String(255))"},{"line_number":69,"context_line":"    # We want to overwrite default updated_at definition so we timestamp at"},{"line_number":70,"context_line":"    # creation as well, so we only need to check updated_at for the heartbeat"},{"line_number":71,"context_line":"    updated_at \u003d Column(DateTime, default\u003dtimeutils.utcnow,"},{"line_number":72,"context_line":"                        onupdate\u003dtimeutils.utcnow)"},{"line_number":73,"context_line":"    topic \u003d Column(String(255))"},{"line_number":74,"context_line":"    report_count \u003d Column(Integer, nullable\u003dFalse, default\u003d0)"},{"line_number":75,"context_line":"    disabled \u003d Column(Boolean, default\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_2f4c7e6f","line":72,"range":{"start_line":71,"start_character":0,"end_line":72,"end_character":50},"in_reply_to":"3aaa91ec_ccaff67b","updated":"2016-06-29 01:26:53.000000000","message":"Oh, sorry. You are right.","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4bef3d62b63c564958f6d36382c763e35dad9e05","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    binary \u003d Column(String(255))"},{"line_number":69,"context_line":"    # We want to overwrite default updated_at definition so we timestamp at"},{"line_number":70,"context_line":"    # creation as well, so we only need to check updated_at for the heartbeat"},{"line_number":71,"context_line":"    updated_at \u003d Column(DateTime, default\u003dtimeutils.utcnow,"},{"line_number":72,"context_line":"                        onupdate\u003dtimeutils.utcnow)"},{"line_number":73,"context_line":"    topic \u003d Column(String(255))"},{"line_number":74,"context_line":"    report_count \u003d Column(Integer, nullable\u003dFalse, default\u003d0)"},{"line_number":75,"context_line":"    disabled \u003d Column(Boolean, default\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3aaa91ec_ccaff67b","line":72,"range":{"start_line":71,"start_character":0,"end_line":72,"end_character":50},"in_reply_to":"3aaa91ec_d6fdc66f","updated":"2016-06-28 09:43:17.000000000","message":"Yes, but this is the services table, not the clusters, so you should look with:\n\n mysql\u003e select created_at, updated_at from services;","commit_id":"66eded864ec1fd97ee058eeb126f4747f1e120cc"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"d0db4bc2eb933eb51ebd90238d0409237a8207b5","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    cluster_name \u003d Column(String(255), nullable\u003dTrue)"},{"line_number":69,"context_line":"    host \u003d Column(String(255))  # , ForeignKey(\u0027hosts.id\u0027))"},{"line_number":70,"context_line":"    binary \u003d Column(String(255))"},{"line_number":71,"context_line":"    # We want to overwrite default updated_at definition so we timestamp at"},{"line_number":72,"context_line":"    # creation as well, so we only need to check updated_at for the heartbeat"},{"line_number":73,"context_line":"    updated_at \u003d Column(DateTime, default\u003dtimeutils.utcnow,"},{"line_number":74,"context_line":"                        onupdate\u003dtimeutils.utcnow)"},{"line_number":75,"context_line":"    topic \u003d Column(String(255))"},{"line_number":76,"context_line":"    report_count \u003d Column(Integer, nullable\u003dFalse, default\u003d0)"},{"line_number":77,"context_line":"    disabled \u003d Column(Boolean, default\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_14176755","line":74,"range":{"start_line":71,"start_character":0,"end_line":74,"end_character":50},"updated":"2016-07-22 15:46:39.000000000","message":"Doesn\u0027t this also need an ALTER on the DB migration side?","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"4b30b731507a28c955d7e589ac1da3053d3b9565","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    cluster_name \u003d Column(String(255), nullable\u003dTrue)"},{"line_number":69,"context_line":"    host \u003d Column(String(255))  # , ForeignKey(\u0027hosts.id\u0027))"},{"line_number":70,"context_line":"    binary \u003d Column(String(255))"},{"line_number":71,"context_line":"    # We want to overwrite default updated_at definition so we timestamp at"},{"line_number":72,"context_line":"    # creation as well, so we only need to check updated_at for the heartbeat"},{"line_number":73,"context_line":"    updated_at \u003d Column(DateTime, default\u003dtimeutils.utcnow,"},{"line_number":74,"context_line":"                        onupdate\u003dtimeutils.utcnow)"},{"line_number":75,"context_line":"    topic \u003d Column(String(255))"},{"line_number":76,"context_line":"    report_count \u003d Column(Integer, nullable\u003dFalse, default\u003d0)"},{"line_number":77,"context_line":"    disabled \u003d Column(Boolean, default\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":20,"id":"dada55a8_05fe0f05","line":74,"range":{"start_line":71,"start_character":0,"end_line":74,"end_character":50},"in_reply_to":"dada55a8_14176755","updated":"2016-07-22 16:09:32.000000000","message":"I don\u0027t think so, because this is only for newly created services, any service that has already been created and has had at least 1 heartbeat already has update_at set.","commit_id":"f99b7262747e4a197012b303fe9e596b20aa9ba1"}],"cinder/tests/unit/db/test_cluster.py":[{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"11389bedf7d239c47b0cc5ffe3fa154483ae20d3","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                          db.cluster_get, self.ctxt, cluster.id, is_up\u003dTrue)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def test_cluster_get_services_on_empty_cluster(self):"},{"line_number":179,"context_line":"        \"\"\"Test is_up filter works on empty clusters.\"\"\""},{"line_number":180,"context_line":"        cluster \u003d self._create_cluster()"},{"line_number":181,"context_line":"        db_cluster \u003d db.cluster_get(self.ctxt, cluster.id, get_services\u003dTrue)"},{"line_number":182,"context_line":"        self.assertEqual(cluster.id, db_cluster.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_c5b7aef3","line":179,"updated":"2016-06-22 21:35:24.000000000","message":"is_up -\u003e get_services","commit_id":"a08b95c70da16a3bbb66d2bab8a9bfdfc4ae604b"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f875441c086abd256fa0074b07264b5d6e7c60f9","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                          db.cluster_get, self.ctxt, cluster.id, is_up\u003dTrue)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def test_cluster_get_services_on_empty_cluster(self):"},{"line_number":179,"context_line":"        \"\"\"Test is_up filter works on empty clusters.\"\"\""},{"line_number":180,"context_line":"        cluster \u003d self._create_cluster()"},{"line_number":181,"context_line":"        db_cluster \u003d db.cluster_get(self.ctxt, cluster.id, get_services\u003dTrue)"},{"line_number":182,"context_line":"        self.assertEqual(cluster.id, db_cluster.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_88864811","line":179,"in_reply_to":"3aaa91ec_c5b7aef3","updated":"2016-06-23 09:58:54.000000000","message":"Done","commit_id":"a08b95c70da16a3bbb66d2bab8a9bfdfc4ae604b"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"c902223ae7959d4093ad03b97dea2976fec5bbc3","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def test_cluster_destroy_non_existent(self):"},{"line_number":234,"context_line":"        \"\"\"Test destroying non existent cluster.\"\"\""},{"line_number":235,"context_line":"        self.assertRaises(exception.ClusterNotFound,"},{"line_number":236,"context_line":"                          db.cluster_get, self.ctxt, 0)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def test_cluster_destroy_has_services(self):"},{"line_number":239,"context_line":"        \"\"\"Test that we cannot delete a cluster with non deleted services.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"3aaa91ec_fa4e756d","line":236,"updated":"2016-06-24 05:48:32.000000000","message":"Seems here it should be db.cluster_destroy.","commit_id":"22e0b0028f9b083d4b08f26d71a6386a500f9ea2"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"135bd1834c46eaafef33946f692afc32083159a2","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    def test_cluster_destroy_non_existent(self):"},{"line_number":234,"context_line":"        \"\"\"Test destroying non existent cluster.\"\"\""},{"line_number":235,"context_line":"        self.assertRaises(exception.ClusterNotFound,"},{"line_number":236,"context_line":"                          db.cluster_get, self.ctxt, 0)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def test_cluster_destroy_has_services(self):"},{"line_number":239,"context_line":"        \"\"\"Test that we cannot delete a cluster with non deleted services.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"3aaa91ec_a0695bfb","line":236,"in_reply_to":"3aaa91ec_fa4e756d","updated":"2016-06-24 08:19:20.000000000","message":"lol, yes it should be  :-)","commit_id":"22e0b0028f9b083d4b08f26d71a6386a500f9ea2"}],"cinder/tests/unit/test_db_api.py":[{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"11389bedf7d239c47b0cc5ffe3fa154483ae20d3","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster1@backend1#pool1\u0027}),"},{"line_number":1242,"context_line":"            db.volume_create(self.ctxt,"},{"line_number":1243,"context_line":"                             {\u0027host\u0027: \u0027host1@backend2#pool2\u0027,"},{"line_number":1244,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster1@backend2#pool1\u0027}),"},{"line_number":1245,"context_line":"            db.volume_create(self.ctxt,"},{"line_number":1246,"context_line":"                             {\u0027host\u0027: \u0027host2@backend#poo1\u0027,"},{"line_number":1247,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster2@backend#pool\u0027}),"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_057376e8","line":1244,"updated":"2016-06-22 21:35:24.000000000","message":"why pool1 instead of pool2 to match pool in host?\ndoesn\u0027t really matter, I don\u0027t think....","commit_id":"a08b95c70da16a3bbb66d2bab8a9bfdfc4ae604b"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f875441c086abd256fa0074b07264b5d6e7c60f9","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster1@backend1#pool1\u0027}),"},{"line_number":1242,"context_line":"            db.volume_create(self.ctxt,"},{"line_number":1243,"context_line":"                             {\u0027host\u0027: \u0027host1@backend2#pool2\u0027,"},{"line_number":1244,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster1@backend2#pool1\u0027}),"},{"line_number":1245,"context_line":"            db.volume_create(self.ctxt,"},{"line_number":1246,"context_line":"                             {\u0027host\u0027: \u0027host2@backend#poo1\u0027,"},{"line_number":1247,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster2@backend#pool\u0027}),"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_68ef9c87","line":1244,"in_reply_to":"3aaa91ec_057376e8","updated":"2016-06-23 09:58:54.000000000","message":"Because /me makes mistakes.  ;-)","commit_id":"a08b95c70da16a3bbb66d2bab8a9bfdfc4ae604b"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"ff8d87b09a3873f4922316846a70d5ccfa6d1a3e","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster1@backend1#pool1\u0027}),"},{"line_number":1242,"context_line":"            db.volume_create(self.ctxt,"},{"line_number":1243,"context_line":"                             {\u0027host\u0027: \u0027host1@backend2#pool2\u0027,"},{"line_number":1244,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster1@backend2#pool1\u0027}),"},{"line_number":1245,"context_line":"            db.volume_create(self.ctxt,"},{"line_number":1246,"context_line":"                             {\u0027host\u0027: \u0027host2@backend#poo1\u0027,"},{"line_number":1247,"context_line":"                              \u0027cluster_name\u0027: \u0027cluster2@backend#pool\u0027}),"}],"source_content_type":"text/x-python","patch_set":6,"id":"3aaa91ec_b542693c","line":1244,"in_reply_to":"3aaa91ec_68ef9c87","updated":"2016-06-23 13:39:28.000000000","message":"Well, if you write 10,000 LOC a day, you\u0027re bound to make some mistake.....","commit_id":"a08b95c70da16a3bbb66d2bab8a9bfdfc4ae604b"}]}
