)]}'
{"swift/common/db.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b509f98fe19b3c78a8c1c98805fe2b8c071bdd11","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"            for row in curs:"},{"line_number":1010,"context_line":"                marker \u003d row[1]"},{"line_number":1011,"context_line":"                if row[2] \u003c age_timestamp:"},{"line_number":1012,"context_line":"                    to_delete.append(row[0])"},{"line_number":1013,"context_line":"            if marker \u003d\u003d last_marker:"},{"line_number":1014,"context_line":"                break"},{"line_number":1015,"context_line":"            while len(to_delete) \u003e\u003d SQLITE_ARG_LIMIT:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_3c907243","line":1012,"updated":"2020-05-18 18:21:00.000000000","message":"I guess this part is fairly slow - we\u0027re bringing EVERY deleted row into python to evaluate it","commit_id":"f86f3df42360bcca8c735d923fb6035481e03e60"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9dc55ad97a13d6ccb7ee2782cb395be49eb6343a","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"            for row in curs:"},{"line_number":1010,"context_line":"                marker \u003d row[1]"},{"line_number":1011,"context_line":"                if row[2] \u003c age_timestamp:"},{"line_number":1012,"context_line":"                    to_delete.append(row[0])"},{"line_number":1013,"context_line":"            if marker \u003d\u003d last_marker:"},{"line_number":1014,"context_line":"                break"},{"line_number":1015,"context_line":"            while len(to_delete) \u003e\u003d SQLITE_ARG_LIMIT:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_324d399a","line":1012,"in_reply_to":"ff570b3c_3c907243","updated":"2020-05-18 20:06:25.000000000","message":"What about including the `created_at \u003c ?` in the query? I suppose part of the point of the bug is that we don\u0027t *want* to go too quickly -- but if our goal is a slower replicator, I think I\u0027d much prefer an explicit sleep() so we\u0027re not wasting CPU cycles.","commit_id":"f86f3df42360bcca8c735d923fb6035481e03e60"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a41e254f3825de65329dd0530cb373709c1169bf","unresolved":false,"context_lines":[{"line_number":1015,"context_line":"            while len(to_delete) \u003e\u003d SQLITE_ARG_LIMIT:"},{"line_number":1016,"context_line":"                batch, to_delete \u003d to_delete[:SQLITE_ARG_LIMIT], \\"},{"line_number":1017,"context_line":"                    to_delete[SQLITE_ARG_LIMIT:]"},{"line_number":1018,"context_line":"                delete_batch(batch)"},{"line_number":1019,"context_line":"        if to_delete:"},{"line_number":1020,"context_line":"            delete_batch(to_delete)"},{"line_number":1021,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_dcedf6b7","line":1018,"updated":"2020-05-18 18:24:18.000000000","message":"So this is A LOT closer to the behavior we want, but after seeing https://review.opendev.org/#/c/727876/ fail and thinking about how sqlite locking is going to work I\u0027m worried that as soon as this block fires (i.e. we have a row to delete) we\u0027ll pickup a write lock for this connection and the remainder of the (now much slower) _reclaim method with block other writers (like a .pending flush)","commit_id":"f86f3df42360bcca8c735d923fb6035481e03e60"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9dc55ad97a13d6ccb7ee2782cb395be49eb6343a","unresolved":false,"context_lines":[{"line_number":1015,"context_line":"            while len(to_delete) \u003e\u003d SQLITE_ARG_LIMIT:"},{"line_number":1016,"context_line":"                batch, to_delete \u003d to_delete[:SQLITE_ARG_LIMIT], \\"},{"line_number":1017,"context_line":"                    to_delete[SQLITE_ARG_LIMIT:]"},{"line_number":1018,"context_line":"                delete_batch(batch)"},{"line_number":1019,"context_line":"        if to_delete:"},{"line_number":1020,"context_line":"            delete_batch(to_delete)"},{"line_number":1021,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_32325911","line":1018,"in_reply_to":"ff570b3c_dcedf6b7","updated":"2020-05-18 20:06:25.000000000","message":"Can we do something with more-explicit transactions to convince SQLite to release the write lock in between?","commit_id":"f86f3df42360bcca8c735d923fb6035481e03e60"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"c6c172df8490c0929249aee45a40f63864513a26","unresolved":false,"context_lines":[{"line_number":1020,"context_line":"                AND %s \u003c ?"},{"line_number":1021,"context_line":"                ORDER BY NAME LIMIT ?"},{"line_number":1022,"context_line":"            \u0027\u0027\u0027 % (self.db_contains_type, self.db_reclaim_timestamp,), ("},{"line_number":1023,"context_line":"                marker, age_timestamp, RECLAIM_FLUSH_SIZE))"},{"line_number":1024,"context_line":"            last_marker \u003d marker"},{"line_number":1025,"context_line":"            for row in curs:"},{"line_number":1026,"context_line":"                to_delete.append(row[0])"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff570b3c_f0a07d94","line":1023,"updated":"2020-05-22 14:08:22.000000000","message":"I guess this really has the same problem as the original DELETE query, it\u0027s just holding a shared lock during the entire table scan instead of a reserved lock","commit_id":"8b841aa5f7b42f93fa86360cfa6317d40ebd81b2"}]}
