)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"921dcfdc6c2db7b94983625ac31ea520d3eceffc","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"A TODO is removed which suggested that the object_count might be"},{"line_number":24,"context_line":"refreshed before processing each found range upper. This does not seem"},{"line_number":25,"context_line":"necessary because find_shard_ranges() is called after container has"},{"line_number":26,"context_line":"moved to SHARDING state such that the db being scanned is effectively"},{"line_number":27,"context_line":"\u0027read-only\u0027."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: Ib74e2efc4e854a2dd95101777bca114a7865fba7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bf659307_3c909d43","line":26,"range":{"start_line":25,"start_character":54,"end_line":26,"end_character":23},"updated":"2018-03-27 21:31:45.000000000","message":"So, db_state not own_shard_range.state, yeah?","commit_id":"5d762e5c836d990de1134545695bf391fc647115"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"923ae184d243248b92f6d1b83bce227f71576950","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"A TODO is removed which suggested that the object_count might be"},{"line_number":24,"context_line":"refreshed before processing each found range upper. This does not seem"},{"line_number":25,"context_line":"necessary because find_shard_ranges() is called after container has"},{"line_number":26,"context_line":"moved to SHARDING state such that the db being scanned is effectively"},{"line_number":27,"context_line":"\u0027read-only\u0027."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: Ib74e2efc4e854a2dd95101777bca114a7865fba7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"bf659307_a546d04e","line":26,"range":{"start_line":25,"start_character":54,"end_line":26,"end_character":23},"in_reply_to":"bf659307_3c909d43","updated":"2018-03-27 23:40:16.000000000","message":"yes","commit_id":"5d762e5c836d990de1134545695bf391fc647115"}],"swift/container/backend.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"921dcfdc6c2db7b94983625ac31ea520d3eceffc","unresolved":false,"context_lines":[{"line_number":2047,"context_line":"        sub_broker \u003d self.get_brokers()[0]"},{"line_number":2048,"context_line":"        index \u003d len(existing_ranges)"},{"line_number":2049,"context_line":"        while limit \u003c 0 or len(found_ranges) \u003c limit:"},{"line_number":2050,"context_line":"            if progress + shard_size \u003e\u003d object_count:"},{"line_number":2051,"context_line":"                # next shard point is at or beyond final object name so don\u0027t"},{"line_number":2052,"context_line":"                # bother with db query"},{"line_number":2053,"context_line":"                next_shard_upper \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_9cec49f4","line":2050,"range":{"start_line":2050,"start_character":15,"end_line":2050,"end_character":23},"updated":"2018-03-27 21:31:45.000000000","message":"It weirds me out a little that we use this regardless of whether it\u0027s reliable or not, but I guess it should be OK -- shard_size should always be less than object_count, or we wouldn\u0027t be here, right?\n\nStill might be a little better to be explicit and say\n\n if progress_reliable and progress + shard_size \u003e\u003d object_count:","commit_id":"5d762e5c836d990de1134545695bf391fc647115"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"923ae184d243248b92f6d1b83bce227f71576950","unresolved":false,"context_lines":[{"line_number":2047,"context_line":"        sub_broker \u003d self.get_brokers()[0]"},{"line_number":2048,"context_line":"        index \u003d len(existing_ranges)"},{"line_number":2049,"context_line":"        while limit \u003c 0 or len(found_ranges) \u003c limit:"},{"line_number":2050,"context_line":"            if progress + shard_size \u003e\u003d object_count:"},{"line_number":2051,"context_line":"                # next shard point is at or beyond final object name so don\u0027t"},{"line_number":2052,"context_line":"                # bother with db query"},{"line_number":2053,"context_line":"                next_shard_upper \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_8564ece5","line":2050,"range":{"start_line":2050,"start_character":15,"end_line":2050,"end_character":23},"in_reply_to":"bf659307_9cec49f4","updated":"2018-03-27 23:40:16.000000000","message":"if progress_reliable is False then progress is zero so it is valid to use, and if 0 + shard_size \u003e\u003d object_count then it makes sense to skip the query","commit_id":"5d762e5c836d990de1134545695bf391fc647115"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"921dcfdc6c2db7b94983625ac31ea520d3eceffc","unresolved":false,"context_lines":[{"line_number":2054,"context_line":"            else:"},{"line_number":2055,"context_line":"                try:"},{"line_number":2056,"context_line":"                    next_shard_upper \u003d sub_broker._get_next_shard_range_upper("},{"line_number":2057,"context_line":"                        shard_size, last_shard_upper)"},{"line_number":2058,"context_line":"                except sqlite3.OperationalError as err:"},{"line_number":2059,"context_line":"                    self.logger.exception(\"Problem finding shard point: \", err)"},{"line_number":2060,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_bc958d42","line":2057,"updated":"2018-03-27 21:31:45.000000000","message":"I\u0027ve still got this nagging feeling that we should just *always call this*, even to find what we assume will be the last shard range, and have it start returning the number of objects found.","commit_id":"5d762e5c836d990de1134545695bf391fc647115"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"923ae184d243248b92f6d1b83bce227f71576950","unresolved":false,"context_lines":[{"line_number":2054,"context_line":"            else:"},{"line_number":2055,"context_line":"                try:"},{"line_number":2056,"context_line":"                    next_shard_upper \u003d sub_broker._get_next_shard_range_upper("},{"line_number":2057,"context_line":"                        shard_size, last_shard_upper)"},{"line_number":2058,"context_line":"                except sqlite3.OperationalError as err:"},{"line_number":2059,"context_line":"                    self.logger.exception(\"Problem finding shard point: \", err)"},{"line_number":2060,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_45d49420","line":2057,"in_reply_to":"bf659307_bc958d42","updated":"2018-03-27 23:40:16.000000000","message":"yeah, I do wonder if we\u0027ll burn review cycles on this vs no-one would notice if the optimisation wasn\u0027t there at all :/\n\nbut, IIRC the sql query in _get_next_shard_range_upper returns no row if the next upper is beyond max object name, so not sure how easy it is to get the true count of objects in last range","commit_id":"5d762e5c836d990de1134545695bf391fc647115"}]}
