)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6f6783dfb3702b912906fc26c3913473866a45fb","unresolved":false,"context_lines":[{"line_number":4305,"context_line":"            if rd_req \u003c current_usage[\u0027curr_reads\u0027] or \\"},{"line_number":4306,"context_line":"                    rd_bytes \u003c current_usage[\u0027curr_read_bytes\u0027] or \\"},{"line_number":4307,"context_line":"                    wr_req \u003c current_usage[\u0027curr_writes\u0027] or \\"},{"line_number":4308,"context_line":"                    wr_bytes \u003c current_usage[\u0027curr_write_bytes\u0027]:"},{"line_number":4309,"context_line":"                LOG.info(_(\"Volume(%s) has lower stats then what is in \""},{"line_number":4310,"context_line":"                           \"the database. Instance must have been rebooted \""},{"line_number":4311,"context_line":"                           \"or crashed. Updating totals.\") % id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FrBg%3D","line":4308,"updated":"2013-04-29 18:23:40.000000000","message":"I\u0027d prefer this if condition be wrapped in parentheses to avoid the need to use backslashes.","commit_id":"d42bf982f1bbd4a9c21bf0552a8645544213849b"},{"author":{"_account_id":6969,"name":"Michael Kerrin","email":"michael.kerrin@hpe.com","username":"mkerrin"},"change_message_id":"74f0c789e457bf5a7496405384c6cc676bc975b7","unresolved":false,"context_lines":[{"line_number":4305,"context_line":"            if rd_req \u003c current_usage[\u0027curr_reads\u0027] or \\"},{"line_number":4306,"context_line":"                    rd_bytes \u003c current_usage[\u0027curr_read_bytes\u0027] or \\"},{"line_number":4307,"context_line":"                    wr_req \u003c current_usage[\u0027curr_writes\u0027] or \\"},{"line_number":4308,"context_line":"                    wr_bytes \u003c current_usage[\u0027curr_write_bytes\u0027]:"},{"line_number":4309,"context_line":"                LOG.info(_(\"Volume(%s) has lower stats then what is in \""},{"line_number":4310,"context_line":"                           \"the database. Instance must have been rebooted \""},{"line_number":4311,"context_line":"                           \"or crashed. Updating totals.\") % id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FqIw%3D","line":4308,"in_reply_to":"AAAAOn%2F%2FrBg%3D","updated":"2013-04-30 09:19:36.000000000","message":"Done","commit_id":"d42bf982f1bbd4a9c21bf0552a8645544213849b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6f6783dfb3702b912906fc26c3913473866a45fb","unresolved":false,"context_lines":[{"line_number":4312,"context_line":"                if not update_totals:"},{"line_number":4313,"context_line":"                    values[\u0027tot_last_refreshed\u0027] \u003d last_refreshed"},{"line_number":4314,"context_line":"                    values[\u0027tot_reads\u0027] \u003d models.VolumeUsage.tot_reads + \\"},{"line_number":4315,"context_line":"                        current_usage[\u0027curr_reads\u0027]"},{"line_number":4316,"context_line":"                    values[\u0027tot_read_bytes\u0027] \u003d \\"},{"line_number":4317,"context_line":"                        models.VolumeUsage.tot_read_bytes + \\"},{"line_number":4318,"context_line":"                        current_usage[\u0027curr_read_bytes\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FrBU%3D","line":4315,"updated":"2013-04-29 18:23:40.000000000","message":"I\u0027d also prefer these assignments be wrapped in parentheses to eliminate the backslashes, but I accept that may not be possible everywhere (e.g., the line following this one)…","commit_id":"d42bf982f1bbd4a9c21bf0552a8645544213849b"},{"author":{"_account_id":6969,"name":"Michael Kerrin","email":"michael.kerrin@hpe.com","username":"mkerrin"},"change_message_id":"74f0c789e457bf5a7496405384c6cc676bc975b7","unresolved":false,"context_lines":[{"line_number":4312,"context_line":"                if not update_totals:"},{"line_number":4313,"context_line":"                    values[\u0027tot_last_refreshed\u0027] \u003d last_refreshed"},{"line_number":4314,"context_line":"                    values[\u0027tot_reads\u0027] \u003d models.VolumeUsage.tot_reads + \\"},{"line_number":4315,"context_line":"                        current_usage[\u0027curr_reads\u0027]"},{"line_number":4316,"context_line":"                    values[\u0027tot_read_bytes\u0027] \u003d \\"},{"line_number":4317,"context_line":"                        models.VolumeUsage.tot_read_bytes + \\"},{"line_number":4318,"context_line":"                        current_usage[\u0027curr_read_bytes\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FqIo%3D","line":4315,"in_reply_to":"AAAAOn%2F%2FrBU%3D","updated":"2013-04-30 09:19:36.000000000","message":"Changed them all, see how it looks, I am easy about the style here.","commit_id":"d42bf982f1bbd4a9c21bf0552a8645544213849b"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"194da3abef325a76e1ebd0fb9891d5c99e35964e","unresolved":false,"context_lines":[{"line_number":4337,"context_line":"                LOG.info(_(\"Volume(%s) has lower stats then what is in \""},{"line_number":4338,"context_line":"                           \"the database. Instance must have been rebooted \""},{"line_number":4339,"context_line":"                           \"or crashed. Updating totals.\") % id)"},{"line_number":4340,"context_line":"                if not update_totals:"},{"line_number":4341,"context_line":"                    values[\u0027tot_last_refreshed\u0027] \u003d last_refreshed"},{"line_number":4342,"context_line":"                    values[\u0027tot_reads\u0027] \u003d (models.VolumeUsage.tot_reads +"},{"line_number":4343,"context_line":"                                           current_usage[\u0027curr_reads\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2Fp9c%3D","line":4340,"updated":"2013-04-30 13:06:22.000000000","message":"It\u0027s not clear to me why this check is here and changes behaviour.  Up above it seems to only indicate whether or not totals should be updated, not how.  But here it\u0027s changing how the totals are updated.  Does it need to be done this way?","commit_id":"050bae48dcd2be9f4a5c0118de7dc12aec2fce70"},{"author":{"_account_id":6969,"name":"Michael Kerrin","email":"michael.kerrin@hpe.com","username":"mkerrin"},"change_message_id":"ddf18648649dbb342ab1cecc3e7e010b5b8c743d","unresolved":false,"context_lines":[{"line_number":4337,"context_line":"                LOG.info(_(\"Volume(%s) has lower stats then what is in \""},{"line_number":4338,"context_line":"                           \"the database. Instance must have been rebooted \""},{"line_number":4339,"context_line":"                           \"or crashed. Updating totals.\") % id)"},{"line_number":4340,"context_line":"                if not update_totals:"},{"line_number":4341,"context_line":"                    values[\u0027tot_last_refreshed\u0027] \u003d last_refreshed"},{"line_number":4342,"context_line":"                    values[\u0027tot_reads\u0027] \u003d (models.VolumeUsage.tot_reads +"},{"line_number":4343,"context_line":"                                           current_usage[\u0027curr_reads\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2Fp8Q%3D","line":4340,"in_reply_to":"AAAAOn%2F%2Fp9c%3D","updated":"2013-04-30 13:38:37.000000000","message":"It does need to be done this way.\n\nTaking rd_byes as an example, the 3 other values have the same logic. rd_bytes is the current number of bytes read as read from the volume. If you read 1000 bytes from the volume up to tick A and nothing to tick A + 1 then run the poll for A + 1 rd_bytes will have a value of 1000. So rd_bytes is a cumulation value, we always take what was passed in, in normal operation. The following two cases are not normal.\n\nWhen a user detaches a volume, vol_usage_update get called with update_totals set to True. In this case we add rd_bytes to the tot_read_bytes column. We set current_read_bytes to zero as the volume is detached now and no reads can occur. The poil will not now read this volume (it is detached). This is the first case when we update the totals you allude to. When the volume gets reattached the rd_bytes will represent the current session and will start from nothing, hence why we add it to the totals column.\n\nNow (and this is the reason for this patch) when an instance gets rebooted either intentionally or not, at the next tick, the poll will read the current read bytes off the hardware will be less then the current read bytes. For example if rd_bytes is currently 1gig, and then the system reboots, at the next tick you end up getting a very small number maybe 1mb depending on usage. When this happens this patch adds the 1gig to tot_read_bytes and then continues to save the rd_bytes as the current_read_bytes to the cache table. This happens once, after this you have normal operation. The current_read_bytes increases with usage.\n\nCurrently this is the only way to tell that we were rebooted / crashed and the volume statistics are off.\n\nThis way we have a reliable count of all bytes read off a volume and can bill our customers on their IO usage.\n\nHope that helps, let me know if not.","commit_id":"050bae48dcd2be9f4a5c0118de7dc12aec2fce70"}],"nova/tests/test_db_api.py":[{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"d298ca130e11dd808ececcbb732432464e295b20","unresolved":false,"context_lines":[{"line_number":2586,"context_line":""},{"line_number":2587,"context_line":"    def test_vol_usage_update_totals_update_when_domblkstats_reset(self):"},{"line_number":2588,"context_line":"        # This is unlikely to happen, but could when a volume is detached"},{"line_number":2589,"context_line":"        # right after a instancee has rebooted / recovered and before"},{"line_number":2590,"context_line":"        # the system polled and updated the volume usage cache table."},{"line_number":2591,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":2592,"context_line":"        now \u003d timeutils.utcnow()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F124%3D","line":2589,"updated":"2013-04-18 16:46:08.000000000","message":"s/instancee/instance/","commit_id":"7f0cfbcdc6dc7410a057a418d1a3a94ded17baa7"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6f6783dfb3702b912906fc26c3913473866a45fb","unresolved":false,"context_lines":[{"line_number":2630,"context_line":"        for key, value in expected_vol_usage.items():"},{"line_number":2631,"context_line":"            self.assertEqual(vol_usage[key], value, key)"},{"line_number":2632,"context_line":""},{"line_number":2633,"context_line":"        timeutils.clear_time_override()"},{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":""},{"line_number":2636,"context_line":"class TaskLogTestCase(test.TestCase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FrA4%3D","line":2633,"updated":"2013-04-29 18:23:40.000000000","message":"Tell me, what happens if one of the assertions above fails?  Then this clear_time_override() will never get called.  I realize all the other tests here use this meme, but it is the wrong meme.  Please update the tests you have touched to make use of the TimeOverride fixture, i.e., replace \"timeutils.set_time_override(now)\" with \"self.useFixture(test.TimeOverride())\".  (You can leave the existing tests that you have not touched alone; I\u0027m only concerned with the ones that you have touched for this patch…)\n\nI should point out that the correct calling order here is likely going to be:\n\n    self.useFixture(test.TimeOverride())\n    now \u003d timeutils.utcnow()\n\nAs opposed to the current meme:\n\n    now \u003d timeutils.utcnow()\n    timeutils.set_time_override(now)\n    …\n    timeutils.clear_time_override()","commit_id":"d42bf982f1bbd4a9c21bf0552a8645544213849b"},{"author":{"_account_id":6969,"name":"Michael Kerrin","email":"michael.kerrin@hpe.com","username":"mkerrin"},"change_message_id":"74f0c789e457bf5a7496405384c6cc676bc975b7","unresolved":false,"context_lines":[{"line_number":2630,"context_line":"        for key, value in expected_vol_usage.items():"},{"line_number":2631,"context_line":"            self.assertEqual(vol_usage[key], value, key)"},{"line_number":2632,"context_line":""},{"line_number":2633,"context_line":"        timeutils.clear_time_override()"},{"line_number":2634,"context_line":""},{"line_number":2635,"context_line":""},{"line_number":2636,"context_line":"class TaskLogTestCase(test.TestCase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FqH0%3D","line":2633,"in_reply_to":"AAAAOn%2F%2FrA4%3D","updated":"2013-04-30 09:19:36.000000000","message":"I moved that VolumeUageDBApiTestCase to using the fixture as suggested.","commit_id":"d42bf982f1bbd4a9c21bf0552a8645544213849b"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":24,"name":"Chuck Short","email":"charles.short@windriver.com","username":"zulcss"},"change_message_id":"929b114ee36145cecd43ff866d75ac47209f79a1","unresolved":false,"context_lines":[{"line_number":2739,"context_line":""},{"line_number":2740,"context_line":"                if vol_stats:"},{"line_number":2741,"context_line":"                    rd_req, rd_bytes, wr_req, wr_bytes, flush_ops \u003d vol_stats"},{"line_number":2742,"context_line":"                    LOG.debug("},{"line_number":2743,"context_line":"                        _(\"Got stats for volume_id(%(volume_id)s) - \""},{"line_number":2744,"context_line":"                          \"rd_req(%(rd_req)d) rd_bytes(%(rd_bytes)d) \""},{"line_number":2745,"context_line":"                          \"wr_req(%(wr_req)d) wr_bytes(%(wr_bytes)d)\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FpW0%3D","line":2742,"updated":"2013-04-30 18:19:06.000000000","message":"Can you reword this a bit better it looks awkward.","commit_id":"050bae48dcd2be9f4a5c0118de7dc12aec2fce70"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2e49540c7ee08129f78ab93a40650d5a73b7b40c","unresolved":false,"context_lines":[{"line_number":2743,"context_line":"                        _(\"Got stats for volume_id(%(volume_id)s) - \""},{"line_number":2744,"context_line":"                          \"rd_req(%(rd_req)d) rd_bytes(%(rd_bytes)d) \""},{"line_number":2745,"context_line":"                          \"wr_req(%(wr_req)d) wr_bytes(%(wr_bytes)d)\")"},{"line_number":2746,"context_line":"                        % locals())"},{"line_number":2747,"context_line":"                    vol_usage.append(dict(volume\u003dvolume_id,"},{"line_number":2748,"context_line":"                                          instance\u003dinstance,"},{"line_number":2749,"context_line":"                                          rd_req\u003drd_req,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FpqU%3D","line":2746,"updated":"2013-04-30 16:14:21.000000000","message":"There are patches pending to get rid of using locals() in this fashion.  I recommend replacing the \"rd_req, rd_bytes, … \u003d vol_stats\" line above with one creating a dictionary, then passing that dictionary in place of locals().","commit_id":"050bae48dcd2be9f4a5c0118de7dc12aec2fce70"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"b216cae5db7901fd78bbd4c165514efd6fd608f1","unresolved":false,"context_lines":[{"line_number":2746,"context_line":"                                 wr_bytes\u003dvol_stats[3],"},{"line_number":2747,"context_line":"                                 flush_operations\u003dvol_stats[4])"},{"line_number":2748,"context_line":"                    LOG.debug("},{"line_number":2749,"context_line":"                        _(\"Got volume usage stats for the volume(%(volume)s)\""},{"line_number":2750,"context_line":"                          \" - rd_req(%(rd_req)d) rd_bytes(%(rd_bytes)d)\""},{"line_number":2751,"context_line":"                          \" wr_req(%(wr_req)d) wr_bytes(%(wr_bytes)d)\")"},{"line_number":2752,"context_line":"                        % stats)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2Fn%2Fw%3D","line":2749,"updated":"2013-05-01 14:34:39.000000000","message":"Minor nit but why not include the instance ID as well - when looking through log files its a pretty common thing to be looking for ?","commit_id":"fb239a69bc01b06f3985eec7af805ef516c1ddba"}]}
