)]}'
{"swift/common/ring/builder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a37faa4c2233b5de8d722dd2a0bfd45a27174a87","unresolved":false,"context_lines":[{"line_number":802,"context_line":"            to_place \u003d defaultdict(int)"},{"line_number":803,"context_line":"            for t in sub_tiers:"},{"line_number":804,"context_line":"                to_place[t] \u003d min(parts, int(math.floor("},{"line_number":805,"context_line":"                    replica_plan[t][\u0027target\u0027] * self.parts)))"},{"line_number":806,"context_line":"                parts -\u003d to_place[t]"},{"line_number":807,"context_line":""},{"line_number":808,"context_line":"            # if there\u0027s some parts left over, just throw \u0027em about"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a77a97e_bef08f92","line":805,"updated":"2016-11-17 21:24:06.000000000","message":"so each tier gets some whole number of parts according to it\u0027s target replicanths.\n\nbut because of floating point - it might hand our more in total than it has which drives down parts below zero in the final iteration","commit_id":"6c235be6aef52f082da812819dd0f566b4b19e61"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a37faa4c2233b5de8d722dd2a0bfd45a27174a87","unresolved":false,"context_lines":[{"line_number":808,"context_line":"            # if there\u0027s some parts left over, just throw \u0027em about"},{"line_number":809,"context_line":"            sub_tier_gen \u003d itertools.cycle(sorted("},{"line_number":810,"context_line":"                sub_tiers, key\u003dlambda t: replica_plan[t][\u0027target\u0027]))"},{"line_number":811,"context_line":"            while parts \u003e 0:"},{"line_number":812,"context_line":"                t \u003d next(sub_tier_gen)"},{"line_number":813,"context_line":"                to_place[t] +\u003d 1"},{"line_number":814,"context_line":"                parts -\u003d 1"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a77a97e_beab2f74","line":811,"updated":"2016-11-17 21:24:06.000000000","message":"nice","commit_id":"6c235be6aef52f082da812819dd0f566b4b19e61"}],"test/unit/common/ring/test_builder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a37faa4c2233b5de8d722dd2a0bfd45a27174a87","unresolved":false,"context_lines":[{"line_number":287,"context_line":"                counts[dev_id] \u003d counts.get(dev_id, 0) + 1"},{"line_number":288,"context_line":"        self.assertEqual(counts, {0: 256, 2: 256, 3: 256})"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def test_numerical_analysis_is_jerks(self):"},{"line_number":291,"context_line":"        # 3 nodes with 11 disks each is particularly problematic. Probably has"},{"line_number":292,"context_line":"        # to do with the binary repr. of 1/33? Those ones look suspicious..."},{"line_number":293,"context_line":"        #"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a77a97e_fe64c722","line":290,"updated":"2016-11-17 21:24:06.000000000","message":"nit: not a great test name :\\","commit_id":"6c235be6aef52f082da812819dd0f566b4b19e61"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a37faa4c2233b5de8d722dd2a0bfd45a27174a87","unresolved":false,"context_lines":[{"line_number":298,"context_line":"            rb.add_dev({\u0027id\u0027: id, \u0027region\u0027: region, \u0027zone\u0027: zone, \u0027weight\u0027: 1,"},{"line_number":299,"context_line":"                        \u0027ip\u0027: \u0027127.0.0.1\u0027, \u0027port\u0027: 10000 + region * 100 + zone,"},{"line_number":300,"context_line":"                        \u0027device\u0027: \u0027sda%d\u0027 % id})"},{"line_number":301,"context_line":"        rb.rebalance()"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"    def test_remove_a_lot(self):"},{"line_number":304,"context_line":"        rb \u003d ring.RingBuilder(3, 3, 1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a77a97e_9e7673d5","line":301,"updated":"2016-11-17 21:24:06.000000000","message":"nit: maybe a seed and some assertions on the part counts - maybe the last something somewhere has one less?","commit_id":"6c235be6aef52f082da812819dd0f566b4b19e61"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"8dbfe808f4d91ef936688a5a608edc6e394f72ec","unresolved":false,"context_lines":[{"line_number":285,"context_line":"                counts[dev_id] \u003d counts.get(dev_id, 0) + 1"},{"line_number":286,"context_line":"        self.assertEqual(counts, {0: 256, 2: 256, 3: 256})"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def test_round_off_error(self):"},{"line_number":289,"context_line":"        # 3 nodes with 11 disks each is particularly problematic. Probably has"},{"line_number":290,"context_line":"        # to do with the binary repr. of 1/33? Those ones look suspicious..."},{"line_number":291,"context_line":"        #"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a77a97e_9d6d87ce","line":288,"range":{"start_line":288,"start_character":7,"end_line":288,"end_character":35},"updated":"2016-11-18 08:44:15.000000000","message":"Wait, this new test doesn\u0027t fail when I removed the code change in the ring builder.","commit_id":"2e7a7347fc58676fbaabce3d87a15866796d32e4"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"10b535c46ab37215c09ad478cf9007ac1548eb06","unresolved":false,"context_lines":[{"line_number":285,"context_line":"                counts[dev_id] \u003d counts.get(dev_id, 0) + 1"},{"line_number":286,"context_line":"        self.assertEqual(counts, {0: 256, 2: 256, 3: 256})"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def test_round_off_error(self):"},{"line_number":289,"context_line":"        # 3 nodes with 11 disks each is particularly problematic. Probably has"},{"line_number":290,"context_line":"        # to do with the binary repr. of 1/33? Those ones look suspicious..."},{"line_number":291,"context_line":"        #"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a77a97e_1df177cd","line":288,"range":{"start_line":288,"start_character":7,"end_line":288,"end_character":35},"in_reply_to":"7a77a97e_9d6d87ce","updated":"2016-11-18 08:54:16.000000000","message":"For me it worked as expected: the test was hanging without the patch applied - running in the loop basically. Can you retry this please and verify this?","commit_id":"2e7a7347fc58676fbaabce3d87a15866796d32e4"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"69e168489d2866e635f0c44122f167c8be5be38f","unresolved":false,"context_lines":[{"line_number":298,"context_line":"                        \u0027device\u0027: \u0027sda%d\u0027 % id})"},{"line_number":299,"context_line":"        rb.rebalance()"},{"line_number":300,"context_line":"        self.assertEqual(self._partition_counts(rb, \u0027zone\u0027),"},{"line_number":301,"context_line":"                         {0: 256, 10: 256, 11: 256})"},{"line_number":302,"context_line":"        wanted_by_zone \u003d defaultdict(lambda: defaultdict(int))"},{"line_number":303,"context_line":"        for dev in rb._iter_devs():"},{"line_number":304,"context_line":"            wanted_by_zone[dev[\u0027zone\u0027]][dev[\u0027parts_wanted\u0027]] +\u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a77a97e_9f1bca72","line":301,"updated":"2016-11-18 00:05:00.000000000","message":"this is a great assertion that shows all three zones got an even number of replicas","commit_id":"2e7a7347fc58676fbaabce3d87a15866796d32e4"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"69e168489d2866e635f0c44122f167c8be5be38f","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        self.assertEqual(wanted_by_zone, {"},{"line_number":308,"context_line":"            0: {0: 10, 1: 1},"},{"line_number":309,"context_line":"            10: {0: 11},"},{"line_number":310,"context_line":"            11: {0: 10, -1: 1}})"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    def test_remove_a_lot(self):"},{"line_number":313,"context_line":"        rb \u003d ring.RingBuilder(3, 3, 1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a77a97e_9fc66a66","line":310,"updated":"2016-11-18 00:05:00.000000000","message":"yeah... that looks pretty silly :)","commit_id":"2e7a7347fc58676fbaabce3d87a15866796d32e4"}]}
