)]}'
{"swift/common/db.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d7c93d62f025c86c47e6df85115beab7c2d88fe2","unresolved":true,"context_lines":[{"line_number":1016,"context_line":"            SELECT name FROM %s WHERE deleted \u003d 1"},{"line_number":1017,"context_line":"            AND name \u003e ?"},{"line_number":1018,"context_line":"            ORDER BY NAME LIMIT 1 OFFSET ?"},{"line_number":1019,"context_line":"        \u0027\u0027\u0027 % (self.db_contains_type,), (marker, RECLAIM_PAGE_SIZE - 1))"},{"line_number":1020,"context_line":"        row \u003d curs.fetchone()"},{"line_number":1021,"context_line":"        if row:"},{"line_number":1022,"context_line":"            # do a single book-ended DELETE and bounce out"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba52b7d4_b12ae4b3","line":1019,"updated":"2021-04-08 14:39:30.000000000","message":"maybe this is more correct - but the existing tests don\u0027t make it obvious\n\nI guess if you have 30 tombstones and a a reclaim_page_size of 10 you expect 3 queries to pull 10 each and the last one to be empty?","commit_id":"4f3ea9d6f882c862a33e1a0cd6b63bc0f77fee5b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"8833f1babaebd236177eda4b292bb6f667e86cf9","unresolved":true,"context_lines":[{"line_number":1016,"context_line":"            SELECT name FROM %s WHERE deleted \u003d 1"},{"line_number":1017,"context_line":"            AND name \u003e ?"},{"line_number":1018,"context_line":"            ORDER BY NAME LIMIT 1 OFFSET ?"},{"line_number":1019,"context_line":"        \u0027\u0027\u0027 % (self.db_contains_type,), (marker, RECLAIM_PAGE_SIZE - 1))"},{"line_number":1020,"context_line":"        row \u003d curs.fetchone()"},{"line_number":1021,"context_line":"        if row:"},{"line_number":1022,"context_line":"            # do a single book-ended DELETE and bounce out"}],"source_content_type":"text/x-python","patch_set":1,"id":"dc1079f8_f68862d9","line":1019,"in_reply_to":"ba52b7d4_b12ae4b3","updated":"2021-04-08 16:02:26.000000000","message":"yes, that\u0027s what I\u0027d expect.\n\nBut on master you have 2 clean_batch_qry queries deleting 11 row and a final one that deletes 9 rows (assuming the rows are all reclaimable) with a RECLAIM_PAGE_SIZE of 10.\n\nI found it confusing that the RECLAIM_PAGE_SIZE is not the size of the \"batch\" implied by clean_batch_qry.","commit_id":"4f3ea9d6f882c862a33e1a0cd6b63bc0f77fee5b"}],"test/unit/account/test_backend.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d7c93d62f025c86c47e6df85115beab7c2d88fe2","unresolved":true,"context_lines":[{"line_number":188,"context_line":"        c \u003d itertools.cycle([True, False])"},{"line_number":189,"context_line":"        for m, is_deleted in six.moves.zip(range(num_of_containers), c):"},{"line_number":190,"context_line":"            offset \u003d top_of_the_minute - (m * 60)"},{"line_number":191,"context_line":"            container_specs.append((Timestamp(offset), is_deleted))"},{"line_number":192,"context_line":"        random.seed(now)"},{"line_number":193,"context_line":"        random.shuffle(container_specs)"},{"line_number":194,"context_line":"        policy_indexes \u003d list(p.idx for p in POLICIES)"}],"source_content_type":"text/x-python","patch_set":1,"id":"e8e260b3_6e8e29a7","line":191,"updated":"2021-04-08 14:39:30.000000000","message":"so we should have 30 containers and 30 tombstones","commit_id":"4f3ea9d6f882c862a33e1a0cd6b63bc0f77fee5b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d7c93d62f025c86c47e6df85115beab7c2d88fe2","unresolved":true,"context_lines":[{"line_number":216,"context_line":"        reclaim_age \u003d top_of_the_minute + 1 - (num_of_containers / 2 * 60)"},{"line_number":217,"context_line":"        with broker.get() as conn:"},{"line_number":218,"context_line":"            self.assertEqual(count_reclaimable(conn, reclaim_age),"},{"line_number":219,"context_line":"                             num_of_containers / 4)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        orig__reclaim \u003d broker._reclaim"},{"line_number":222,"context_line":"        trace \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"f49cdf58_fc026c55","line":219,"updated":"2021-04-08 14:39:30.000000000","message":"of he 30 tombstones - 15 are reclaimable","commit_id":"4f3ea9d6f882c862a33e1a0cd6b63bc0f77fee5b"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"d7c93d62f025c86c47e6df85115beab7c2d88fe2","unresolved":true,"context_lines":[{"line_number":227,"context_line":"            return orig__reclaim(conn, age_timestamp, marker)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        with mock.patch.object(broker, \u0027_reclaim\u0027, new\u003dtracing_reclaim), \\"},{"line_number":230,"context_line":"                mock.patch(\u0027swift.common.db.RECLAIM_PAGE_SIZE\u0027, 11):"},{"line_number":231,"context_line":"            broker.reclaim(reclaim_age, reclaim_age)"},{"line_number":232,"context_line":"        with broker.get() as conn:"},{"line_number":233,"context_line":"            self.assertEqual(count_reclaimable(conn, reclaim_age), 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"2327b1f3_724221d1","line":230,"updated":"2021-04-08 14:39:30.000000000","message":"it\u0027s not obvious to me at all why this number is more correct, but I can see there\u0027s an extra (4 total) _reclaim call with the size of 10.","commit_id":"4f3ea9d6f882c862a33e1a0cd6b63bc0f77fee5b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"8833f1babaebd236177eda4b292bb6f667e86cf9","unresolved":true,"context_lines":[{"line_number":227,"context_line":"            return orig__reclaim(conn, age_timestamp, marker)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        with mock.patch.object(broker, \u0027_reclaim\u0027, new\u003dtracing_reclaim), \\"},{"line_number":230,"context_line":"                mock.patch(\u0027swift.common.db.RECLAIM_PAGE_SIZE\u0027, 11):"},{"line_number":231,"context_line":"            broker.reclaim(reclaim_age, reclaim_age)"},{"line_number":232,"context_line":"        with broker.get() as conn:"},{"line_number":233,"context_line":"            self.assertEqual(count_reclaimable(conn, reclaim_age), 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"6b19b915_d5d1a026","line":230,"in_reply_to":"2327b1f3_724221d1","updated":"2021-04-08 16:02:26.000000000","message":"it\u0027s not \"more\" correct - it\u0027s just the number of rows reclaimed per call to _reclaim that you need in order to have reclaim complete in 3 calls to _reclaim with the given scenario i.e. this gives you batches of 11, 11, 9. To get the same batch sizes on master we needed RECLAIM_PAGE_SIZE of 10.\n\nAny batch size between 11 and 15 will result in 3 calls to _reclaim. Batch size 10 results in 4 calls to _reclaim because the 3rd call returns an end_marker, necessitating a 4th call to discover that there are no more rows. The test assert 3 calls to _reclaim, so the batch size needs to be adjusted to satisfy that.","commit_id":"4f3ea9d6f882c862a33e1a0cd6b63bc0f77fee5b"}],"test/unit/common/test_db.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"21d0d4343359f69982f6832b058d241f6b341bd6","unresolved":true,"context_lines":[{"line_number":1586,"context_line":"        with broker.get() as conn:"},{"line_number":1587,"context_line":"            return self._count_reclaimable(conn, reclaim_age)"},{"line_number":1588,"context_line":""},{"line_number":1589,"context_line":"    def _setup_active_reclaimable(self):"},{"line_number":1590,"context_line":"        broker \u003d ExampleBroker(\u0027:memory:\u0027, account\u003d\u0027test_account\u0027,"},{"line_number":1591,"context_line":"                               container\u003d\u0027test_container\u0027)"},{"line_number":1592,"context_line":"        broker.initialize(Timestamp(\u00271\u0027).internal, 0)"}],"source_content_type":"text/x-python","patch_set":2,"id":"22c328a2_a5e92485","line":1589,"updated":"2021-04-09 15:45:17.000000000","message":"pulled in from parent patch but not used here","commit_id":"66e48542dfcd3c19428b28f35bb1cda9e4385cf1"}]}
