)]}'
{"swift/common/db_replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":614,"context_line":"                                      failure_dev[\u0027device\u0027])"},{"line_number":615,"context_line":"                                     for failure_dev in nodes])"},{"line_number":616,"context_line":"            self.logger.increment(\u0027failures\u0027)"},{"line_number":617,"context_line":"            return False, responses"},{"line_number":618,"context_line":"        # The db is considered deleted if the delete_timestamp value is greater"},{"line_number":619,"context_line":"        # than the put_timestamp, and there are no objects."},{"line_number":620,"context_line":"        delete_timestamp \u003d Timestamp(info.get(\u0027delete_timestamp\u0027) or 0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_1235b9f7","line":617,"updated":"2018-03-19 22:20:33.000000000","message":"Here responses is empty, but the return value is False","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":624,"context_line":"            if self.report_up_to_date(info):"},{"line_number":625,"context_line":"                self.delete_db(broker)"},{"line_number":626,"context_line":"            self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":627,"context_line":"            return True, responses"},{"line_number":628,"context_line":"        failure_devs_info \u003d set()"},{"line_number":629,"context_line":"        nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":630,"context_line":"        local_dev \u003d None"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_b2396df3","line":627,"updated":"2018-03-19 22:20:33.000000000","message":"Here responses is empty, but the return value is True","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":676,"context_line":"            if not success:"},{"line_number":677,"context_line":"                failure_devs_info.add((node[\u0027replication_ip\u0027], node[\u0027device\u0027]))"},{"line_number":678,"context_line":"            self.logger.increment(\u0027successes\u0027 if success else \u0027failures\u0027)"},{"line_number":679,"context_line":"            responses.append(success)"},{"line_number":680,"context_line":"        try:"},{"line_number":681,"context_line":"            self._post_replicate_hook(broker, info, responses)"},{"line_number":682,"context_line":"        except (Exception, Timeout):"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_d23e61d9","line":679,"updated":"2018-03-19 22:20:33.000000000","message":"here\u0027s where we were already appending to responses","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":698,"context_line":""},{"line_number":699,"context_line":"        self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":700,"context_line":"        if shouldbehere:"},{"line_number":701,"context_line":"            responses.append(True)"},{"line_number":702,"context_line":"        return all(responses), responses"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"    def delete_db(self, broker):"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_0d2cb897","line":701,"updated":"2018-03-19 22:20:33.000000000","message":"assume successful replication with one self ;)","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"a150e5485cf71b437f05783417ed9d22451f4096","unresolved":false,"context_lines":[{"line_number":573,"context_line":"            is True if the method completed successfully, False otherwise."},{"line_number":574,"context_line":"            ``responses`` is a list of booleans each of which indicates the"},{"line_number":575,"context_line":"            success or not of replicating to a peer node if replication has"},{"line_number":576,"context_line":"            been attempted. ``responses`` may be empty; ``success`` is False"},{"line_number":577,"context_line":"            if any of ``responses`` is False."},{"line_number":578,"context_line":"        \"\"\""},{"line_number":579,"context_line":"        start_time \u003d now \u003d time.time()"},{"line_number":580,"context_line":"        self.logger.debug(\u0027Replicating db %s\u0027, object_file)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_1ec11081","line":577,"range":{"start_line":576,"start_character":56,"end_line":577,"end_character":44},"updated":"2018-03-27 20:55:13.000000000","message":"Do we really need `success` then? Why leave the ability to return something inconsistent with this statement? Can/should callers simply do\n\n responses and all(responses)\n\nthemselves?","commit_id":"b93ba3ffe5cd98c4c3aabc6ce01bd22fe8a92073"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d8d56ee1ff77a829cc5ca178254bc6c697e8738b","unresolved":false,"context_lines":[{"line_number":573,"context_line":"            is True if the method completed successfully, False otherwise."},{"line_number":574,"context_line":"            ``responses`` is a list of booleans each of which indicates the"},{"line_number":575,"context_line":"            success or not of replicating to a peer node if replication has"},{"line_number":576,"context_line":"            been attempted. ``responses`` may be empty; ``success`` is False"},{"line_number":577,"context_line":"            if any of ``responses`` is False."},{"line_number":578,"context_line":"        \"\"\""},{"line_number":579,"context_line":"        start_time \u003d now \u003d time.time()"},{"line_number":580,"context_line":"        self.logger.debug(\u0027Replicating db %s\u0027, object_file)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_ff6d3704","line":577,"range":{"start_line":576,"start_character":56,"end_line":577,"end_character":44},"in_reply_to":"bf659307_1ec11081","updated":"2018-03-27 22:23:39.000000000","message":"success can be True when there are NO responses\n\nis there a simpler interface? maybe I am missing it.","commit_id":"b93ba3ffe5cd98c4c3aabc6ce01bd22fe8a92073"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"a150e5485cf71b437f05783417ed9d22451f4096","unresolved":false,"context_lines":[{"line_number":624,"context_line":"            if self.report_up_to_date(info):"},{"line_number":625,"context_line":"                self.delete_db(broker)"},{"line_number":626,"context_line":"            self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":627,"context_line":"            return True, responses"},{"line_number":628,"context_line":"        failure_devs_info \u003d set()"},{"line_number":629,"context_line":"        nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":630,"context_line":"        local_dev \u003d None"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_1e6fd092","line":627,"updated":"2018-03-27 20:55:13.000000000","message":"Ah, ok... this complicates my logic above a bit... hmm...","commit_id":"b93ba3ffe5cd98c4c3aabc6ce01bd22fe8a92073"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d8d56ee1ff77a829cc5ca178254bc6c697e8738b","unresolved":false,"context_lines":[{"line_number":624,"context_line":"            if self.report_up_to_date(info):"},{"line_number":625,"context_line":"                self.delete_db(broker)"},{"line_number":626,"context_line":"            self.logger.timing_since(\u0027timing\u0027, start_time)"},{"line_number":627,"context_line":"            return True, responses"},{"line_number":628,"context_line":"        failure_devs_info \u003d set()"},{"line_number":629,"context_line":"        nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":630,"context_line":"        local_dev \u003d None"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_3f4def99","line":627,"in_reply_to":"bf659307_1e6fd092","updated":"2018-03-27 22:23:39.000000000","message":"yeah, this causes the weird interface :/","commit_id":"b93ba3ffe5cd98c4c3aabc6ce01bd22fe8a92073"}],"swift/container/sharder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # TODO: we need to be confident that replication succeeded before"},{"line_number":338,"context_line":"        # removing misplaced items from source - if not then just leave the"},{"line_number":339,"context_line":"        # misplaced items in source, but do not mark them as deleted, and"},{"line_number":340,"context_line":"        # leave for next cycle to try again"},{"line_number":341,"context_line":"        for dest_shard_range in brokers:"},{"line_number":342,"context_line":"            broker.remove_objects("},{"line_number":343,"context_line":"                str(dest_shard_range.lower), str(dest_shard_range.upper),"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_f277e507","line":340,"updated":"2018-03-19 22:20:33.000000000","message":"this seems related, but possibly planned for a follow up?","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cd9310d1b9861e5f0b56708909154e4da6d69e3d","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # TODO: we need to be confident that replication succeeded before"},{"line_number":338,"context_line":"        # removing misplaced items from source - if not then just leave the"},{"line_number":339,"context_line":"        # misplaced items in source, but do not mark them as deleted, and"},{"line_number":340,"context_line":"        # leave for next cycle to try again"},{"line_number":341,"context_line":"        for dest_shard_range in brokers:"},{"line_number":342,"context_line":"            broker.remove_objects("},{"line_number":343,"context_line":"                str(dest_shard_range.lower), str(dest_shard_range.upper),"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_8f18b275","line":340,"in_reply_to":"df7087c5_f277e507","updated":"2018-03-20 08:52:42.000000000","message":"yes, I am working my way through the various places where we currently close our eyes and hope for the best :P This will need similar changes except here we are less concerned about order, we just need to know that each range was sufficiently replicated before dropping the source objects.","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":765,"context_line":"            broker \u003d ContainerBroker(path, logger\u003dself.logger)"},{"line_number":766,"context_line":"            if sharding_enabled(broker):"},{"line_number":767,"context_line":"                try:"},{"line_number":768,"context_line":"                    self._process_broker(broker, node, part)"},{"line_number":769,"context_line":"                except Exception as err:"},{"line_number":770,"context_line":"                    self.logger.exception("},{"line_number":771,"context_line":"                        \u0027Unhandled exception while processing %s: %s\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_52725113","line":768,"updated":"2018-03-19 22:20:33.000000000","message":"should this be our main entry point for concurrency then?","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cd9310d1b9861e5f0b56708909154e4da6d69e3d","unresolved":false,"context_lines":[{"line_number":765,"context_line":"            broker \u003d ContainerBroker(path, logger\u003dself.logger)"},{"line_number":766,"context_line":"            if sharding_enabled(broker):"},{"line_number":767,"context_line":"                try:"},{"line_number":768,"context_line":"                    self._process_broker(broker, node, part)"},{"line_number":769,"context_line":"                except Exception as err:"},{"line_number":770,"context_line":"                    self.logger.exception("},{"line_number":771,"context_line":"                        \u0027Unhandled exception while processing %s: %s\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_4c1e2871","line":768,"in_reply_to":"df7087c5_52725113","updated":"2018-03-20 08:52:42.000000000","message":"+1","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":1164,"context_line":"                             new_broker.get_own_shard_range())"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"            success, responses \u003d self._replicate_object("},{"line_number":1167,"context_line":"                new_part, new_broker.db_file, node_id)"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"            if (not success and"},{"line_number":1170,"context_line":"                    sum(responses) \u003c quorum_size(self.ring.replica_count)):"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_b2cf2d28","line":1167,"updated":"2018-03-19 22:20:33.000000000","message":"running this inline makes sense given the requirement","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"956234c87eb28012a6b253057ed0b658940fd490","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"                new_part, new_broker.db_file, node_id)"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"            if (not success and"},{"line_number":1170,"context_line":"                    sum(responses) \u003c quorum_size(self.ring.replica_count)):"},{"line_number":1171,"context_line":"                # break because we don\u0027t want to progress the cleave cursor"},{"line_number":1172,"context_line":"                # until each shard range has been successfully cleaved"},{"line_number":1173,"context_line":"                self.logger.warning("}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_2d909c95","line":1170,"range":{"start_line":1170,"start_character":20,"end_line":1170,"end_character":34},"updated":"2018-03-19 21:03:54.000000000","message":":( just remembered I used sum here not count, should be\n\n  responses.count(True)","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"                    shard_range, broker.path)"},{"line_number":1176,"context_line":"                break"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"            ranges_done.append(shard_range)"},{"line_number":1179,"context_line":""},{"line_number":1180,"context_line":"            self.logger.info(\u0027Cleaved %s/%s for shard range %s.\u0027,"},{"line_number":1181,"context_line":"                             broker.account, broker.container, shard_range)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_d2d421c0","line":1178,"updated":"2018-03-19 22:20:33.000000000","message":"only, if sufficient success - brilliant!","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"a150e5485cf71b437f05783417ed9d22451f4096","unresolved":false,"context_lines":[{"line_number":698,"context_line":"                # failed to create the handoff db? Perhaps there should be some"},{"line_number":699,"context_line":"                # state propagated via cleaving to the shard container and then"},{"line_number":700,"context_line":"                # included in shard range update back to root so we know when"},{"line_number":701,"context_line":"                # cleaving succeeded?"},{"line_number":702,"context_line":"                if num_found or num_created:"},{"line_number":703,"context_line":"                    # share the shard ranges with other nodes so they can start"},{"line_number":704,"context_line":"                    # cleaving"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_9e31a0a5","side":"PARENT","line":701,"updated":"2018-03-27 20:55:13.000000000","message":"Why drop the comment? We still aren\u0027t looking at the success/failure of _replicate_object, yeah?","commit_id":"c941ec8a8484e51557f03fc030c657c5afbd679c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"a150e5485cf71b437f05783417ed9d22451f4096","unresolved":false,"context_lines":[{"line_number":1259,"context_line":"            self.logger.warning(\u0027No progress made in _cleave()!\u0027)"},{"line_number":1260,"context_line":""},{"line_number":1261,"context_line":"        # TODO: a finite timeout might be a good idea"},{"line_number":1262,"context_line":"        self.cpool.waitall(None)"},{"line_number":1263,"context_line":"        return len(ranges_done) \u003d\u003d len(ranges_todo)"},{"line_number":1264,"context_line":""},{"line_number":1265,"context_line":"    def run_forever(self, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_deeb98d9","side":"PARENT","line":1262,"updated":"2018-03-27 20:55:13.000000000","message":"OK, so we\u0027re doing the _replicate_object()s inline instead of waiting until now to collect the results of all shard_batch_size of them...","commit_id":"c941ec8a8484e51557f03fc030c657c5afbd679c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d8d56ee1ff77a829cc5ca178254bc6c697e8738b","unresolved":false,"context_lines":[{"line_number":1259,"context_line":"            self.logger.warning(\u0027No progress made in _cleave()!\u0027)"},{"line_number":1260,"context_line":""},{"line_number":1261,"context_line":"        # TODO: a finite timeout might be a good idea"},{"line_number":1262,"context_line":"        self.cpool.waitall(None)"},{"line_number":1263,"context_line":"        return len(ranges_done) \u003d\u003d len(ranges_todo)"},{"line_number":1264,"context_line":""},{"line_number":1265,"context_line":"    def run_forever(self, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_bfdb3feb","side":"PARENT","line":1262,"in_reply_to":"bf659307_deeb98d9","updated":"2018-03-27 22:23:39.000000000","message":"yep, so we can bail out as soon as one fails","commit_id":"c941ec8a8484e51557f03fc030c657c5afbd679c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"a150e5485cf71b437f05783417ed9d22451f4096","unresolved":false,"context_lines":[{"line_number":1236,"context_line":"                new_part, new_broker.db_file, node_id)"},{"line_number":1237,"context_line":""},{"line_number":1238,"context_line":"            if (not success and"},{"line_number":1239,"context_line":"                    sum(responses) \u003c quorum_size(self.ring.replica_count)):"},{"line_number":1240,"context_line":"                # break because we don\u0027t want to progress the cleave cursor"},{"line_number":1241,"context_line":"                # until each shard range has been successfully cleaved"},{"line_number":1242,"context_line":"                self.logger.warning("}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_be9ee460","line":1239,"range":{"start_line":1239,"start_character":20,"end_line":1239,"end_character":34},"updated":"2018-03-27 20:55:13.000000000","message":"In patchset 3 you said something about wanting to use\n\n responses.count(True)\n\ndo you still care...? Doesn\u0027t really matter either way to me.\n\nIt does seem a little strange to me that we seem to have three notions of success, though:\n\n- a True/False with no responses\n- all responses succeed\n- a quorum of responses succeed","commit_id":"b93ba3ffe5cd98c4c3aabc6ce01bd22fe8a92073"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"d8d56ee1ff77a829cc5ca178254bc6c697e8738b","unresolved":false,"context_lines":[{"line_number":1236,"context_line":"                new_part, new_broker.db_file, node_id)"},{"line_number":1237,"context_line":""},{"line_number":1238,"context_line":"            if (not success and"},{"line_number":1239,"context_line":"                    sum(responses) \u003c quorum_size(self.ring.replica_count)):"},{"line_number":1240,"context_line":"                # break because we don\u0027t want to progress the cleave cursor"},{"line_number":1241,"context_line":"                # until each shard range has been successfully cleaved"},{"line_number":1242,"context_line":"                self.logger.warning("}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_7ff4c786","line":1239,"range":{"start_line":1239,"start_character":20,"end_line":1239,"end_character":34},"in_reply_to":"bf659307_be9ee460","updated":"2018-03-27 22:23:39.000000000","message":"fixed the sum -\u003e count in a follow up\n\nI thought the tuple return necessary because there is a \u0027successful\u0027 outcome that involves no requests being made i.e. the container has been deleted so the db is cleaned up and replicate_object returns True, [] ...and then I wanted the caller to be able to decide what an acceptable quorum was rather then assess quorum before returning.","commit_id":"b93ba3ffe5cd98c4c3aabc6ce01bd22fe8a92073"}],"test/unit/container/test_sharder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3051fb5bc02ec67580d86f1662d6916aa3733f40","unresolved":false,"context_lines":[{"line_number":653,"context_line":"            responses \u003d successes + fails"},{"line_number":654,"context_line":"            random.shuffle(responses)"},{"line_number":655,"context_line":"            sharder._replicate_object \u003d mock.MagicMock("},{"line_number":656,"context_line":"                side_effect\u003d((False, responses),))"},{"line_number":657,"context_line":"            self.assertFalse(sharder._cleave(broker))"},{"line_number":658,"context_line":"        sharder._replicate_object.assert_called_once_with("},{"line_number":659,"context_line":"            0, expected_shard_dbs[1], 0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_2d017cb0","line":656,"updated":"2018-03-19 22:20:33.000000000","message":"hrm... the downside here is that I can revert the changes in common.db_replicator and this test still passes\n\nIdeally we want *some* sort of unittest across the interface - but if that\u0027s not practical we at least need to test both sides.\n\nI played around with mocking _repl_to_node instead of _replicate_object and it wasn\u0027t going *terrible*\n\n    @@ -505,16 +504,15 @@ class TestSharder(unittest.TestCase):\n             conf \u003d conf or {}\n             conf[\u0027devices\u0027] \u003d self.tempdir\n             with mock.patch(\n    -                \u0027swift.container.sharder.internal_client.InternalClient\u0027):\n    -            with mock.patch(\n    -                    \u0027swift.common.db_replicator.ring.Ring\u0027,\n    -                    lambda *args, **kwargs: FakeRing()):\n    -                sharder \u003d ContainerSharder(conf, logger\u003ddebug_logger())\n    -                sharder._local_device_ids \u003d {0, 1, 2}\n    -                sharder._replicate_object \u003d mock.MagicMock(\n    -                    return_value\u003d(True, [True] * sharder.ring.replica_count))\n    -                sharder.shard_cleanups \u003d dict()  # TODO: try to eliminate this\n    -                yield sharder\n    +                \u0027swift.container.sharder.internal_client.InternalClient\u0027), \\\n    +                mock.patch(\u0027swift.common.db_replicator.ring.Ring\u0027,\n    +                           lambda *args, **kwargs: FakeRing()):\n    +            sharder \u003d ContainerSharder(conf, logger\u003ddebug_logger())\n    +            sharder._local_device_ids \u003d {0, 1, 2}\n    +            sharder._repl_to_node \u003d mock.MagicMock(\n    +                side_effects\u003d[True] * sharder.ring.replica_count)\n    +            sharder.shard_cleanups \u003d dict()  # TODO: try to eliminate this\n    +            yield sharder","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cd9310d1b9861e5f0b56708909154e4da6d69e3d","unresolved":false,"context_lines":[{"line_number":653,"context_line":"            responses \u003d successes + fails"},{"line_number":654,"context_line":"            random.shuffle(responses)"},{"line_number":655,"context_line":"            sharder._replicate_object \u003d mock.MagicMock("},{"line_number":656,"context_line":"                side_effect\u003d((False, responses),))"},{"line_number":657,"context_line":"            self.assertFalse(sharder._cleave(broker))"},{"line_number":658,"context_line":"        sharder._replicate_object.assert_called_once_with("},{"line_number":659,"context_line":"            0, expected_shard_dbs[1], 0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df7087c5_ef55aefb","line":656,"in_reply_to":"df7087c5_2d017cb0","updated":"2018-03-20 08:52:42.000000000","message":"good point\n\nif you\u0027re happy to improve the tests then I\u0027m happy. Thanks.","commit_id":"9f14ed83c3c890b17fa47878f38e388e591a9064"}]}
