)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3ee44657e9f5dab23c94932f9c1b9af1506bfcb8","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"The fix here is just to always prefer the code\u0027s version of the service"},{"line_number":13,"context_line":"over the value stored in the DB and remove special casing in the save()"},{"line_number":14,"context_line":"method."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I96fa9dabfb9b7a5f1703baf80534d8b104dab4e6"},{"line_number":17,"context_line":"Closes-Bug: 1579839"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"dab17558_138d637b","line":14,"updated":"2016-05-09 19:09:09.000000000","message":"I think this is only half right now.","commit_id":"372da0aa8577d32691589df2b0ffa4f30a538c34"}],"nova/objects/service.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bda341812e3091697e4e172e4defa011259c446b","unresolved":false,"context_lines":[{"line_number":295,"context_line":"            # NOTE(danms): Since we set/dirty version in init, don\u0027t"},{"line_number":296,"context_line":"            # do a save if that\u0027s all that has changed. This keeps the"},{"line_number":297,"context_line":"            # \"save is a no-op if nothing has changed\" behavior."},{"line_number":298,"context_line":"            return"},{"line_number":299,"context_line":"        self._check_minimum_version()"},{"line_number":300,"context_line":"        db_service \u003d db.service_update(self._context, self.id, updates)"},{"line_number":301,"context_line":"        self._from_db_object(self._context, self, db_service)"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_f8dcfce5","side":"PARENT","line":298,"updated":"2016-05-09 18:55:31.000000000","message":"I think just removing this should be fine, right? That should allow this code to work as intended on service startup:\n\nhttps://github.com/openstack/nova/blob/master/nova/service.py#L61-L79","commit_id":"1801a48cc6b529272c81687f1ffd41753e5c3e9a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bda341812e3091697e4e172e4defa011259c446b","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                continue"},{"line_number":182,"context_line":"            elif key \u003d\u003d \u0027version\u0027:"},{"line_number":183,"context_line":"                # NOTE(belliott) - let the version set in __init__ be used"},{"line_number":184,"context_line":"                continue"},{"line_number":185,"context_line":"            else:"},{"line_number":186,"context_line":"                service[key] \u003d db_service[key]"},{"line_number":187,"context_line":"        service._context \u003d context"}],"source_content_type":"text/x-python","patch_set":1,"id":"dab17558_d8693827","line":184,"updated":"2016-05-09 18:55:31.000000000","message":"You can\u0027t do this because we\u0027ll always read records as the current version instead of what is in the database. The minimum calculation still works, but this would be very confusing, especially if (when) we start looking up a specific record to make a decision.","commit_id":"c2458a79b6c16223e50aaf47ac3fac4a48e4494a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"99c5294b431e078f05792a6a7d3375c6b6709a6b","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    _SERVICE_VERSION_CACHING \u003d False"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":125,"context_line":"        # NOTE(danms): We\u0027re going against the rules here and overriding"},{"line_number":126,"context_line":"        # init. The reason is that we want to *ensure* that we\u0027re always"},{"line_number":127,"context_line":"        # setting the current service version on our objects, overriding"},{"line_number":128,"context_line":"        # whatever else might be set in the database, or otherwise (which"},{"line_number":129,"context_line":"        # is the normal reason not to override init)."},{"line_number":130,"context_line":"        #"},{"line_number":131,"context_line":"        # We also need to do this here so that it\u0027s set on the client side"},{"line_number":132,"context_line":"        # all the time, such that create() and save() operations will"},{"line_number":133,"context_line":"        # include the current service version."},{"line_number":134,"context_line":"        if \u0027version\u0027 in kwargs:"},{"line_number":135,"context_line":"            raise exception.ObjectActionError("},{"line_number":136,"context_line":"                action\u003d\u0027init\u0027,"},{"line_number":137,"context_line":"                reason\u003d\u0027Version field is immutable\u0027)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        super(Service, self).__init__(*args, **kwargs)"},{"line_number":140,"context_line":"        self.version \u003d SERVICE_VERSION"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def obj_make_compatible_from_manifest(self, primitive, target_version,"},{"line_number":143,"context_line":"                                          version_manifest):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_8e2445c5","line":140,"range":{"start_line":125,"start_character":8,"end_line":140,"end_character":38},"updated":"2016-05-10 19:28:07.000000000","message":"Is this still needed now that we\u0027re setting and updating the service version when a service starts?","commit_id":"dc5751c0df1ae9f454259aadcc23751f22f09059"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4fe5e737f4cdb577fd4e3299e455c25dd9e3e77a","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    _SERVICE_VERSION_CACHING \u003d False"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":125,"context_line":"        # NOTE(danms): We\u0027re going against the rules here and overriding"},{"line_number":126,"context_line":"        # init. The reason is that we want to *ensure* that we\u0027re always"},{"line_number":127,"context_line":"        # setting the current service version on our objects, overriding"},{"line_number":128,"context_line":"        # whatever else might be set in the database, or otherwise (which"},{"line_number":129,"context_line":"        # is the normal reason not to override init)."},{"line_number":130,"context_line":"        #"},{"line_number":131,"context_line":"        # We also need to do this here so that it\u0027s set on the client side"},{"line_number":132,"context_line":"        # all the time, such that create() and save() operations will"},{"line_number":133,"context_line":"        # include the current service version."},{"line_number":134,"context_line":"        if \u0027version\u0027 in kwargs:"},{"line_number":135,"context_line":"            raise exception.ObjectActionError("},{"line_number":136,"context_line":"                action\u003d\u0027init\u0027,"},{"line_number":137,"context_line":"                reason\u003d\u0027Version field is immutable\u0027)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        super(Service, self).__init__(*args, **kwargs)"},{"line_number":140,"context_line":"        self.version \u003d SERVICE_VERSION"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def obj_make_compatible_from_manifest(self, primitive, target_version,"},{"line_number":143,"context_line":"                                          version_manifest):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_098b0669","line":140,"range":{"start_line":125,"start_character":8,"end_line":140,"end_character":38},"in_reply_to":"dab17558_1f4fe16b","updated":"2016-05-11 14:04:35.000000000","message":"It\u0027s supposed to be a net.. Doing what we have now is probably enough to make sure everyone writes a current version, but I still want to leave this in place anyway.","commit_id":"dc5751c0df1ae9f454259aadcc23751f22f09059"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"631349a028cc1e294cef903bfe8b203392a0158b","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    _SERVICE_VERSION_CACHING \u003d False"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":125,"context_line":"        # NOTE(danms): We\u0027re going against the rules here and overriding"},{"line_number":126,"context_line":"        # init. The reason is that we want to *ensure* that we\u0027re always"},{"line_number":127,"context_line":"        # setting the current service version on our objects, overriding"},{"line_number":128,"context_line":"        # whatever else might be set in the database, or otherwise (which"},{"line_number":129,"context_line":"        # is the normal reason not to override init)."},{"line_number":130,"context_line":"        #"},{"line_number":131,"context_line":"        # We also need to do this here so that it\u0027s set on the client side"},{"line_number":132,"context_line":"        # all the time, such that create() and save() operations will"},{"line_number":133,"context_line":"        # include the current service version."},{"line_number":134,"context_line":"        if \u0027version\u0027 in kwargs:"},{"line_number":135,"context_line":"            raise exception.ObjectActionError("},{"line_number":136,"context_line":"                action\u003d\u0027init\u0027,"},{"line_number":137,"context_line":"                reason\u003d\u0027Version field is immutable\u0027)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        super(Service, self).__init__(*args, **kwargs)"},{"line_number":140,"context_line":"        self.version \u003d SERVICE_VERSION"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def obj_make_compatible_from_manifest(self, primitive, target_version,"},{"line_number":143,"context_line":"                                          version_manifest):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_1f4fe16b","line":140,"range":{"start_line":125,"start_character":8,"end_line":140,"end_character":38},"in_reply_to":"dab17558_8e2445c5","updated":"2016-05-10 20:21:03.000000000","message":"I don\u0027t understand whether this really adds value since the version always gets set to SERVICE_VERSION 2 lines down anyway.","commit_id":"dc5751c0df1ae9f454259aadcc23751f22f09059"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b16c356d1b85f8020f0d1b53eef9d46c997fe30a","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    _SERVICE_VERSION_CACHING \u003d False"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":125,"context_line":"        # NOTE(danms): We\u0027re going against the rules here and overriding"},{"line_number":126,"context_line":"        # init. The reason is that we want to *ensure* that we\u0027re always"},{"line_number":127,"context_line":"        # setting the current service version on our objects, overriding"},{"line_number":128,"context_line":"        # whatever else might be set in the database, or otherwise (which"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_c8ef58e7","line":125,"updated":"2016-05-11 00:55:51.000000000","message":"I wouldn\u0027t mind Dan commenting on the need for this before we approve.","commit_id":"854c39e26d94f006f539ea993ffaafa4892b100c"}],"nova/service.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"877c300183b8ff6a8347ac36ab8c267ac9ce70c7","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                    exception.ServiceBinaryExists):"},{"line_number":136,"context_line":"                # NOTE(danms): If we race to create a record with a sibling"},{"line_number":137,"context_line":"                # worker, don\u0027t fail here."},{"line_number":138,"context_line":"                self.service_ref \u003d objects.Service.get_by_host_and_binary("},{"line_number":139,"context_line":"                    ctxt, self.host, self.binary)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        _update_service_ref(self.service_ref, ctxt)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dab17558_3316a6a7","line":138,"updated":"2016-05-09 19:49:33.000000000","message":"We just looked up the service here. Can\u0027t we remove this, make a call to update only if we didn\u0027t create(which obviously wrote the new version) and make sure we get the ref back here that we need?","commit_id":"f3f043210e90a0a1c0ef95b46f6798a99c346173"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"ad5d94faffba2962383c0e04b9c070dc791c7520","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                    exception.ServiceBinaryExists):"},{"line_number":136,"context_line":"                # NOTE(danms): If we race to create a record with a sibling"},{"line_number":137,"context_line":"                # worker, don\u0027t fail here."},{"line_number":138,"context_line":"                self.service_ref \u003d objects.Service.get_by_host_and_binary("},{"line_number":139,"context_line":"                    ctxt, self.host, self.binary)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        _update_service_ref(self.service_ref, ctxt)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dab17558_992171a2","line":138,"in_reply_to":"dab17558_3316a6a7","updated":"2016-05-09 20:25:25.000000000","message":"Done","commit_id":"f3f043210e90a0a1c0ef95b46f6798a99c346173"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6cda11fa616d20ee8d09aa764641578f0bf2310c","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def _update_service_ref(this_service, context):"},{"line_number":62,"context_line":"    service \u003d objects.Service.get_by_host_and_binary(context,"},{"line_number":63,"context_line":"                                                     this_service.host,"},{"line_number":64,"context_line":"                                                     this_service.binary)"},{"line_number":65,"context_line":"    if not service:"},{"line_number":66,"context_line":"        LOG.error(_LE(\u0027Unable to find a service record to update for \u0027"},{"line_number":67,"context_line":"                      \u0027%(binary)s on %(host)s\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_ae2829e3","line":64,"range":{"start_line":62,"start_character":4,"end_line":64,"end_character":73},"updated":"2016-05-10 19:23:08.000000000","message":"This seems like a waste when we just got it the same way. I think this is only here because of the create case, right? We create the service without the version and then pass it to update to set the version. In the non-create update case, we just want to set the version on it (update it if they are different).","commit_id":"dc5751c0df1ae9f454259aadcc23751f22f09059"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"631349a028cc1e294cef903bfe8b203392a0158b","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def _update_service_ref(this_service, context):"},{"line_number":62,"context_line":"    service \u003d objects.Service.get_by_host_and_binary(context,"},{"line_number":63,"context_line":"                                                     this_service.host,"},{"line_number":64,"context_line":"                                                     this_service.binary)"},{"line_number":65,"context_line":"    if not service:"},{"line_number":66,"context_line":"        LOG.error(_LE(\u0027Unable to find a service record to update for \u0027"},{"line_number":67,"context_line":"                      \u0027%(binary)s on %(host)s\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"dab17558_f4568428","line":64,"range":{"start_line":62,"start_character":4,"end_line":64,"end_character":73},"in_reply_to":"dab17558_ae2829e3","updated":"2016-05-10 20:21:03.000000000","message":"Done","commit_id":"dc5751c0df1ae9f454259aadcc23751f22f09059"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b16c356d1b85f8020f0d1b53eef9d46c997fe30a","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            ctxt, self.host, self.binary)"},{"line_number":122,"context_line":"        if self.service_ref:"},{"line_number":123,"context_line":"            _update_service_ref(self.service_ref)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        else:"},{"line_number":126,"context_line":"            try:"},{"line_number":127,"context_line":"                self.service_ref \u003d _create_service_ref(self, ctxt)"}],"source_content_type":"text/x-python","patch_set":6,"id":"dab17558_48b24807","line":124,"updated":"2016-05-11 00:55:51.000000000","message":"nit: don\u0027t really need this extra blank line","commit_id":"854c39e26d94f006f539ea993ffaafa4892b100c"}]}
