)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a0523938fe8b750f6392a9547915939c442975c0","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     yuanyue \u003cyyuanyuee@163.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-07-18 03:10:41 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Destroy the ReqSpec object of deleted instance"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a periodic task to find out and clean up"},{"line_number":10,"context_line":"all ReqSpec objects with no instances associated."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1f1a1f67_d2099c31","line":7,"updated":"2017-07-21 08:59:24.000000000","message":"That\u0027s not true, you\u0027re adding a new periodic task for cleaning orphaned request specs.","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a0523938fe8b750f6392a9547915939c442975c0","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Destroy the ReqSpec object of deleted instance"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a periodic task to find out and clean up"},{"line_number":10,"context_line":"all ReqSpec objects with no instances associated."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Iaf5378a429171ce35f98f20765dba4af6c87b1a1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1f1a1f67_ddc40d95","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":19},"updated":"2017-07-21 08:59:24.000000000","message":"given looking at all the instances could take a long of time, I\u0027m not sure a periodic task would be fine, because for example, if you have 1000 computes with 100.000 instances, I\u0027m not sure the method you provided would be running less than 60 secs.\n\nRather, as an operator, I\u0027d prefer to use a nova-manage command for removing the orphaned specs (and the BuildRequest items too FWIW) with a limit and a marker.","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a0523938fe8b750f6392a9547915939c442975c0","unresolved":false,"context_lines":[{"line_number":10,"context_line":"all ReqSpec objects with no instances associated."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Iaf5378a429171ce35f98f20765dba4af6c87b1a1"},{"line_number":13,"context_line":"Closes-Bug: #1678056"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1f1a1f67_922a048e","line":13,"updated":"2017-07-21 08:59:24.000000000","message":"Should be a related bug given https://review.openstack.org/#/c/391060/10","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"}],"nova/conf/scheduler.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a0523938fe8b750f6392a9547915939c442975c0","unresolved":false,"context_lines":[{"line_number":149,"context_line":"to clean up request spec with no instance associated in database."},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"Possible values:"},{"line_number":152,"context_line":"* 0: run at the default rate."},{"line_number":153,"context_line":"* -1: disable"},{"line_number":154,"context_line":"* Any other value"},{"line_number":155,"context_line":"\"\"\"),"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_bd0ef12f","line":152,"updated":"2017-07-21 08:59:24.000000000","message":"you should comment what is the default rate (AFAIK, 60sec)","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"}],"nova/objects/request_spec.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a0523938fe8b750f6392a9547915939c442975c0","unresolved":false,"context_lines":[{"line_number":611,"context_line":""},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":614,"context_line":"class RequestSpecList(base.ObjectListBase, base.NovaObject):"},{"line_number":615,"context_line":"    # Version 1.0: Initial version"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_9d3455e0","line":614,"updated":"2017-07-21 08:59:24.000000000","message":"I\u0027m not sure we really need this.","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"},{"author":{"_account_id":23417,"name":"yuanyue","email":"yyuanyuee@163.com","username":"yuanyue"},"change_message_id":"72280c1fa0280f30c9a199bedd6c7c4f1fd384d8","unresolved":false,"context_lines":[{"line_number":611,"context_line":""},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":614,"context_line":"class RequestSpecList(base.ObjectListBase, base.NovaObject):"},{"line_number":615,"context_line":"    # Version 1.0: Initial version"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"    VERSION \u003d \u00271.0\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_43cb801d","line":614,"in_reply_to":"1f1a1f67_9d3455e0","updated":"2017-07-21 10:00:00.000000000","message":"When it needs to get all spec, instead of geting one by one according to instance.uuid, RequestSpecList obj would query db  once a time to reduce access to db.","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"}],"nova/scheduler/manager.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a0523938fe8b750f6392a9547915939c442975c0","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        spacing\u003dCONF.scheduler.request_spec_cleanup_interval)"},{"line_number":75,"context_line":"    def _cleanup_expired_request_spec(self, context):"},{"line_number":76,"context_line":"        instance_uuids \u003d [inst[\u0027uuid\u0027] for inst in"},{"line_number":77,"context_line":"                          objects.InstanceList.get_all(context)]"},{"line_number":78,"context_line":"        for request_spec in objects.RequestSpecList.get_all(context):"},{"line_number":79,"context_line":"            if request_spec.instance_uuid in instance_uuids:"},{"line_number":80,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_5d9a3dc5","line":77,"updated":"2017-07-21 08:59:24.000000000","message":"that doesn\u0027t work for multple cells v2. You need to check each cell for all instances.\nThat\u0027s also a huge list you know.","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"a0523938fe8b750f6392a9547915939c442975c0","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def _cleanup_expired_request_spec(self, context):"},{"line_number":76,"context_line":"        instance_uuids \u003d [inst[\u0027uuid\u0027] for inst in"},{"line_number":77,"context_line":"                          objects.InstanceList.get_all(context)]"},{"line_number":78,"context_line":"        for request_spec in objects.RequestSpecList.get_all(context):"},{"line_number":79,"context_line":"            if request_spec.instance_uuid in instance_uuids:"},{"line_number":80,"context_line":"                continue"},{"line_number":81,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_9d6c559d","line":78,"updated":"2017-07-21 08:59:24.000000000","message":"so you\u0027ll litterally iterate over all the instances and all the specs every time you\u0027d calling this method ? \n\nImagine a cloud with 100000 active instances and *at least* the same number of specs (plus the ones that are orphaned). Are you sure it is scalable ?\n\nI\u0027d at least add a marker and a limit IMHO.","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"},{"author":{"_account_id":23417,"name":"yuanyue","email":"yyuanyuee@163.com","username":"yuanyue"},"change_message_id":"0bf62611877b2d3df30cf9d350357b240ae79b0e","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def _cleanup_expired_request_spec(self, context):"},{"line_number":76,"context_line":"        instance_uuids \u003d [inst[\u0027uuid\u0027] for inst in"},{"line_number":77,"context_line":"                          objects.InstanceList.get_all(context)]"},{"line_number":78,"context_line":"        for request_spec in objects.RequestSpecList.get_all(context):"},{"line_number":79,"context_line":"            if request_spec.instance_uuid in instance_uuids:"},{"line_number":80,"context_line":"                continue"},{"line_number":81,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_e3ca8c4d","line":78,"in_reply_to":"1f1a1f67_9d6c559d","updated":"2017-07-21 09:53:43.000000000","message":"This method would just query db twice. I add a RequestSpecList obj to reduce access to db. For every spec, it only needs to check wherther spec.instance_uuid is in the instance_uuids list.  So I suppose it might not be very time consuming. Moreover, we can set periodic time interval longer.","commit_id":"68924107d40590dc2df1b5da21ecdc28f408c097"}]}
