)]}'
{"swift/common/ring/builder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"7f17834d5b2eccb699b8c7a455b9c5ba4baefecb","unresolved":true,"context_lines":[{"line_number":38,"context_line":"    validate_and_normalize_address, validate_replicas_by_tier, pretty_dev, \\"},{"line_number":39,"context_line":"    none_dev_id"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"NONE_DEV \u003d none_dev_id(2)"},{"line_number":42,"context_line":"MAX_BALANCE \u003d 999.99"},{"line_number":43,"context_line":"MAX_BALANCE_GATHER_COUNT \u003d 3"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"a93a406a_ab9008ec","side":"PARENT","line":41,"updated":"2021-09-13 19:09:59.000000000","message":"oh good, it DOES go away!","commit_id":"407933464c972a347eb6767247dcffb43ef66568"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"7f17834d5b2eccb699b8c7a455b9c5ba4baefecb","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        self.parts \u003d 2 ** self.part_power"},{"line_number":99,"context_line":"        self.devs \u003d []"},{"line_number":100,"context_line":"        self.devs_changed \u003d False"},{"line_number":101,"context_line":"        self.dev_id_bytes \u003d 1"},{"line_number":102,"context_line":"        self.version \u003d 0"},{"line_number":103,"context_line":"        self.overload \u003d 0.0"},{"line_number":104,"context_line":"        self._id \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"abdeffd4_a1fb8a1a","line":101,"updated":"2021-09-13 19:09:59.000000000","message":"it\u0027s akward maybe to keep this piece of state consistent across the lifetime of the object\n\ni\u0027m guessing all existing builders have 2 here after they\u0027re loaded?  but maybe new test builders are super extra tiny?!","commit_id":"49a7c488bd779ec57dee4e30895e632d24e8d1ef"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"be37bcd3612aadfb6508872ebbf6a93370b1f95d","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        self.parts \u003d 2 ** self.part_power"},{"line_number":99,"context_line":"        self.devs \u003d []"},{"line_number":100,"context_line":"        self.devs_changed \u003d False"},{"line_number":101,"context_line":"        self.dev_id_bytes \u003d 1"},{"line_number":102,"context_line":"        self.version \u003d 0"},{"line_number":103,"context_line":"        self.overload \u003d 0.0"},{"line_number":104,"context_line":"        self._id \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"06affd12_949accc8","line":101,"in_reply_to":"abdeffd4_a1fb8a1a","updated":"2021-09-14 00:32:04.000000000","message":"\u003e i\u0027m guessing all existing builders have 2 here after they\u0027re loaded?\n\nYeah, see copy_from()","commit_id":"49a7c488bd779ec57dee4e30895e632d24e8d1ef"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"2770c13e2142707e775c829f657140cdfb90c297","unresolved":true,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @property"},{"line_number":170,"context_line":"    def none_dev_id(self):"},{"line_number":171,"context_line":"        return none_dev_id(self.dev_id_bytes)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    @property"},{"line_number":174,"context_line":"    def ever_rebalanced(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"6ce5cde9_3a4b6167","line":171,"updated":"2021-09-11 05:05:25.000000000","message":"Ahh nice, these properties make it clearer for people. nice.","commit_id":"49a7c488bd779ec57dee4e30895e632d24e8d1ef"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"2770c13e2142707e775c829f657140cdfb90c297","unresolved":true,"context_lines":[{"line_number":436,"context_line":"                \u0027Duplicate device id: %d\u0027 % dev[\u0027id\u0027])"},{"line_number":437,"context_line":"        if dev[\u0027id\u0027] \u003e self.max_dev_id:"},{"line_number":438,"context_line":"            new_dev_id_bytes \u003d find_dev_id_bytes(dev[\u0027id\u0027])"},{"line_number":439,"context_line":"            new_type_code \u003d BYTES_TO_TYPE_CODE[new_dev_id_bytes]"},{"line_number":440,"context_line":"            self._replica2part2dev \u003d ["},{"line_number":441,"context_line":"                array(new_type_code, p2d)"},{"line_number":442,"context_line":"                for p2d in self._replica2part2dev]"},{"line_number":443,"context_line":"            self.dev_id_bytes \u003d new_dev_id_bytes"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        # Add holes to self.devs to ensure self.devs[dev[\u0027id\u0027]] will be the dev"},{"line_number":446,"context_line":"        while dev[\u0027id\u0027] \u003e\u003d len(self.devs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"f438d78a_8f4166fc","line":443,"range":{"start_line":439,"start_character":12,"end_line":443,"end_character":48},"updated":"2021-09-11 05:05:25.000000000","message":"I feel like this is the 3rd time I\u0027ve seen this bit of code in the chain, probably time to pull it out into ring.utils and reference it.","commit_id":"49a7c488bd779ec57dee4e30895e632d24e8d1ef"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"be37bcd3612aadfb6508872ebbf6a93370b1f95d","unresolved":true,"context_lines":[{"line_number":1037,"context_line":"        while self.devs and self.devs[-1] is None:"},{"line_number":1038,"context_line":"            self.devs.pop()"},{"line_number":1039,"context_line":"        new_none_dev_id \u003d (2 ** (8 * self.dev_id_bytes // 2)) - 1"},{"line_number":1040,"context_line":"        if self.dev_id_bytes \u003e 1 and \\"},{"line_number":1041,"context_line":"                len(self.devs) \u003c new_none_dev_id // 2:"},{"line_number":1042,"context_line":"            # Shrink the device IDs themselves"},{"line_number":1043,"context_line":"            new_type_code \u003d BYTES_TO_TYPE_CODE[self.dev_id_bytes // 2]"}],"source_content_type":"text/x-python","patch_set":1,"id":"6ff44637_f80f12d6","line":1040,"range":{"start_line":1040,"start_character":11,"end_line":1040,"end_character":32},"updated":"2021-09-14 00:32:04.000000000","message":"self.dev_id_bytes \u003d\u003d 1 would imply new_none_dev_id \u003d 0, so this is redundant. Maybe good belt \u0026 bracers, though?","commit_id":"49a7c488bd779ec57dee4e30895e632d24e8d1ef"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"7f17834d5b2eccb699b8c7a455b9c5ba4baefecb","unresolved":true,"context_lines":[{"line_number":1038,"context_line":"            self.devs.pop()"},{"line_number":1039,"context_line":"        new_none_dev_id \u003d (2 ** (8 * self.dev_id_bytes // 2)) - 1"},{"line_number":1040,"context_line":"        if self.dev_id_bytes \u003e 1 and \\"},{"line_number":1041,"context_line":"                len(self.devs) \u003c new_none_dev_id // 2:"},{"line_number":1042,"context_line":"            # Shrink the device IDs themselves"},{"line_number":1043,"context_line":"            new_type_code \u003d BYTES_TO_TYPE_CODE[self.dev_id_bytes // 2]"},{"line_number":1044,"context_line":"            self._replica2part2dev \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"f7243bbd_88bb129e","line":1041,"updated":"2021-09-13 19:09:59.000000000","message":"wat?  isn\u0027t there properties for these values?\n\nshould we really be doing this in _gather_parts_from_failed_devices","commit_id":"49a7c488bd779ec57dee4e30895e632d24e8d1ef"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"be37bcd3612aadfb6508872ebbf6a93370b1f95d","unresolved":true,"context_lines":[{"line_number":1038,"context_line":"            self.devs.pop()"},{"line_number":1039,"context_line":"        new_none_dev_id \u003d (2 ** (8 * self.dev_id_bytes // 2)) - 1"},{"line_number":1040,"context_line":"        if self.dev_id_bytes \u003e 1 and \\"},{"line_number":1041,"context_line":"                len(self.devs) \u003c new_none_dev_id // 2:"},{"line_number":1042,"context_line":"            # Shrink the device IDs themselves"},{"line_number":1043,"context_line":"            new_type_code \u003d BYTES_TO_TYPE_CODE[self.dev_id_bytes // 2]"},{"line_number":1044,"context_line":"            self._replica2part2dev \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"2a9f14c3_9e0f6f14","line":1041,"in_reply_to":"f7243bbd_88bb129e","updated":"2021-09-14 00:32:04.000000000","message":"Bah -- I\u0027d meant to rewrite L1039 once I introduced the function:\n\n new_none_dev_id \u003d none_dev_id(self.dev_id_bytes // 2)\n\nThe length check here is subtle, though -- an over-eager approach could see something like\n\n* add 250 devices; stick with 8-bit dev_ids\n* add 10 more devices; bump up to 16-bit dev_ids\n* remove the last 5 devices; drop back to 8-bit dev_ids\n* add 2 more devices; bump up to 16-bit dev_ids again\n\nThat seems like a lot of expanding and contracting for fairly minor changes, though, so instead I require that all devices fit into *N-1* bits to shrink down to N-bit dev_ids.\n\n\u003e should we really be doing this in _gather_parts_from_failed_devices\n\nThis is where we set self.devs[x] \u003d None, so it seemed reasonable to also be the place to shorten self.devs. Once I was doing that, it seemed like a logical enough place to consider shrinking dev_id_bytes.","commit_id":"49a7c488bd779ec57dee4e30895e632d24e8d1ef"}]}
