)]}'
{"swift/account/backend.py":[{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"425c6690d2cd248f69ef50bb1645a0a1588f14f1","unresolved":false,"context_lines":[{"line_number":503,"context_line":"                        SET sync_point\u003dmax(?, sync_point)"},{"line_number":504,"context_line":"                        WHERE remote_id\u003d?"},{"line_number":505,"context_line":"                    \u0027\u0027\u0027, (max_rowid, source))"},{"line_number":506,"context_line":"            curs.execute(\u0027SELECT container_count FROM policy_stat\u0027)"},{"line_number":507,"context_line":"            conn.commit()"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"        with self.get() as conn:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_fbc45193","line":506,"updated":"2014-09-12 13:04:55.000000000","message":"clay, not sure how I feel about this, the only purpose it serves is to stimulate the error that causes the table migration however w/o it, the only \"natural\" call that will force the migration is get_policy_stats() via acct HEAD.  So, either make this extra single call here on every PUT or let the DB grow potentially pretty large (if no one HEADS the acct) and then migrate it when they do HEAD it.  Any suggestions?","commit_id":"86f7bf7772a8283d2f0b820239137595f5d9d3e0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"c7032e0ce5c05dbb4eaff4cda798de1b8978ce9d","unresolved":false,"context_lines":[{"line_number":503,"context_line":"                        SET sync_point\u003dmax(?, sync_point)"},{"line_number":504,"context_line":"                        WHERE remote_id\u003d?"},{"line_number":505,"context_line":"                    \u0027\u0027\u0027, (max_rowid, source))"},{"line_number":506,"context_line":"            curs.execute(\u0027SELECT container_count FROM policy_stat\u0027)"},{"line_number":507,"context_line":"            conn.commit()"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"        with self.get() as conn:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_82cd8d33","line":506,"in_reply_to":"fa98f980_fbc45193","updated":"2014-09-12 17:31:35.000000000","message":"is this every container create or just during replication?","commit_id":"86f7bf7772a8283d2f0b820239137595f5d9d3e0"},{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"425c6690d2cd248f69ef50bb1645a0a1588f14f1","unresolved":false,"context_lines":[{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        # now update the policy stat for all policies"},{"line_number":539,"context_line":"        for policy in POLICIES:"},{"line_number":540,"context_line":"            cont_count \u003d curs.execute(\u0027\u0027\u0027"},{"line_number":541,"context_line":"                SELECT COUNT(storage_policy_index)"},{"line_number":542,"context_line":"                FROM container"},{"line_number":543,"context_line":"                WHERE storage_policy_index \u003d ?;"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_bb3e4989","line":540,"updated":"2014-09-12 13:04:55.000000000","message":"I\u0027m guessing there might be an optimization here with this SQL, let me know...","commit_id":"86f7bf7772a8283d2f0b820239137595f5d9d3e0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"c7032e0ce5c05dbb4eaff4cda798de1b8978ce9d","unresolved":false,"context_lines":[{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        # now update the policy stat for all policies"},{"line_number":539,"context_line":"        for policy in POLICIES:"},{"line_number":540,"context_line":"            cont_count \u003d curs.execute(\u0027\u0027\u0027"},{"line_number":541,"context_line":"                SELECT COUNT(storage_policy_index)"},{"line_number":542,"context_line":"                FROM container"},{"line_number":543,"context_line":"                WHERE storage_policy_index \u003d ?;"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_829bcd16","line":540,"in_reply_to":"fa98f980_bb3e4989","updated":"2014-09-12 17:31:35.000000000","message":"yeah bound to be some sort of group by, if there\u0027s only one entry in the policy stats table you can probably just copy the value from container_stats.","commit_id":"86f7bf7772a8283d2f0b820239137595f5d9d3e0"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"436a4eb1be06b692bf1a0261877685fb0e22caa7","unresolved":false,"context_lines":[{"line_number":537,"context_line":"                SELECT COUNT(storage_policy_index)"},{"line_number":538,"context_line":"                FROM container"},{"line_number":539,"context_line":"                WHERE storage_policy_index \u003d ?;"},{"line_number":540,"context_line":"            \u0027\u0027\u0027, (policy.idx,)).fetchone()[0]"},{"line_number":541,"context_line":"            curs.execute(\u0027\u0027\u0027"},{"line_number":542,"context_line":"                UPDATE policy_stat"},{"line_number":543,"context_line":"                SET container_count \u003d ?"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_32eba179","line":540,"updated":"2014-09-19 18:21:20.000000000","message":"and deleted \u003d 0\n\ntook me forever to find that one :P\n\nplus we get an index out of it!","commit_id":"25c9273bb3bedd7458db56835bd47413cd9ea018"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"436a4eb1be06b692bf1a0261877685fb0e22caa7","unresolved":false,"context_lines":[{"line_number":543,"context_line":"                SET container_count \u003d ?"},{"line_number":544,"context_line":"                WHERE storage_policy_index\u003d?;"},{"line_number":545,"context_line":"            \u0027\u0027\u0027, (cont_count, policy.idx,))"},{"line_number":546,"context_line":"        conn.commit()"},{"line_number":547,"context_line":""},{"line_number":548,"context_line":"    def _migrate_add_storage_policy_index(self, conn):"},{"line_number":549,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa98f980_72aa891b","line":546,"updated":"2014-09-19 18:21:20.000000000","message":"I actually think it\u0027d look better to do the update with a sub-select; I\u0027ll code that up and fix the other while I\u0027m in there.","commit_id":"25c9273bb3bedd7458db56835bd47413cd9ea018"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4cdfe193d2b7b9a1deacc53b3b0781fd410d83e2","unresolved":false,"context_lines":[{"line_number":544,"context_line":""},{"line_number":545,"context_line":"        # keep the simple case simple, if there\u0027s only one entry in the"},{"line_number":546,"context_line":"        # policy_stat table we just copy the total container count from the"},{"line_number":547,"context_line":"        # container_stat table"},{"line_number":548,"context_line":""},{"line_number":549,"context_line":"        # if that triggers an update then the where changes \u003c\u003e 0 *would* exist"},{"line_number":550,"context_line":"        # and the insert or replace from the count subqueries won\u0027t execute"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_ab21e9fc","line":547,"updated":"2014-09-24 12:57:58.000000000","message":"container_stat -\u003e account_stat","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f1cbfe9f4279fc695df74960cf2c59edd4ee599f","unresolved":false,"context_lines":[{"line_number":544,"context_line":""},{"line_number":545,"context_line":"        # keep the simple case simple, if there\u0027s only one entry in the"},{"line_number":546,"context_line":"        # policy_stat table we just copy the total container count from the"},{"line_number":547,"context_line":"        # container_stat table"},{"line_number":548,"context_line":""},{"line_number":549,"context_line":"        # if that triggers an update then the where changes \u003c\u003e 0 *would* exist"},{"line_number":550,"context_line":"        # and the insert or replace from the count subqueries won\u0027t execute"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_aeee52b2","line":547,"in_reply_to":"da9df570_ab21e9fc","updated":"2014-09-24 14:55:41.000000000","message":"Done","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"}],"test/unit/account/test_auditor.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"daa8c11381fd506d6833f702174e491a4aacb0a1","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            def sleep(self, sec):"},{"line_number":71,"context_line":"                self.times +\u003d 1"},{"line_number":72,"context_line":"                if self.times \u003c sleep_times:"},{"line_number":73,"context_line":"                    time.sleep(0.1)"},{"line_number":74,"context_line":"                else:"},{"line_number":75,"context_line":"                    # stop forever by an error"},{"line_number":76,"context_line":"                    raise ValueError()"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_d4edeef0","side":"PARENT","line":73,"updated":"2014-09-24 14:19:12.000000000","message":"is the deleted call to time.sleep() deliberate or did it get lost in the if/else inversion?","commit_id":"4f16239280ac4a25cc99872e7c88c4a1c9a7a528"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f1cbfe9f4279fc695df74960cf2c59edd4ee599f","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            def sleep(self, sec):"},{"line_number":71,"context_line":"                self.times +\u003d 1"},{"line_number":72,"context_line":"                if self.times \u003c sleep_times:"},{"line_number":73,"context_line":"                    time.sleep(0.1)"},{"line_number":74,"context_line":"                else:"},{"line_number":75,"context_line":"                    # stop forever by an error"},{"line_number":76,"context_line":"                    raise ValueError()"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_8ef34e9d","side":"PARENT","line":73,"in_reply_to":"da9df570_d4edeef0","updated":"2014-09-24 14:55:41.000000000","message":"I didn\u0027t remove it, but my assumption was that it didn\u0027t help the correctness of the test and added unnecessary wall time.","commit_id":"4f16239280ac4a25cc99872e7c88c4a1c9a7a528"}],"test/unit/account/test_backend.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"daa8c11381fd506d6833f702174e491a4aacb0a1","unresolved":false,"context_lines":[{"line_number":1092,"context_line":"            conn.execute(\u0027SELECT storage_policy_index FROM container\u0027)"},{"line_number":1093,"context_line":""},{"line_number":1094,"context_line":""},{"line_number":1095,"context_line":"def pre_track_conainters_create_policy_stat(self, conn):"},{"line_number":1096,"context_line":"    \"\"\""},{"line_number":1097,"context_line":"    Copied from AccountBroker before the container_count column was"},{"line_number":1098,"context_line":"    added."}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_9f929f9d","line":1095,"updated":"2014-09-24 14:19:12.000000000","message":"nit?: conainters -\u003e containers\n\nhey, i don\u0027t want to be labelled a pedant, it passes pep8 :)","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f1cbfe9f4279fc695df74960cf2c59edd4ee599f","unresolved":false,"context_lines":[{"line_number":1092,"context_line":"            conn.execute(\u0027SELECT storage_policy_index FROM container\u0027)"},{"line_number":1093,"context_line":""},{"line_number":1094,"context_line":""},{"line_number":1095,"context_line":"def pre_track_conainters_create_policy_stat(self, conn):"},{"line_number":1096,"context_line":"    \"\"\""},{"line_number":1097,"context_line":"    Copied from AccountBroker before the container_count column was"},{"line_number":1098,"context_line":"    added."}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_ce05567b","line":1095,"in_reply_to":"da9df570_9f929f9d","updated":"2014-09-24 14:55:41.000000000","message":"Done","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"daa8c11381fd506d6833f702174e491a4aacb0a1","unresolved":false,"context_lines":[{"line_number":1116,"context_line":"    \"\"\")"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":""},{"line_number":1119,"context_line":"def pre_track_conainters_create_container_table(self, conn):"},{"line_number":1120,"context_line":"    \"\"\""},{"line_number":1121,"context_line":"    Copied from AccountBroker before the container_count column was"},{"line_number":1122,"context_line":"    added (using old stat trigger script)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_5a2be52f","line":1119,"updated":"2014-09-24 14:19:12.000000000","message":"ditto re. conainters","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f1cbfe9f4279fc695df74960cf2c59edd4ee599f","unresolved":false,"context_lines":[{"line_number":1116,"context_line":"    \"\"\")"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":""},{"line_number":1119,"context_line":"def pre_track_conainters_create_container_table(self, conn):"},{"line_number":1120,"context_line":"    \"\"\""},{"line_number":1121,"context_line":"    Copied from AccountBroker before the container_count column was"},{"line_number":1122,"context_line":"    added (using old stat trigger script)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_ee085a93","line":1119,"in_reply_to":"da9df570_5a2be52f","updated":"2014-09-24 14:55:41.000000000","message":"Done","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"daa8c11381fd506d6833f702174e491a4aacb0a1","unresolved":false,"context_lines":[{"line_number":1227,"context_line":"                conn.execute(\u0027SELECT container_count FROM policy_stat\u0027)"},{"line_number":1228,"context_line":"            except BaseException as err:"},{"line_number":1229,"context_line":"                exc \u003d err"},{"line_number":1230,"context_line":"        self.assert_(\u0027no such column: container_count\u0027 in str(exc))"},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"        self.tempdir \u003d mkdtemp()"},{"line_number":1233,"context_line":"        self.ts \u003d (Timestamp(t).internal for t in itertools.count(int(time())))"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_1f94ef35","line":1230,"updated":"2014-09-24 14:19:12.000000000","message":"could lines 1224-1230 be replace with self.assertUnmigrated(broker)?\n\nAlso, why create this broker, then go on to create self.broker below? I can see this one uses memory, whereas self.broker has a file. Maybe it is to check that the mocking has worked, but there is also a sanity check at line 1242 - am I missing something subtle or is this broker redundant?","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f1cbfe9f4279fc695df74960cf2c59edd4ee599f","unresolved":false,"context_lines":[{"line_number":1227,"context_line":"                conn.execute(\u0027SELECT container_count FROM policy_stat\u0027)"},{"line_number":1228,"context_line":"            except BaseException as err:"},{"line_number":1229,"context_line":"                exc \u003d err"},{"line_number":1230,"context_line":"        self.assert_(\u0027no such column: container_count\u0027 in str(exc))"},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"        self.tempdir \u003d mkdtemp()"},{"line_number":1233,"context_line":"        self.ts \u003d (Timestamp(t).internal for t in itertools.count(int(time())))"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_6ef54aca","line":1230,"in_reply_to":"da9df570_1f94ef35","updated":"2014-09-24 14:55:41.000000000","message":"Yup, missed that potential usage of assertUnmigrated(); will fix.\n\nIMO, it gives the test a chance to bail earlier if the sanity-check fails and at lower cost (no disk involved).  Also, by definition, an in-memory SQLite DB must exercise different code and this proves there\u0027s nothing different in this particular behavior.\n\nThat said, it was like this when I started refactoring it, so I\u0027m not super attached to it.","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"daa8c11381fd506d6833f702174e491a4aacb0a1","unresolved":false,"context_lines":[{"line_number":1249,"context_line":"        broker \u003d AccountBroker(\u0027:memory:\u0027, account\u003d\u0027a\u0027)"},{"line_number":1250,"context_line":"        broker.initialize(Timestamp(\u00271\u0027).internal)"},{"line_number":1251,"context_line":"        with broker.get() as conn:"},{"line_number":1252,"context_line":"            conn.execute(\u0027SELECT container_count FROM policy_stat\u0027)"},{"line_number":1253,"context_line":""},{"line_number":1254,"context_line":"    def restore_account_broker(self):"},{"line_number":1255,"context_line":"        AccountBroker.create_policy_stat_table \u003d \\"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_bf2123fd","line":1252,"updated":"2014-09-24 14:19:12.000000000","message":"So is this a sanity check that AccountBroker has been restored as it should be?","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f1cbfe9f4279fc695df74960cf2c59edd4ee599f","unresolved":false,"context_lines":[{"line_number":1249,"context_line":"        broker \u003d AccountBroker(\u0027:memory:\u0027, account\u003d\u0027a\u0027)"},{"line_number":1250,"context_line":"        broker.initialize(Timestamp(\u00271\u0027).internal)"},{"line_number":1251,"context_line":"        with broker.get() as conn:"},{"line_number":1252,"context_line":"            conn.execute(\u0027SELECT container_count FROM policy_stat\u0027)"},{"line_number":1253,"context_line":""},{"line_number":1254,"context_line":"    def restore_account_broker(self):"},{"line_number":1255,"context_line":"        AccountBroker.create_policy_stat_table \u003d \\"}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_ceb716d7","line":1252,"in_reply_to":"da9df570_bf2123fd","updated":"2014-09-24 14:55:41.000000000","message":"Correct; and as a fringe benefit, also proves that a newly-created DB in the new world starts out with a container_count column.","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"daa8c11381fd506d6833f702174e491a4aacb0a1","unresolved":false,"context_lines":[{"line_number":1282,"context_line":"            self.broker.put_container(name, next(self.ts),"},{"line_number":1283,"context_line":"                                      0, 0, 0, int(policy))"},{"line_number":1284,"context_line":"            per_policy_container_counts[int(policy)] +\u003d 1"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        total_container_count \u003d self.broker.get_info()[\u0027container_count\u0027]"},{"line_number":1287,"context_line":"        self.assertEqual(total_container_count, num_containers)"},{"line_number":1288,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_1a04fd13","line":1285,"updated":"2014-09-24 14:19:12.000000000","message":"not sure it matters but is self.broker._commit_puts_stale_ok() needed here in same way as line 1316? \n\nActually, it looks like get_info() and get_policy_stats() make that call anyway.","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"},{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"f1cbfe9f4279fc695df74960cf2c59edd4ee599f","unresolved":false,"context_lines":[{"line_number":1282,"context_line":"            self.broker.put_container(name, next(self.ts),"},{"line_number":1283,"context_line":"                                      0, 0, 0, int(policy))"},{"line_number":1284,"context_line":"            per_policy_container_counts[int(policy)] +\u003d 1"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        total_container_count \u003d self.broker.get_info()[\u0027container_count\u0027]"},{"line_number":1287,"context_line":"        self.assertEqual(total_container_count, num_containers)"},{"line_number":1288,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da9df570_4ed24601","line":1285,"in_reply_to":"da9df570_1a04fd13","updated":"2014-09-24 14:55:41.000000000","message":"Removed the calls lower down since, yeah, they\u0027re unnecessary.","commit_id":"cee87233e7e17ea03cf42b2dcee47e8d5b400e22"}]}
