)]}'
{"ceilometer/storage/impl_mongodb.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"cf02ed12dfb3817c977f0a9aaeb9e3bf3c654b84","unresolved":false,"context_lines":[{"line_number":461,"context_line":"            if ttl \u003d\u003d indexes[\u0027meter_ttl\u0027].get(\u0027expireAfterSeconds\u0027, -1):"},{"line_number":462,"context_line":"                return"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"            self.db.meter.drop_index(\u0027meter_ttl\u0027)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        self.db.meter.create_index("},{"line_number":467,"context_line":"            [(\u0027timestamp\u0027, pymongo.ASCENDING)],"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_514caf42","side":"PARENT","line":464,"updated":"2014-11-06 11:13:40.000000000","message":"-1: The note of sileht is reasonable, if user update ttl in config file, then restart service, the new ttl should be used.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"9d4ad612ef9be4434c210a258c8cb831a28fb80d","unresolved":false,"context_lines":[{"line_number":461,"context_line":"            if ttl \u003d\u003d indexes[\u0027meter_ttl\u0027].get(\u0027expireAfterSeconds\u0027, -1):"},{"line_number":462,"context_line":"                return"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"            self.db.meter.drop_index(\u0027meter_ttl\u0027)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        self.db.meter.create_index("},{"line_number":467,"context_line":"            [(\u0027timestamp\u0027, pymongo.ASCENDING)],"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_b4ba2108","side":"PARENT","line":464,"in_reply_to":"7a8c0949_514caf42","updated":"2014-11-06 12:02:28.000000000","message":"Please take a look at line 421, ttl param will be modified with \u0027collMod\u0027 command not with ensure_index. Also this case is checked in tests.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"1c0493d4a68a72716e017a06148314ead29aea88","unresolved":false,"context_lines":[{"line_number":461,"context_line":"            if ttl \u003d\u003d indexes[\u0027meter_ttl\u0027].get(\u0027expireAfterSeconds\u0027, -1):"},{"line_number":462,"context_line":"                return"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"            self.db.meter.drop_index(\u0027meter_ttl\u0027)"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        self.db.meter.create_index("},{"line_number":467,"context_line":"            [(\u0027timestamp\u0027, pymongo.ASCENDING)],"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_a78cb180","side":"PARENT","line":464,"in_reply_to":"7a8c0949_b4ba2108","updated":"2014-11-06 12:52:21.000000000","message":"yes, you\u0027re right, thanks","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"cf02ed12dfb3817c977f0a9aaeb9e3bf3c654b84","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        record[\u0027recorded_at\u0027] \u003d timeutils.utcnow()"},{"line_number":536,"context_line":"        self.db.meter.insert(record)"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    def clear_expired_metering_data(self, ttl):"},{"line_number":539,"context_line":"        \"\"\"Clear expired data from the backend storage system."},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"        Clearing occurs according to the time-to-live."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_d1389fa2","side":"PARENT","line":538,"updated":"2014-11-06 11:13:40.000000000","message":"-1: This method should not be removed, otherwise, user will get not  implemented error\n\nI suggest just remove the method body, or log a message: \"expired data has been removed by ttl feature\", or something else","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"b39fcdaaf3a560e2bfffeba86e8afeb4c701339c","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        record[\u0027recorded_at\u0027] \u003d timeutils.utcnow()"},{"line_number":536,"context_line":"        self.db.meter.insert(record)"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    def clear_expired_metering_data(self, ttl):"},{"line_number":539,"context_line":"        \"\"\"Clear expired data from the backend storage system."},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"        Clearing occurs according to the time-to-live."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_6ad7f0bf","side":"PARENT","line":538,"in_reply_to":"7a8c0949_c7bb7de3","updated":"2014-11-06 13:37:56.000000000","message":"Two vs one :))\n\nWill improve in new cr.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"9d4ad612ef9be4434c210a258c8cb831a28fb80d","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        record[\u0027recorded_at\u0027] \u003d timeutils.utcnow()"},{"line_number":536,"context_line":"        self.db.meter.insert(record)"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    def clear_expired_metering_data(self, ttl):"},{"line_number":539,"context_line":"        \"\"\"Clear expired data from the backend storage system."},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"        Clearing occurs according to the time-to-live."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_f4be69d3","side":"PARENT","line":538,"in_reply_to":"7a8c0949_d1389fa2","updated":"2014-11-06 12:02:28.000000000","message":"We do not need to call that method at all, because all expired data are cleared in background. I am not sure that we need additional message instead of NotImplementedError, but may be you are right with it.\n\nWill wait till somebody else look thru the patch.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"74eb1560a6410d4574b9a2ad2d1f384b40734d94","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        record[\u0027recorded_at\u0027] \u003d timeutils.utcnow()"},{"line_number":536,"context_line":"        self.db.meter.insert(record)"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    def clear_expired_metering_data(self, ttl):"},{"line_number":539,"context_line":"        \"\"\"Clear expired data from the backend storage system."},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"        Clearing occurs according to the time-to-live."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_c7bb7de3","side":"PARENT","line":538,"in_reply_to":"7a8c0949_f4be69d3","updated":"2014-11-06 13:10:15.000000000","message":"Yes, we need to implements this method as a noop.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"1c0493d4a68a72716e017a06148314ead29aea88","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        record[\u0027recorded_at\u0027] \u003d timeutils.utcnow()"},{"line_number":536,"context_line":"        self.db.meter.insert(record)"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    def clear_expired_metering_data(self, ttl):"},{"line_number":539,"context_line":"        \"\"\"Clear expired data from the backend storage system."},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"        Clearing occurs according to the time-to-live."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_1414d54c","side":"PARENT","line":538,"in_reply_to":"7a8c0949_f4be69d3","updated":"2014-11-06 12:52:21.000000000","message":"we expose ceilometer-expirer command no matter what backend is deployed, there is a chance that it will be executed, cloud operator will get a not implemented error instead of a exit 0 if we remove this method.\n\nI think if we do implement such feature, there is no need to raise an error.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"8bf1b9023784ac4939a9c49f96d3dbccd781ec35","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        Clearing occurs with native MongoDB time-to-live feature."},{"line_number":541,"context_line":"        \"\"\""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"        LOG.debug(_(\"Clearing expired metering data is based on native \""},{"line_number":544,"context_line":"                    \"MongoDB time to live feature and going in background.\"))"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8c0949_f883b701","line":542,"updated":"2014-11-06 16:01:19.000000000","message":"tiny nit: remove blank line 542?","commit_id":"47e8473b2c76e749c7a6602906379868ffbb4f62"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"a548f94ff51b6daeef880d22771fdc2a52f0acb5","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        Clearing occurs with native MongoDB time-to-live feature."},{"line_number":541,"context_line":"        \"\"\""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"        LOG.debug(_(\"Clearing expired metering data is based on native \""},{"line_number":544,"context_line":"                    \"MongoDB time to live feature and going in background.\"))"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8c0949_be7af7ee","line":542,"in_reply_to":"7a8c0949_f883b701","updated":"2014-11-06 17:06:43.000000000","message":"yep, sure. thanks.","commit_id":"47e8473b2c76e749c7a6602906379868ffbb4f62"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"b2cfb9fc0ab1e62b9fce59e119bad0f0edad8766","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        ttl \u003d cfg.CONF.database.time_to_live"},{"line_number":414,"context_line":"        indexes \u003d coll.index_information()"},{"line_number":415,"context_line":"        if ttl \u003c\u003d 0:"},{"line_number":416,"context_line":"            if ttl_index_name in indexes:"},{"line_number":417,"context_line":"                coll.drop_index(ttl_index_name)"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_81653c47","line":416,"updated":"2014-11-10 12:13:34.000000000","message":"I\u0027m not an expert in Mongo but the following code looks like you \"expire\" data manually, am I right? You\u0027re checking that ttl\u003c\u003d0 and drop index without any \"expire\" process handled by Mongo? Is it secure?","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"0fd3a0bfa4989ed130e2fef877a0b7e77b909afd","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        ttl \u003d cfg.CONF.database.time_to_live"},{"line_number":414,"context_line":"        indexes \u003d coll.index_information()"},{"line_number":415,"context_line":"        if ttl \u003c\u003d 0:"},{"line_number":416,"context_line":"            if ttl_index_name in indexes:"},{"line_number":417,"context_line":"                coll.drop_index(ttl_index_name)"},{"line_number":418,"context_line":"            return"},{"line_number":419,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_2a529ddd","line":416,"in_reply_to":"5a890539_81653c47","updated":"2014-11-10 13:50:17.000000000","message":"Here we check by hands that new value of ttl is gt 0 otherwise we have to remove index to store data forever that is the case when ttl lt 0.","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":13189,"name":"Hang Liu","email":"hangliu@cn.ibm.com","username":"hangliu"},"change_message_id":"8bff38ec0a978e9a1364d803048171bae7096184","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        # update or ensure time_to_live index"},{"line_number":467,"context_line":"        self.update_ttl(\u0027meter_ttl\u0027, \u0027timestamp\u0027, self.db.meter)"},{"line_number":468,"context_line":"        self.update_ttl(\u0027resource_ttl\u0027, \u0027last_sample_timestamp\u0027,"},{"line_number":469,"context_line":"                        self.db.resource)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def clear(self):"},{"line_number":472,"context_line":"        self.conn.drop_database(self.db.name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_3b9cb969","line":469,"updated":"2014-11-10 10:46:49.000000000","message":"In my understanding, resource can be removed only if it has not be used by the sample in \u0027meter\u0027 table. But this implementation seem that all resource would be removed once it has been expired. If so, it may be incorrect.","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"41b454b58c261499f5f925b086ed83eba04de312","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        # update or ensure time_to_live index"},{"line_number":467,"context_line":"        self.update_ttl(\u0027meter_ttl\u0027, \u0027timestamp\u0027, self.db.meter)"},{"line_number":468,"context_line":"        self.update_ttl(\u0027resource_ttl\u0027, \u0027last_sample_timestamp\u0027,"},{"line_number":469,"context_line":"                        self.db.resource)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def clear(self):"},{"line_number":472,"context_line":"        self.conn.drop_database(self.db.name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_f0ad5aea","line":469,"in_reply_to":"5a890539_244e56c2","updated":"2014-11-14 15:57:38.000000000","message":"@idegtiarov: note that we only started setting the last_sample_timestamp on the resource in:\n\n  https://github.com/openstack/ceilometer/commit/7b4d4d44\n\n(prior to that we calculated it from the meter collection, at extreme expense)\n\nBut I think that\u0027s OK, any older resources with last_sample_timestamp unset as they haven\u0027t seen any new samples since that change landed, should be expired in any case.","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":13189,"name":"Hang Liu","email":"hangliu@cn.ibm.com","username":"hangliu"},"change_message_id":"fe3dbc96fe3ee6e25f60c8b70aab0b00cdfe27d9","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        # update or ensure time_to_live index"},{"line_number":467,"context_line":"        self.update_ttl(\u0027meter_ttl\u0027, \u0027timestamp\u0027, self.db.meter)"},{"line_number":468,"context_line":"        self.update_ttl(\u0027resource_ttl\u0027, \u0027last_sample_timestamp\u0027,"},{"line_number":469,"context_line":"                        self.db.resource)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def clear(self):"},{"line_number":472,"context_line":"        self.conn.drop_database(self.db.name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_0472357c","line":469,"in_reply_to":"5a890539_244e56c2","updated":"2014-11-10 15:34:36.000000000","message":"Yes, you are right. Here is a assumption that ttl should be longer than sample rate, but that should always be true in the real application scenario.","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"b2cfb9fc0ab1e62b9fce59e119bad0f0edad8766","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        # update or ensure time_to_live index"},{"line_number":467,"context_line":"        self.update_ttl(\u0027meter_ttl\u0027, \u0027timestamp\u0027, self.db.meter)"},{"line_number":468,"context_line":"        self.update_ttl(\u0027resource_ttl\u0027, \u0027last_sample_timestamp\u0027,"},{"line_number":469,"context_line":"                        self.db.resource)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def clear(self):"},{"line_number":472,"context_line":"        self.conn.drop_database(self.db.name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_61bcd06d","line":469,"in_reply_to":"5a890539_3b9cb969","updated":"2014-11-10 12:13:34.000000000","message":"As for me, I think that this kind of problems should be managed by Mongo\u0027s expirer. Looking for answers here http://docs.mongodb.org/manual/tutorial/expire-data/ while we are waiting for Igor\u0027s response :)","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"0fd3a0bfa4989ed130e2fef877a0b7e77b909afd","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        # update or ensure time_to_live index"},{"line_number":467,"context_line":"        self.update_ttl(\u0027meter_ttl\u0027, \u0027timestamp\u0027, self.db.meter)"},{"line_number":468,"context_line":"        self.update_ttl(\u0027resource_ttl\u0027, \u0027last_sample_timestamp\u0027,"},{"line_number":469,"context_line":"                        self.db.resource)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def clear(self):"},{"line_number":472,"context_line":"        self.conn.drop_database(self.db.name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_244e56c2","line":469,"in_reply_to":"5a890539_61bcd06d","updated":"2014-11-10 13:50:17.000000000","message":"Actually while receiving new samples from certain resource we update last_sample_timestamp in record_metering_data (L508) so resource will be removed only when that field will expired and it is the same as there are no any meters related to that resource.","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"}],"ceilometer/tests/storage/test_storage_scenarios.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"cf02ed12dfb3817c977f0a9aaeb9e3bf3c654b84","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        results \u003d list(self.conn.get_samples(f))"},{"line_number":625,"context_line":"        self.assertEqual(len(results), 2)"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"    @tests_db.run_with(\u0027sqlite\u0027, \u0027hbase\u0027, \u0027db2\u0027)"},{"line_number":628,"context_line":"    def test_clear_metering_data(self):"},{"line_number":629,"context_line":"        # NOTE(jd) Override this test in MongoDB because our code doesn\u0027t clear"},{"line_number":630,"context_line":"        # the collections, this is handled by MongoDB TTL feature."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_f1e11bd1","side":"PARENT","line":627,"updated":"2014-11-06 11:13:40.000000000","message":"I\u0027m not sure about if it is ok to remove this. TTL is a background feature which cannot guarantee that it will be executed right after the Test.setup, (Correct me if I\u0027m wrong)\n\nAnd since we have no clear_expired_metering_data method (or it is empty), such test is not needed. IMHO, unittest code should be quick and efficient, so the MongoTimeToLiveTest is enough, because if we set as MongoDB required, but it doesn\u0027t work as promised, then that is its issue.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"1c0493d4a68a72716e017a06148314ead29aea88","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        results \u003d list(self.conn.get_samples(f))"},{"line_number":625,"context_line":"        self.assertEqual(len(results), 2)"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"    @tests_db.run_with(\u0027sqlite\u0027, \u0027hbase\u0027, \u0027db2\u0027)"},{"line_number":628,"context_line":"    def test_clear_metering_data(self):"},{"line_number":629,"context_line":"        # NOTE(jd) Override this test in MongoDB because our code doesn\u0027t clear"},{"line_number":630,"context_line":"        # the collections, this is handled by MongoDB TTL feature."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_876df59a","side":"PARENT","line":627,"in_reply_to":"7a8c0949_94ae0584","updated":"2014-11-06 12:52:21.000000000","message":"If we decide to raise NotImplementedError for mongodb case, then here the run_with can be removed, let wait for other\u0027s opinion. I still do no want to see an error.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"9d4ad612ef9be4434c210a258c8cb831a28fb80d","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        results \u003d list(self.conn.get_samples(f))"},{"line_number":625,"context_line":"        self.assertEqual(len(results), 2)"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"    @tests_db.run_with(\u0027sqlite\u0027, \u0027hbase\u0027, \u0027db2\u0027)"},{"line_number":628,"context_line":"    def test_clear_metering_data(self):"},{"line_number":629,"context_line":"        # NOTE(jd) Override this test in MongoDB because our code doesn\u0027t clear"},{"line_number":630,"context_line":"        # the collections, this is handled by MongoDB TTL feature."}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_94ae0584","side":"PARENT","line":627,"in_reply_to":"7a8c0949_f1e11bd1","updated":"2014-11-06 12:02:28.000000000","message":"Now only \u0027sqlite\u0027 has clear_expired_metering_data, so we do not need to emphasize mongodb. If tests falls with NotImplementError they don\u0027t vote.","commit_id":"f856d3c915b738a64bce14967ba8114fe923c1af"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"cf02ed12dfb3817c977f0a9aaeb9e3bf3c654b84","unresolved":false,"context_lines":[{"line_number":3190,"context_line":"        self.assertEqual(5, self.conn.db.meter.index_information()"},{"line_number":3191,"context_line":"                         [\u0027meter_ttl\u0027][\u0027expireAfterSeconds\u0027])"},{"line_number":3192,"context_line":""},{"line_number":3193,"context_line":"    def test_modification_of_index(self):"},{"line_number":3194,"context_line":"        cfg.CONF.set_override(\u0027time_to_live\u0027, 15, group\u003d\u0027database\u0027)"},{"line_number":3195,"context_line":"        self.conn.upgrade()"},{"line_number":3196,"context_line":"        self.assertEqual(15, self.conn.db.resource.index_information()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_51e82fe2","line":3193,"updated":"2014-11-06 11:13:40.000000000","message":"I\u0027m not quite understand what the difference between the two tests.\n\nare you want to set ttl to 5s, then set ttl to 15s, then check if new ttl is 15s? If yes, I think current code cannot verify such thing.","commit_id":"a188468d5f5a06c83223aa4b179642b4143828eb"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"9d4ad612ef9be4434c210a258c8cb831a28fb80d","unresolved":false,"context_lines":[{"line_number":3190,"context_line":"        self.assertEqual(5, self.conn.db.meter.index_information()"},{"line_number":3191,"context_line":"                         [\u0027meter_ttl\u0027][\u0027expireAfterSeconds\u0027])"},{"line_number":3192,"context_line":""},{"line_number":3193,"context_line":"    def test_modification_of_index(self):"},{"line_number":3194,"context_line":"        cfg.CONF.set_override(\u0027time_to_live\u0027, 15, group\u003d\u0027database\u0027)"},{"line_number":3195,"context_line":"        self.conn.upgrade()"},{"line_number":3196,"context_line":"        self.assertEqual(15, self.conn.db.resource.index_information()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_54f9fd7e","line":3193,"in_reply_to":"7a8c0949_51e82fe2","updated":"2014-11-06 12:02:28.000000000","message":"From the very beginning time_to_live param is default and equal -1, so there are no any ttl indexes. First test checks correct work of ensure_index, second test checks correct work of \u0027collMod\u0027 command that modifies existed indexes.","commit_id":"a188468d5f5a06c83223aa4b179642b4143828eb"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"1c0493d4a68a72716e017a06148314ead29aea88","unresolved":false,"context_lines":[{"line_number":3190,"context_line":"        self.assertEqual(5, self.conn.db.meter.index_information()"},{"line_number":3191,"context_line":"                         [\u0027meter_ttl\u0027][\u0027expireAfterSeconds\u0027])"},{"line_number":3192,"context_line":""},{"line_number":3193,"context_line":"    def test_modification_of_index(self):"},{"line_number":3194,"context_line":"        cfg.CONF.set_override(\u0027time_to_live\u0027, 15, group\u003d\u0027database\u0027)"},{"line_number":3195,"context_line":"        self.conn.upgrade()"},{"line_number":3196,"context_line":"        self.assertEqual(15, self.conn.db.resource.index_information()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_e716b9a6","line":3193,"in_reply_to":"7a8c0949_54f9fd7e","updated":"2014-11-06 12:52:21.000000000","message":"I think the test code will clear database when teardown and upgrade database when setup, so there is no such second test. They are just exactly same, IIUC.\n\nIdeally, test code should be independently, because we cannot guarantee the order. I think we are on the right way.\n\nIf I\u0027m wrong, then the two test code are very close except the ttl, if we do want it, we should avoid duplicate code.","commit_id":"a188468d5f5a06c83223aa4b179642b4143828eb"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"b39fcdaaf3a560e2bfffeba86e8afeb4c701339c","unresolved":false,"context_lines":[{"line_number":3190,"context_line":"        self.assertEqual(5, self.conn.db.meter.index_information()"},{"line_number":3191,"context_line":"                         [\u0027meter_ttl\u0027][\u0027expireAfterSeconds\u0027])"},{"line_number":3192,"context_line":""},{"line_number":3193,"context_line":"    def test_modification_of_index(self):"},{"line_number":3194,"context_line":"        cfg.CONF.set_override(\u0027time_to_live\u0027, 15, group\u003d\u0027database\u0027)"},{"line_number":3195,"context_line":"        self.conn.upgrade()"},{"line_number":3196,"context_line":"        self.assertEqual(15, self.conn.db.resource.index_information()"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8c0949_ea7da0e8","line":3193,"in_reply_to":"7a8c0949_e716b9a6","updated":"2014-11-06 13:37:56.000000000","message":"You are definitely right here, will improve in new patch.","commit_id":"a188468d5f5a06c83223aa4b179642b4143828eb"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"41b454b58c261499f5f925b086ed83eba04de312","unresolved":false,"context_lines":[{"line_number":3210,"context_line":"        self.assertEqual(15, self.conn.db.resource.index_information()"},{"line_number":3211,"context_line":"                         [\u0027resource_ttl\u0027][\u0027expireAfterSeconds\u0027])"},{"line_number":3212,"context_line":"        self.assertEqual(15, self.conn.db.meter.index_information()"},{"line_number":3213,"context_line":"                         [\u0027meter_ttl\u0027][\u0027expireAfterSeconds\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_b044b21b","line":3213,"updated":"2014-11-14 15:57:38.000000000","message":"Would it be good to also have a test to assert that the expiry actually occurs? e.g.\n\n* set configured TTL low to say 2s\n* insert a couple samples\n* ensure expected data exists in the meter and resource collections\n* sleep(2.5)\n* ensure data no longer exists","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"3fb1bbe4b33ae7a2a465d166bdf5fb6a72a441e9","unresolved":false,"context_lines":[{"line_number":3210,"context_line":"        self.assertEqual(15, self.conn.db.resource.index_information()"},{"line_number":3211,"context_line":"                         [\u0027resource_ttl\u0027][\u0027expireAfterSeconds\u0027])"},{"line_number":3212,"context_line":"        self.assertEqual(15, self.conn.db.meter.index_information()"},{"line_number":3213,"context_line":"                         [\u0027meter_ttl\u0027][\u0027expireAfterSeconds\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_41839dcb","line":3213,"in_reply_to":"5a890539_6e2df4fd","updated":"2014-11-17 10:44:19.000000000","message":"Thank you ZhiQiang! You have took words from my mouth. If we are going to implement such kind of the tests we have to sleep more then a 60 sec. for each test, I think it is too long.","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"3ddea45d853d4f5a46b50e82fca0bcfa8161ce8f","unresolved":false,"context_lines":[{"line_number":3210,"context_line":"        self.assertEqual(15, self.conn.db.resource.index_information()"},{"line_number":3211,"context_line":"                         [\u0027resource_ttl\u0027][\u0027expireAfterSeconds\u0027])"},{"line_number":3212,"context_line":"        self.assertEqual(15, self.conn.db.meter.index_information()"},{"line_number":3213,"context_line":"                         [\u0027meter_ttl\u0027][\u0027expireAfterSeconds\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_6e2df4fd","line":3213,"in_reply_to":"5a890539_b044b21b","updated":"2014-11-16 05:40:40.000000000","message":"@Eoghan Glynn\n\nMongoDB TTL is something like Garbage Collect in Java/Python, \"\"\"The background task that removes expired documents runs every 60 seconds. As a result, documents may remain in a collection after they expire but before the background task runs or completes.\"\"\" -- http://docs.mongodb.org/manual/core/index-ttl/#considerations\n\nSo I think the test you have mentioned is not reliable.","commit_id":"8dec02ffdedfe2772e27ce687990c958d7566775"}]}
