)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"343534c817e33ca98a11b42891dff7cc03693a6b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"We haven\u0027t had volume_type in expected_attrs for volume objects lists."},{"line_number":10,"context_line":"This resulted in situation in which even when joining the volume_type"},{"line_number":11,"context_line":"explicitely in DB API, the object just dropped the data. Volume type was"},{"line_number":12,"context_line":"then lazy loaded, so every \"cinder list\" call was making two additional"},{"line_number":13,"context_line":"DB queries per returned volume, causing massive performance drop."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This commit sorts this out by making expected_attrs to match what we"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5aef4532_fc2e57a3","line":12,"updated":"2016-03-10 12:18:42.000000000","message":"You should mention why 2 extra queries when volume_type was missing","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"53d4938308db2bca198244051bd80af62930ee87","unresolved":false,"context_lines":[{"line_number":9,"context_line":"We haven\u0027t had volume_type in expected_attrs for volume objects lists."},{"line_number":10,"context_line":"This resulted in situation in which even when joining the volume_type"},{"line_number":11,"context_line":"explicitely in DB API, the object just dropped the data. Volume type was"},{"line_number":12,"context_line":"then lazy loaded, so every \"cinder list\" call was making two additional"},{"line_number":13,"context_line":"DB queries per returned volume, causing massive performance drop."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This commit sorts this out by making expected_attrs to match what we"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5aef4532_a29946c6","line":12,"in_reply_to":"5aef4532_fc2e57a3","updated":"2016-03-10 12:33:55.000000000","message":"Sure.","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"}],"cinder/objects/snapshot.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"343534c817e33ca98a11b42891dff7cc03693a6b","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        snapshots \u003d db.snapshot_get_all(context, search_opts, marker, limit,"},{"line_number":236,"context_line":"                                        sort_keys, sort_dirs, offset)"},{"line_number":237,"context_line":"        return base.obj_make_list(context, cls(), objects.Snapshot,"},{"line_number":238,"context_line":"                                  snapshots, expected_attrs\u003d[\u0027metadata\u0027])"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    @base.remotable_classmethod"},{"line_number":241,"context_line":"    def get_by_host(cls, context, host, filters\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_c75c641b","line":238,"updated":"2016-03-10 12:18:42.000000000","message":"nit: These calls should use _get_expected_attrs","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"53d4938308db2bca198244051bd80af62930ee87","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        snapshots \u003d db.snapshot_get_all(context, search_opts, marker, limit,"},{"line_number":236,"context_line":"                                        sort_keys, sort_dirs, offset)"},{"line_number":237,"context_line":"        return base.obj_make_list(context, cls(), objects.Snapshot,"},{"line_number":238,"context_line":"                                  snapshots, expected_attrs\u003d[\u0027metadata\u0027])"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    @base.remotable_classmethod"},{"line_number":241,"context_line":"    def get_by_host(cls, context, host, filters\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_627bbe7b","line":238,"in_reply_to":"5aef4532_c75c641b","updated":"2016-03-10 12:33:55.000000000","message":"+1. :)","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"b6c71c4907bef0b74da5a9fb3cda2016a3049807","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        snapshots \u003d db.snapshot_get_all(context, search_opts, marker, limit,"},{"line_number":236,"context_line":"                                        sort_keys, sort_dirs, offset)"},{"line_number":237,"context_line":"        expected_attrs \u003d Snapshot._get_expected_attrs(context)"},{"line_number":238,"context_line":"        return base.obj_make_list(context, cls(context), objects.Snapshot,"},{"line_number":239,"context_line":"                                  snapshots, expected_attrs\u003dexpected_attrs)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    @base.remotable_classmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_28f1956b","line":238,"range":{"start_line":238,"start_character":47,"end_line":238,"end_character":54},"updated":"2016-03-10 13:21:02.000000000","message":"I don\u0027t really know why context were missing here, but it shouldn\u0027t, so I\u0027ve took a chance to add it.","commit_id":"4e3f61b331db1a4d97198ee485ccd4498091ce82"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a0a94cfab85aad2bc61d418d968e79409680e9b4","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        snapshots \u003d db.snapshot_get_all(context, search_opts, marker, limit,"},{"line_number":236,"context_line":"                                        sort_keys, sort_dirs, offset)"},{"line_number":237,"context_line":"        expected_attrs \u003d Snapshot._get_expected_attrs(context)"},{"line_number":238,"context_line":"        return base.obj_make_list(context, cls(context), objects.Snapshot,"},{"line_number":239,"context_line":"                                  snapshots, expected_attrs\u003dexpected_attrs)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    @base.remotable_classmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_c6573d56","line":238,"range":{"start_line":238,"start_character":47,"end_line":238,"end_character":54},"in_reply_to":"5aef4532_28f1956b","updated":"2016-03-10 15:09:47.000000000","message":"Good idea","commit_id":"4e3f61b331db1a4d97198ee485ccd4498091ce82"}],"cinder/objects/volume.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"343534c817e33ca98a11b42891dff7cc03693a6b","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @classmethod"},{"line_number":126,"context_line":"    def _get_expected_attrs(cls, context):"},{"line_number":127,"context_line":"        expected_attrs \u003d [\u0027metadata\u0027, \u0027volume_type\u0027, \u0027volume_type.extra_specs\u0027]"},{"line_number":128,"context_line":"        if context.is_admin:"},{"line_number":129,"context_line":"            expected_attrs.append(\u0027admin_metadata\u0027)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_67aab086","line":127,"updated":"2016-03-10 12:18:42.000000000","message":"-1: This will make us get the extra_specs *always*","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"53d4938308db2bca198244051bd80af62930ee87","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @classmethod"},{"line_number":126,"context_line":"    def _get_expected_attrs(cls, context):"},{"line_number":127,"context_line":"        expected_attrs \u003d [\u0027metadata\u0027, \u0027volume_type\u0027, \u0027volume_type.extra_specs\u0027]"},{"line_number":128,"context_line":"        if context.is_admin:"},{"line_number":129,"context_line":"            expected_attrs.append(\u0027admin_metadata\u0027)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_c700e404","line":127,"in_reply_to":"5aef4532_67aab086","updated":"2016-03-10 12:33:55.000000000","message":"But in case of fetching a single volume we\u0027re always joining that: https://github.com/openstack/cinder/blob/master/cinder/db/sqlalchemy/api.py#L1420-L1421","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d2d2dff63c67e4362da6f5bd6d17527754b15773","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    @classmethod"},{"line_number":126,"context_line":"    def _get_expected_attrs(cls, context):"},{"line_number":127,"context_line":"        expected_attrs \u003d [\u0027metadata\u0027, \u0027volume_type\u0027, \u0027volume_type.extra_specs\u0027]"},{"line_number":128,"context_line":"        if context.is_admin:"},{"line_number":129,"context_line":"            expected_attrs.append(\u0027admin_metadata\u0027)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_a2cdc667","line":127,"in_reply_to":"5aef4532_c700e404","updated":"2016-03-10 12:41:20.000000000","message":"Yep, yep, you are right.","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"343534c817e33ca98a11b42891dff7cc03693a6b","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            db_volume_type \u003d db_volume.get(\u0027volume_type\u0027)"},{"line_number":256,"context_line":"            if db_volume_type:"},{"line_number":257,"context_line":"                vt_expected_attrs \u003d []"},{"line_number":258,"context_line":"                if \u0027volume_type.extra_specs\u0027 in expected_attrs:"},{"line_number":259,"context_line":"                    vt_expected_attrs.append(\u0027extra_specs\u0027)"},{"line_number":260,"context_line":"                volume.volume_type \u003d objects.VolumeType._from_db_object("},{"line_number":261,"context_line":"                    context, objects.VolumeType(), db_volume_type,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_e7bd2003","line":258,"updated":"2016-03-10 12:18:42.000000000","message":"-1: This will still trigger a lazy load if I\u0027m not mistaken.","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"d2d2dff63c67e4362da6f5bd6d17527754b15773","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            db_volume_type \u003d db_volume.get(\u0027volume_type\u0027)"},{"line_number":256,"context_line":"            if db_volume_type:"},{"line_number":257,"context_line":"                vt_expected_attrs \u003d []"},{"line_number":258,"context_line":"                if \u0027volume_type.extra_specs\u0027 in expected_attrs:"},{"line_number":259,"context_line":"                    vt_expected_attrs.append(\u0027extra_specs\u0027)"},{"line_number":260,"context_line":"                volume.volume_type \u003d objects.VolumeType._from_db_object("},{"line_number":261,"context_line":"                    context, objects.VolumeType(), db_volume_type,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_a2a666ab","line":258,"in_reply_to":"5aef4532_027aba87","updated":"2016-03-10 12:41:20.000000000","message":"Guess what!  You are totally right!  ;-)","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"53d4938308db2bca198244051bd80af62930ee87","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            db_volume_type \u003d db_volume.get(\u0027volume_type\u0027)"},{"line_number":256,"context_line":"            if db_volume_type:"},{"line_number":257,"context_line":"                vt_expected_attrs \u003d []"},{"line_number":258,"context_line":"                if \u0027volume_type.extra_specs\u0027 in expected_attrs:"},{"line_number":259,"context_line":"                    vt_expected_attrs.append(\u0027extra_specs\u0027)"},{"line_number":260,"context_line":"                volume.volume_type \u003d objects.VolumeType._from_db_object("},{"line_number":261,"context_line":"                    context, objects.VolumeType(), db_volume_type,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_027aba87","line":258,"in_reply_to":"5aef4532_e7bd2003","updated":"2016-03-10 12:33:55.000000000","message":"This condition will evaluate to true only when we use get_by_id. And in that case we\u0027re already joining extra_specs in DB API [1].\n\nNote that in case of fetching whole list of volumes I\u0027m not passing expected_attrs with \u0027volume_type.extra_specs\u0027 to base.obj_make_list.\n\n[1] https://github.com/openstack/cinder/blob/master/cinder/db/sqlalchemy/api.py#L1420-L1421","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"}],"cinder/objects/volume_type.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"343534c817e33ca98a11b42891dff7cc03693a6b","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                                           marker\u003dmarker, limit\u003dlimit,"},{"line_number":121,"context_line":"                                           sort_keys\u003dsort_keys,"},{"line_number":122,"context_line":"                                           sort_dirs\u003dsort_dirs, offset\u003doffset)"},{"line_number":123,"context_line":"        expected_attrs \u003d [\u0027extra_specs\u0027, \u0027projects\u0027]"},{"line_number":124,"context_line":"        return base.obj_make_list(context, cls(context),"},{"line_number":125,"context_line":"                                  objects.VolumeType, types.values(),"},{"line_number":126,"context_line":"                                  expected_attrs\u003dexpected_attrs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_a7fcb8b8","line":123,"updated":"2016-03-10 12:18:42.000000000","message":"nit: We should use here _get_expected_attrs","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"53d4938308db2bca198244051bd80af62930ee87","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                                           marker\u003dmarker, limit\u003dlimit,"},{"line_number":121,"context_line":"                                           sort_keys\u003dsort_keys,"},{"line_number":122,"context_line":"                                           sort_dirs\u003dsort_dirs, offset\u003doffset)"},{"line_number":123,"context_line":"        expected_attrs \u003d [\u0027extra_specs\u0027, \u0027projects\u0027]"},{"line_number":124,"context_line":"        return base.obj_make_list(context, cls(context),"},{"line_number":125,"context_line":"                                  objects.VolumeType, types.values(),"},{"line_number":126,"context_line":"                                  expected_attrs\u003dexpected_attrs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_e2618ed4","line":123,"in_reply_to":"5aef4532_a7fcb8b8","updated":"2016-03-10 12:33:55.000000000","message":"Good point.","commit_id":"38a3eb279437becdcc763864c6d1284198a85a41"}]}
