)]}'
{"nova/objects/instance.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"ac4b6a6e40ee328dbb7a24eeadc0533d4dfa3e60","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # depending on whether the instance is booted from volume or not so that"},{"line_number":100,"context_line":"    # there is no need to get bdms for each instance in a separate db query"},{"line_number":101,"context_line":"    # thereby improving the performance of the simple tenant usage."},{"line_number":102,"context_line":"    if (include_non_cols_fields and \u0027is_volume_backed\u0027 in expected_attrs):"},{"line_number":103,"context_line":"        non_cols_fields.append(\u0027is_volume_backed\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    simple_cols \u003d [x for x in simple_cols if x not in _INSTANCE_EXTRA_FIELDS]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_5e5935fe","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":31},"updated":"2020-01-13 07:07:19.000000000","message":"why we need this flag?","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":27302,"name":"Shilpa Devharakar","email":"shilpa.devharakar@nttdata.com","username":"shilpa.devharakar"},"change_message_id":"9f43db39170c9944b7387cd0685cb5dbeb344e8c","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # depending on whether the instance is booted from volume or not so that"},{"line_number":100,"context_line":"    # there is no need to get bdms for each instance in a separate db query"},{"line_number":101,"context_line":"    # thereby improving the performance of the simple tenant usage."},{"line_number":102,"context_line":"    if (include_non_cols_fields and \u0027is_volume_backed\u0027 in expected_attrs):"},{"line_number":103,"context_line":"        non_cols_fields.append(\u0027is_volume_backed\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    simple_cols \u003d [x for x in simple_cols if x not in _INSTANCE_EXTRA_FIELDS]"}],"source_content_type":"text/x-python","patch_set":8,"id":"1fa4df85_ffebffd8","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":31},"in_reply_to":"3fa7e38b_428b7a68","updated":"2020-02-27 06:08:50.000000000","message":"Hi Dan,\n\nAs suggested here if added \u0027is_volume_backed\u0027 field to \u0027_INSTANCE_OPTIONAL_JOINED_FIELDS\u0027 then getting below \u0027ArgumentError\u0027 error, so moving said field to \u0027_INSTANCE_OPTIONAL_NON_COLUMN_FIELDS\u0027\n\nPlease confirm.\n\nsqlalchemy.exc.ArgumentError: Can\u0027t find property named \"is_volume_backed\" on mapped class Instance-\u003einstances in this Query, during \nFile \"/opt/stack/nova/nova/db/sqlalchemy/api.py\", line 1900, in _build_instance_get\n        query \u003d query.options(joinedload(column))\n\n\nHere expecting \u0027is_volume_backed\u0027 column to be present at databae.","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":27302,"name":"Shilpa Devharakar","email":"shilpa.devharakar@nttdata.com","username":"shilpa.devharakar"},"change_message_id":"99f6c4e4b01ea4e6cc93be8e234ab29ab06556d6","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # depending on whether the instance is booted from volume or not so that"},{"line_number":100,"context_line":"    # there is no need to get bdms for each instance in a separate db query"},{"line_number":101,"context_line":"    # thereby improving the performance of the simple tenant usage."},{"line_number":102,"context_line":"    if (include_non_cols_fields and \u0027is_volume_backed\u0027 in expected_attrs):"},{"line_number":103,"context_line":"        non_cols_fields.append(\u0027is_volume_backed\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    simple_cols \u003d [x for x in simple_cols if x not in _INSTANCE_EXTRA_FIELDS]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_e1588159","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":31},"in_reply_to":"3fa7e38b_5e5935fe","updated":"2020-01-13 13:15:26.000000000","message":"Thanks Alex for review\nThis flag is necessary otherwise for each _expected_cols() expects \"is_volume_backed\" property on mapped class Instance-\u003einstances","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":27302,"name":"Shilpa Devharakar","email":"shilpa.devharakar@nttdata.com","username":"shilpa.devharakar"},"change_message_id":"01e6b606a6bbf980ef1ee8f557cca844cf2b3d50","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # depending on whether the instance is booted from volume or not so that"},{"line_number":100,"context_line":"    # there is no need to get bdms for each instance in a separate db query"},{"line_number":101,"context_line":"    # thereby improving the performance of the simple tenant usage."},{"line_number":102,"context_line":"    if (include_non_cols_fields and \u0027is_volume_backed\u0027 in expected_attrs):"},{"line_number":103,"context_line":"        non_cols_fields.append(\u0027is_volume_backed\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    simple_cols \u003d [x for x in simple_cols if x not in _INSTANCE_EXTRA_FIELDS]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_f1fb5dbc","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":31},"in_reply_to":"3fa7e38b_916ea9c6","updated":"2020-01-14 12:00:14.000000000","message":"Hi Alex,\nPlease refer [1], i have run [2] testcase by removing this flag, to help you to understand its need.\n\n[1]: http://paste.openstack.org/show/788371/\n[2]: tox -e py37 nova.tests.unit.compute.test_compute.ComputeTestCase.test_rebuild_instance_notification","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5132601f6479be8e889cdd2cdd1d5f60be006361","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # depending on whether the instance is booted from volume or not so that"},{"line_number":100,"context_line":"    # there is no need to get bdms for each instance in a separate db query"},{"line_number":101,"context_line":"    # thereby improving the performance of the simple tenant usage."},{"line_number":102,"context_line":"    if (include_non_cols_fields and \u0027is_volume_backed\u0027 in expected_attrs):"},{"line_number":103,"context_line":"        non_cols_fields.append(\u0027is_volume_backed\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    simple_cols \u003d [x for x in simple_cols if x not in _INSTANCE_EXTRA_FIELDS]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_916ea9c6","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":31},"in_reply_to":"3fa7e38b_e1588159","updated":"2020-01-14 11:52:56.000000000","message":"sorry, I may missed something, do you have specifc example?","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"70ff2ac6a28f2b4cef0fa51777ffdf645046ce8d","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # depending on whether the instance is booted from volume or not so that"},{"line_number":100,"context_line":"    # there is no need to get bdms for each instance in a separate db query"},{"line_number":101,"context_line":"    # thereby improving the performance of the simple tenant usage."},{"line_number":102,"context_line":"    if (include_non_cols_fields and \u0027is_volume_backed\u0027 in expected_attrs):"},{"line_number":103,"context_line":"        non_cols_fields.append(\u0027is_volume_backed\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    simple_cols \u003d [x for x in simple_cols if x not in _INSTANCE_EXTRA_FIELDS]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_428b7a68","line":102,"range":{"start_line":102,"start_character":8,"end_line":102,"end_character":31},"in_reply_to":"3fa7e38b_f1fb5dbc","updated":"2020-01-14 18:37:51.000000000","message":"I agree with alex, we don\u0027t need this flag. I think the problem stems from you putting this in the OPTIONAL_NON_COLUMN_FIELDS list. However, the list above specifically says \"fields that can be joined at the db layer\" which is what you have done in the patch before. Having to add something specific for your use-case when there are a ton of other attributes here not requiring that special treatment should be a clue that it\u0027s wrong.\n\nPlease put your field in OPTIONAL_JOINED_FIELDS and remove this special case.","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"70ff2ac6a28f2b4cef0fa51777ffdf645046ce8d","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        \u0027trusted_certs\u0027: fields.ObjectField(\u0027TrustedCerts\u0027, nullable\u003dTrue),"},{"line_number":233,"context_line":"        \u0027hidden\u0027: fields.BooleanField(default\u003dFalse),"},{"line_number":234,"context_line":"        \u0027resources\u0027: fields.ObjectField(\u0027ResourceList\u0027, nullable\u003dTrue),"},{"line_number":235,"context_line":"        \u0027is_volume_backed\u0027: fields.BooleanField(default\u003dFalse),"},{"line_number":236,"context_line":"        }"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    obj_extra_fields \u003d [\u0027name\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_a2bcae07","line":235,"range":{"start_line":235,"start_character":48,"end_line":235,"end_character":61},"updated":"2020-01-14 18:37:51.000000000","message":"This is not legit. The default here is only for the case where we call obj_set_defaults() on an instance object. If you were to do that, you\u0027d take this default which isn\u0027t going to be sane. Meaning, you can\u0027t guess if an instance is not volume backed.","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"70ff2ac6a28f2b4cef0fa51777ffdf645046ce8d","unresolved":false,"context_lines":[{"line_number":903,"context_line":"            if field in instance and field not in self:"},{"line_number":904,"context_line":"                setattr(self, field, getattr(instance, field))"},{"line_number":905,"context_line":""},{"line_number":906,"context_line":"    def _load_is_volume_backed(self, db_bfv\u003dNone):"},{"line_number":907,"context_line":"        if db_bfv is None:"},{"line_number":908,"context_line":"            bdms \u003d self.get_bdms()"},{"line_number":909,"context_line":"            self.is_volume_backed \u003d False"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_025a62f4","line":906,"updated":"2020-01-14 18:37:51.000000000","message":"I would argue that we should not provide a lazy-loader for this field. It would be pretty wasteful to pull a full instance object over RPC, and then go all the way back to the DB over RPC to pull a single boolean, but by way of yanking all the BDMS.\n\nIs there some specific reason why this needs to be lazy-loadable, or can we just make sure that anywhere we care about this we\u0027ve pre-queried for it? If you\u0027re just using this in the API for filtering, then just including it explicitly all the time would be better.","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5132601f6479be8e889cdd2cdd1d5f60be006361","unresolved":false,"context_lines":[{"line_number":908,"context_line":"            bdms \u003d self.get_bdms()"},{"line_number":909,"context_line":"            self.is_volume_backed \u003d False"},{"line_number":910,"context_line":"            for bdm in bdms:"},{"line_number":911,"context_line":"                if bdm.destination_type \u003d\u003d \u0027volume\u0027 and bdm.boot_index \u003d\u003d 0:"},{"line_number":912,"context_line":"                    self.is_volume_backed \u003d True"},{"line_number":913,"context_line":"                    break"},{"line_number":914,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_11887969","line":911,"range":{"start_line":911,"start_character":16,"end_line":911,"end_character":76},"updated":"2020-01-14 11:52:56.000000000","message":"nit, also can be \"if bdm.is_root and bdm.is_volume\"\n\nonly need to update if there a update for the patch.","commit_id":"43a11d326be2a470b7e32ef4e82ea296e481f99d"}]}
