)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0d5487339e4032c79e6f6abcc085208b7098f008","unresolved":false,"context_lines":[{"line_number":12,"context_line":"batches of 100 at a time to prevent the transaction log from"},{"line_number":13,"context_line":"filling up."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Batch sizes of 100 were chosen because they are known to not fill"},{"line_number":16,"context_line":"a DB2 transaction log of default maximum size. Note that DELETE"},{"line_number":17,"context_line":"queries with LIMIT subqueries are not supported on some (if not all)"},{"line_number":18,"context_line":"versions of MySQL, so batched token deletes are only used with"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"AAAATn%2F8560%3D","line":15,"updated":"2013-12-18 23:49:00.000000000","message":"Suggest remove this because it\u0027s already a comment in the code.","commit_id":"f3d29b076156152a636efa4f2eef59202a1b301e"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"1865947275060105d0e4c71c4caf7908c44a2908","unresolved":false,"context_lines":[{"line_number":12,"context_line":"batches of 100 at a time to prevent the transaction log from"},{"line_number":13,"context_line":"filling up."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Batch sizes of 100 were chosen because they are known to not fill"},{"line_number":16,"context_line":"a DB2 transaction log of default maximum size. Note that DELETE"},{"line_number":17,"context_line":"queries with LIMIT subqueries are not supported on some (if not all)"},{"line_number":18,"context_line":"versions of MySQL, so batched token deletes are only used with"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"AAAAT3%2F%2FvYM%3D","line":15,"in_reply_to":"AAAATn%2F8560%3D","updated":"2014-01-02 16:14:34.000000000","message":"Done","commit_id":"f3d29b076156152a636efa4f2eef59202a1b301e"}],"keystone/tests/test_backend_sql.py":[{"author":{"_account_id":7179,"name":"Brad Pokorny","email":"brad_pokorny@symantec.com","username":"bpokorny"},"change_message_id":"97800fbdba786567d3da898d4de84b491f9dfd67","unresolved":false,"context_lines":[{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def test_flush_expired_tokens_batch(self):"},{"line_number":376,"context_line":"        # This test simply executes the code under test to verify"},{"line_number":377,"context_line":"        # that the code is legal.  It is is not possible to test"},{"line_number":378,"context_line":"        # whether records are deleted in batches using sqlite,"},{"line_number":379,"context_line":"        # because the limit function does not seem to affect"},{"line_number":380,"context_line":"        # delete subqueries; these are, however, legal."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F876Q%3D","line":377,"updated":"2013-12-18 16:05:39.000000000","message":"(nit) It is is -\u003e It is","commit_id":"fa987390f8ebb3b57257948b34f2dbb4ac123288"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0d5487339e4032c79e6f6abcc085208b7098f008","unresolved":false,"context_lines":[{"line_number":390,"context_line":"            success \u003d True"},{"line_number":391,"context_line":"        except Exception:"},{"line_number":392,"context_line":"            pass"},{"line_number":393,"context_line":"        self.assertTrue(success)"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"class SqlCatalog(SqlTests, test_backend.CatalogTests):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F855s%3D","line":393,"updated":"2013-12-18 23:49:00.000000000","message":"I\u0027m not sure what this is doing... what\u0027s different between lines 387-393 and a one-line:\n\n tok.flush_expired_tokens(batch_size\u003d5)","commit_id":"f3d29b076156152a636efa4f2eef59202a1b301e"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"1865947275060105d0e4c71c4caf7908c44a2908","unresolved":false,"context_lines":[{"line_number":390,"context_line":"            success \u003d True"},{"line_number":391,"context_line":"        except Exception:"},{"line_number":392,"context_line":"            pass"},{"line_number":393,"context_line":"        self.assertTrue(success)"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"class SqlCatalog(SqlTests, test_backend.CatalogTests):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAT3%2F%2FvX4%3D","line":393,"in_reply_to":"AAAATn%2F855s%3D","updated":"2014-01-02 16:14:34.000000000","message":"Just habit, I guess.  Some static code analysis tools for other languages frown on unit tests that don\u0027t have any assertions in them.  I have changed it to the simplified version.","commit_id":"f3d29b076156152a636efa4f2eef59202a1b301e"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0ea2217fbccf51a0cbd2a57b1aaa933355585521","unresolved":false,"context_lines":[{"line_number":393,"context_line":"        # are tested."},{"line_number":394,"context_line":"        tok.token_flush_batch_size(\u0027sqlite\u0027).AndReturn(1)"},{"line_number":395,"context_line":"        self.mox.ReplayAll()"},{"line_number":396,"context_line":"        tok.flush_expired_tokens()"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    def test_token_flush_batch_size(self):"},{"line_number":399,"context_line":"        tok \u003d token_sql.Token()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2F7Y8%3D","line":396,"updated":"2014-01-06 17:15:09.000000000","message":"should we have a test that mocks up db2 dialect and makes sure that it loops properly?","commit_id":"ef03c7b8478cfe6ae8e8013246f50a40cafad2ff"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"b325fd61e373a94d393063276a8d1a5c5ff9b98a","unresolved":false,"context_lines":[{"line_number":393,"context_line":"        # are tested."},{"line_number":394,"context_line":"        tok.token_flush_batch_size(\u0027sqlite\u0027).AndReturn(1)"},{"line_number":395,"context_line":"        self.mox.ReplayAll()"},{"line_number":396,"context_line":"        tok.flush_expired_tokens()"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    def test_token_flush_batch_size(self):"},{"line_number":399,"context_line":"        tok \u003d token_sql.Token()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2F7Io%3D","line":396,"in_reply_to":"AAAAUH%2F%2F7Y8%3D","updated":"2014-01-06 18:38:33.000000000","message":"As I point out in the comments, mocking sqlalchemy does not appear to work, so I don\u0027t know how looping could be tested.","commit_id":"ef03c7b8478cfe6ae8e8013246f50a40cafad2ff"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0ea2217fbccf51a0cbd2a57b1aaa933355585521","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        db2_batch \u003d tok.token_flush_batch_size(\u0027ibm_db_sa\u0027)"},{"line_number":401,"context_line":"        self.assertEqual(db2_batch, 100)"},{"line_number":402,"context_line":"        sqlite_batch \u003d tok.token_flush_batch_size(\u0027sqlite\u0027)"},{"line_number":403,"context_line":"        self.assertEqual(sqlite_batch, 0)"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"class SqlCatalog(SqlTests, test_backend.CatalogTests):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2F7ZM%3D","line":403,"updated":"2014-01-06 17:15:09.000000000","message":"suggest split into separate test functions.","commit_id":"ef03c7b8478cfe6ae8e8013246f50a40cafad2ff"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"b325fd61e373a94d393063276a8d1a5c5ff9b98a","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        db2_batch \u003d tok.token_flush_batch_size(\u0027ibm_db_sa\u0027)"},{"line_number":401,"context_line":"        self.assertEqual(db2_batch, 100)"},{"line_number":402,"context_line":"        sqlite_batch \u003d tok.token_flush_batch_size(\u0027sqlite\u0027)"},{"line_number":403,"context_line":"        self.assertEqual(sqlite_batch, 0)"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"class SqlCatalog(SqlTests, test_backend.CatalogTests):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2F7Dc%3D","line":403,"in_reply_to":"AAAAUH%2F%2F7ZM%3D","updated":"2014-01-06 18:38:33.000000000","message":"Done","commit_id":"ef03c7b8478cfe6ae8e8013246f50a40cafad2ff"}],"keystone/token/backends/sql.py":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"e6be664ce8f81dcfb20485931faba27364f30d77","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        dialect \u003d session.bind.dialect.name"},{"line_number":199,"context_line":"        if dialect \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":200,"context_line":"            sql \u003d ((\u0027DELETE FROM %(table)s WHERE ID IN (SELECT ID FROM \u0027"},{"line_number":201,"context_line":"                    \u0027%(table)s WHERE EXPIRES \u003c ? FETCH FIRST 100 ROWS ONLY)\u0027) %"},{"line_number":202,"context_line":"                   {\u0027table\u0027: TokenModel.__tablename__})"},{"line_number":203,"context_line":"            while True:"},{"line_number":204,"context_line":"                result \u003d session.bind.execute(sql, (timeutils.utcnow(),))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BEDI%3D","line":201,"updated":"2013-12-02 22:30:45.000000000","message":"Can we use sqlalchemy to create this SQL statement?","commit_id":"569ac30823298203bba8782c6c8122a08dca38c2"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"e7beaf3fa762d42e9d1030180cb77c34fd11a9d8","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        dialect \u003d session.bind.dialect.name"},{"line_number":199,"context_line":"        if dialect \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":200,"context_line":"            sql \u003d ((\u0027DELETE FROM %(table)s WHERE ID IN (SELECT ID FROM \u0027"},{"line_number":201,"context_line":"                    \u0027%(table)s WHERE EXPIRES \u003c ? FETCH FIRST 100 ROWS ONLY)\u0027) %"},{"line_number":202,"context_line":"                   {\u0027table\u0027: TokenModel.__tablename__})"},{"line_number":203,"context_line":"            while True:"},{"line_number":204,"context_line":"                result \u003d session.bind.execute(sql, (timeutils.utcnow(),))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BAzA%3D","line":201,"in_reply_to":"AAAATn%2F%2BEDI%3D","updated":"2013-12-03 14:11:40.000000000","message":"That would have been my preference as well.  I attempted to use a subquery with query.yield_per(100), but that did not affect the generated SQL--from what I could tell in the SQLAlchemy code, it is used after the query has already been performed.  I could not find any other mechanism for limiting the number of results.","commit_id":"569ac30823298203bba8782c6c8122a08dca38c2"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d5b8d7eadf8d168f536e5df12e23f48046c9e8df","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        dialect \u003d session.bind.dialect.name"},{"line_number":199,"context_line":"        if dialect \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":200,"context_line":"            sql \u003d ((\u0027DELETE FROM %(table)s WHERE ID IN (SELECT ID FROM \u0027"},{"line_number":201,"context_line":"                    \u0027%(table)s WHERE EXPIRES \u003c ? FETCH FIRST 100 ROWS ONLY)\u0027) %"},{"line_number":202,"context_line":"                   {\u0027table\u0027: TokenModel.__tablename__})"},{"line_number":203,"context_line":"            while True:"},{"line_number":204,"context_line":"                result \u003d session.bind.execute(sql, (timeutils.utcnow(),))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F9%2F7M%3D","line":201,"updated":"2013-12-03 16:35:33.000000000","message":"does this have to be 100 or can this be something that is configurable, with 100 being the max?\n\nOr would it be beneficial to have this as a config option?","commit_id":"9a0685d2012c3b17c0295097acb21a833d407939"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"203bf6133039cb390a34ee6003910998c96285e0","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        dialect \u003d session.bind.dialect.name"},{"line_number":199,"context_line":"        if dialect \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":200,"context_line":"            sql \u003d ((\u0027DELETE FROM %(table)s WHERE ID IN (SELECT ID FROM \u0027"},{"line_number":201,"context_line":"                    \u0027%(table)s WHERE EXPIRES \u003c ? FETCH FIRST 100 ROWS ONLY)\u0027) %"},{"line_number":202,"context_line":"                   {\u0027table\u0027: TokenModel.__tablename__})"},{"line_number":203,"context_line":"            while True:"},{"line_number":204,"context_line":"                result \u003d session.bind.execute(sql, (timeutils.utcnow(),))"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F9kDw%3D","line":201,"in_reply_to":"AAAATn%2F9%2F7M%3D","updated":"2013-12-10 07:39:23.000000000","message":"This might be beneficial for excessively large innodb token tables to help limit gap locking issues on the delete, though I\u0027d need to defer to someone more versed in MySQL to gauge benefit.\n\nI do like the concept of making this a tunable option if it extends beyond db2 or there could be a reason to have a different value than 100.  Why was the magic \u0027100\u0027 chosen?\n\nCan this be done with SQLAlchemy semantics instead of RAW sql?","commit_id":"9a0685d2012c3b17c0295097acb21a833d407939"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"046c5f4ef74ec27c29046e541199dfbe87a0e07d","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            # This functionality is limited to DB2, because"},{"line_number":202,"context_line":"            # it is necessary to prevent the tranaction log"},{"line_number":203,"context_line":"            # from filling up, while several, if not all,"},{"line_number":204,"context_line":"            # versions of MySQL do not support update"},{"line_number":205,"context_line":"            # queries with LIMIT subqueries."},{"line_number":206,"context_line":"            query \u003d session.query(TokenModel.id)"},{"line_number":207,"context_line":"            query \u003d query.filter(TokenModel.expires \u003c timeutils.utcnow())"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9VkI%3D","line":204,"updated":"2013-12-12 14:43:15.000000000","message":"what about postgresql?","commit_id":"2fa27838e0018d74347205f71f8a2f5f4ceb90f5"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"0d12e954a4635e0aaef96471057789b54384a917","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            # This functionality is limited to DB2, because"},{"line_number":202,"context_line":"            # it is necessary to prevent the tranaction log"},{"line_number":203,"context_line":"            # from filling up, while several, if not all,"},{"line_number":204,"context_line":"            # versions of MySQL do not support update"},{"line_number":205,"context_line":"            # queries with LIMIT subqueries."},{"line_number":206,"context_line":"            query \u003d session.query(TokenModel.id)"},{"line_number":207,"context_line":"            query \u003d query.filter(TokenModel.expires \u003c timeutils.utcnow())"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9VAk%3D","line":204,"in_reply_to":"AAAATn%2F9VkI%3D","updated":"2013-12-12 16:24:28.000000000","message":"This is included for DB2, because it has been shown to be necessary.  I\u0027m thinking that if it later turns out that the same is true for postgresql or any other DB, that can be addressed in a subsequent change or subsequent changes.  I don\u0027t see a need to have postgresql or any other DB delete tokens in small batches; there is no inherent advantage in doing so that applies to all DB implementations, as far as I know.  Since it has already been shown to not work for all DBs, it seems prudent to enable this only in cases where it is known to be necessary and involving only one DB implementation at a time, instead of risking unwittingly breaking something.","commit_id":"2fa27838e0018d74347205f71f8a2f5f4ceb90f5"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0d5487339e4032c79e6f6abcc085208b7098f008","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        session \u003d self.get_session()"},{"line_number":198,"context_line":"        dialect \u003d session.bind.dialect.name"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if dialect \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":201,"context_line":"            # This functionality is limited to DB2, because"},{"line_number":202,"context_line":"            # it is necessary to prevent the tranaction log"},{"line_number":203,"context_line":"            # from filling up, whereas at least some of the"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F856I%3D","line":200,"updated":"2013-12-18 23:49:00.000000000","message":"this should be \"dialect \u003d\u003d \u0027ibm_db_sa\u0027 and batch_size \u003d\u003d 0\" ? since if they passed in a batch_size then we want to use that rather than DB2\u0027s default?\n\n(should have a unit test for this)","commit_id":"f3d29b076156152a636efa4f2eef59202a1b301e"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"1865947275060105d0e4c71c4caf7908c44a2908","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        session \u003d self.get_session()"},{"line_number":198,"context_line":"        dialect \u003d session.bind.dialect.name"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if dialect \u003d\u003d \u0027ibm_db_sa\u0027:"},{"line_number":201,"context_line":"            # This functionality is limited to DB2, because"},{"line_number":202,"context_line":"            # it is necessary to prevent the tranaction log"},{"line_number":203,"context_line":"            # from filling up, whereas at least some of the"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAT3%2F%2FvWk%3D","line":200,"in_reply_to":"AAAATn%2F856I%3D","updated":"2014-01-02 16:14:34.000000000","message":"The thinking was that batch_size would only ever be specified during test, since the other back ends do not have method signatures that include this named parameter.  I have since altered the implementation in favor of an alternative mechanism for driving the batch size under test.","commit_id":"f3d29b076156152a636efa4f2eef59202a1b301e"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"fac8f6680a120a090ac6dd1490e72f2511d5b0f0","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            # queries with LIMIT subqueries nor do they appear"},{"line_number":204,"context_line":"            # to require the use of such queries when deleting"},{"line_number":205,"context_line":"            # large numbers of records at once."},{"line_number":206,"context_line":"            batch_size \u003d 100"},{"line_number":207,"context_line":"            # Limit of 100 is known to not fill a transaction log"},{"line_number":208,"context_line":"            # of default maximum size while not significantly"},{"line_number":209,"context_line":"            # impacting the performance of large token purges on"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2FwIU%3D","line":206,"updated":"2014-01-08 21:32:52.000000000","message":"this could also just be tunable via keystone.conf, regardless of dialect","commit_id":"5dc675f193a1dbaf5807416ceb2e808dd8e10f45"}]}
