)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"ee483a6d_8fab0800","updated":"2021-10-15 17:11:14.000000000","message":"When we talked about \"should we infer dev_id_bytes from the array\" there was a question about seemingly conflicting values of \"prefer explicit to implicit\" vs \"prefer single-source-of-truth in data as opposed to writing the same data twice\"\n\nI think we should go with explicit-single-source-of-truth\n\nduring deserialization we have to read dev_id_bytes to build the arrays, afterwards we don\u0027t need it as an attribute\n\nduring serialization we must calculate our dev_id_bytes to fit the array, and write it down so we can read the array later\n\nso there\u0027s really ONLY the value in serialized data structure and we can\u0027t not write it, do we really need/want to expose it as a property at all?\n\nI think dropping that out would clean up most of what\u0027s bugging me about this HUGE diff","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"}],"swift/cli/ringbuilder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":1358,"context_line":"                      \"if all nodes have been upgraded to understand it.\")"},{"line_number":1359,"context_line":"            print(\u0027-\u0027 * 79)"},{"line_number":1360,"context_line":"            exit(EXIT_ERROR)"},{"line_number":1361,"context_line":"        else:"},{"line_number":1362,"context_line":"            ring_data.save(ring_file, format_version\u003doptions.format_version)"},{"line_number":1363,"context_line":"        exit(EXIT_SUCCESS)"},{"line_number":1364,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5803899b_f51c6808","line":1361,"updated":"2021-09-13 18:57:48.000000000","message":"there\u0027s a lot of copy duplicated above here, I think exception handling is a little more specific than the generic \"RingValidationError\" we see sometimes in rebalance.\n\nMaybe we can trim it down and DRY it out","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"14072f2c10bc9e81ee8b60a194bccb0371c5ee6c","unresolved":true,"context_lines":[{"line_number":1358,"context_line":"                      \"if all nodes have been upgraded to understand it.\")"},{"line_number":1359,"context_line":"            print(\u0027-\u0027 * 79)"},{"line_number":1360,"context_line":"            exit(EXIT_ERROR)"},{"line_number":1361,"context_line":"        else:"},{"line_number":1362,"context_line":"            ring_data.save(ring_file, format_version\u003doptions.format_version)"},{"line_number":1363,"context_line":"        exit(EXIT_SUCCESS)"},{"line_number":1364,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"b9661652_d8f5579d","line":1361,"in_reply_to":"5803899b_f51c6808","updated":"2021-09-13 22:31:30.000000000","message":"Definitely gotta get a more-specific message in there. I wasn\u0027t thinking through the base message properly; was mostly thinking about how and when to recommend the new format.","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"}],"swift/common/exceptions.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class DevIdBytesTooSmall(ValueError):"},{"line_number":129,"context_line":"    pass"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"class ChunkReadError(SwiftException):"}],"source_content_type":"text/x-python","patch_set":1,"id":"eba6a2ae_6d6bc6a5","line":129,"updated":"2021-09-13 18:57:48.000000000","message":"in one case I see this raised if you have as many devices as visible stars in the universe\n\n... but in the other case it just means you need a v2 ring\n\nAre those essentially the same exception?","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"}],"swift/common/ring/builder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","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":"279ac65c_14d55539","line":41,"updated":"2021-09-13 18:57:48.000000000","message":"does it make sense to maintain this constant with this name?  IIUC, it\u0027s only applicable when dealing with v1 rings (and coincidently related to v2 rings that happen to have \u003c 66K devices)","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","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":4,"id":"b93c8e08_66ee9297","line":41,"updated":"2021-10-15 17:11:14.000000000","message":"I think this goes away in the next patch","commit_id":"531ae617f62516f37df6eca2d4fadd00afc9dc7e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":false,"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":4,"id":"501414d7_7c6a4187","line":41,"in_reply_to":"b93c8e08_66ee9297","updated":"2021-10-15 18:55:39.000000000","message":"Next patch is just a CLI change, but the one after that, yeah. Though now I\u0027m a little worried if there might be consumers using swift as a library and expecting this import to work...","commit_id":"531ae617f62516f37df6eca2d4fadd00afc9dc7e"}],"swift/common/ring/ring.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":166,"context_line":"        self.devs \u003d devs"},{"line_number":167,"context_line":"        self._replica2part2dev_id \u003d replica2part2dev_id"},{"line_number":168,"context_line":"        self._dev_id_bytes \u003d (replica2part2dev_id[0].itemsize"},{"line_number":169,"context_line":"                              if replica2part2dev_id else None)"},{"line_number":170,"context_line":"        self._part_shift \u003d part_shift"},{"line_number":171,"context_line":"        self.next_part_power \u003d next_part_power"},{"line_number":172,"context_line":"        self.version \u003d version"}],"source_content_type":"text/x-python","patch_set":1,"id":"a5b84c87_5649a487","line":169,"updated":"2021-09-13 18:57:48.000000000","message":"this attribute seems to be primarily dealt with in \"fix_dev_id_bytes\" and not typically inferred from the first rows itemsize or apparently potentially None in some cases also...","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":198,"context_line":"            self._dev_id_bytes \u003d min_dev_id_bytes"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        else:"},{"line_number":201,"context_line":"            # Caller requested a specific width"},{"line_number":202,"context_line":"            if dev_id_bytes \u003d\u003d self._dev_id_bytes:"},{"line_number":203,"context_line":"                return  # Already done!"},{"line_number":204,"context_line":"            if min_dev_id_bytes \u003e dev_id_bytes:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ed9f1640_57062a31","line":201,"updated":"2021-09-13 18:57:48.000000000","message":"this feels like a different function than the None case; not a single function with a parameter","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":203,"context_line":"                return  # Already done!"},{"line_number":204,"context_line":"            if min_dev_id_bytes \u003e dev_id_bytes:"},{"line_number":205,"context_line":"                raise DevIdBytesTooSmall(\u0027Too many devices for %d-byte \u0027"},{"line_number":206,"context_line":"                                         \u0027device ids\u0027 % dev_id_bytes)"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"            new_type_code \u003d BYTES_TO_TYPE_CODE[dev_id_bytes]"},{"line_number":209,"context_line":"            self._replica2part2dev_id \u003d ["}],"source_content_type":"text/x-python","patch_set":1,"id":"f746f379_ffe4c2c6","line":206,"updated":"2021-09-13 18:57:48.000000000","message":"and it\u0027s not like anyone would ever call this with dev_id_bytes\u003d4 this is just saying \"let me tell YOU how many bytes you need\"","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":327,"context_line":"    def serialize_v1(self, file_obj):"},{"line_number":328,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":329,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 1))"},{"line_number":330,"context_line":"        self.fix_dev_id_bytes(2)"},{"line_number":331,"context_line":"        ring \u003d self.to_dict()"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"        # Only include next_part_power if it is set in the"}],"source_content_type":"text/x-python","patch_set":1,"id":"903d43db_ee90550d","line":330,"updated":"2021-09-13 18:57:48.000000000","message":"strange to see this called from serialize_v1","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"14072f2c10bc9e81ee8b60a194bccb0371c5ee6c","unresolved":true,"context_lines":[{"line_number":327,"context_line":"    def serialize_v1(self, file_obj):"},{"line_number":328,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":329,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 1))"},{"line_number":330,"context_line":"        self.fix_dev_id_bytes(2)"},{"line_number":331,"context_line":"        ring \u003d self.to_dict()"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"        # Only include next_part_power if it is set in the"}],"source_content_type":"text/x-python","patch_set":1,"id":"f6ea6dac_cde75449","line":330,"in_reply_to":"903d43db_ee90550d","updated":"2021-09-13 22:31:30.000000000","message":"But needed in case the builder is handing out 8-bit arrays.","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":430,"context_line":"                \u0027replica2part2dev_id\u0027: self._replica2part2dev_id,"},{"line_number":431,"context_line":"                \u0027part_shift\u0027: self._part_shift,"},{"line_number":432,"context_line":"                \u0027next_part_power\u0027: self.next_part_power,"},{"line_number":433,"context_line":"                \u0027dev_id_bytes\u0027: self._dev_id_bytes,"},{"line_number":434,"context_line":"                \u0027version\u0027: self.version}"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"d9f79e4a_adc7810b","line":433,"updated":"2021-09-13 18:57:48.000000000","message":"this seems so related to the act of de/serialization I\u0027m surprised to see it *in* the objects state AND manipulated at a distance.","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"14072f2c10bc9e81ee8b60a194bccb0371c5ee6c","unresolved":true,"context_lines":[{"line_number":430,"context_line":"                \u0027replica2part2dev_id\u0027: self._replica2part2dev_id,"},{"line_number":431,"context_line":"                \u0027part_shift\u0027: self._part_shift,"},{"line_number":432,"context_line":"                \u0027next_part_power\u0027: self.next_part_power,"},{"line_number":433,"context_line":"                \u0027dev_id_bytes\u0027: self._dev_id_bytes,"},{"line_number":434,"context_line":"                \u0027version\u0027: self.version}"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3d571f7e_691f7c91","line":433,"in_reply_to":"d9f79e4a_adc7810b","updated":"2021-09-13 22:31:30.000000000","message":"It\u0027s in the object\u0027s state regardless; now at least it\u0027s explicit. I suppose I could try re-writing this with an eye toward having a property like\n\n @property\n def dev_id_bytes(self):\n     return self._replica2part2dev_id[0].itemsize\n\nthough...","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dc3367763241376d950d15a5979b0bb2870757c4","unresolved":true,"context_lines":[{"line_number":181,"context_line":"        return (self._replica2part2dev_id[0].itemsize"},{"line_number":182,"context_line":"                if self._replica2part2dev_id else 0)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def set_dev_id_bytes(self, dev_id_bytes):"},{"line_number":185,"context_line":"        if dev_id_bytes not in BYTES_TO_TYPE_CODE:"},{"line_number":186,"context_line":"            raise ValueError(\u0027dev_id_bytes must be None or one of %r\u0027"},{"line_number":187,"context_line":"                             % (tuple(BYTES_TO_TYPE_CODE),))"}],"source_content_type":"text/x-python","patch_set":2,"id":"c2c93161_824ea8ac","line":184,"updated":"2021-09-15 05:39:09.000000000","message":"Why not actually use a setter here?\n\n@dev_id_bytes.setter\ndef set_dev_id_bytes(self, dev_id_bytes):\n ...\n\nBecause the we can just use the property for both setting and getting.","commit_id":"001ffad72d747977226e268a4b38a85f0b5297a7"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dc3367763241376d950d15a5979b0bb2870757c4","unresolved":true,"context_lines":[{"line_number":198,"context_line":"            array.array(new_type_code, part2dev_id)"},{"line_number":199,"context_line":"            for part2dev_id in self._replica2part2dev_id]"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def auto_update_dev_id_bytes(self):"},{"line_number":202,"context_line":"        min_dev_id_bytes \u003d find_dev_id_bytes(len(self.devs) - 1)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        if min_dev_id_bytes \u003d\u003d self.dev_id_bytes:"}],"source_content_type":"text/x-python","patch_set":2,"id":"e6503821_9f207605","line":201,"updated":"2021-09-15 05:39:09.000000000","message":"If it was a propery setter this could just change to:\n\n  self.dev_id_bytes \u003d find_dev_id_bytes(len(self.devs) - 1","commit_id":"001ffad72d747977226e268a4b38a85f0b5297a7"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dc3367763241376d950d15a5979b0bb2870757c4","unresolved":true,"context_lines":[{"line_number":275,"context_line":"        data_len, \u003d struct.unpack(\u0027!Q\u0027, gz_file.read(8))"},{"line_number":276,"context_line":"        with contextlib.closing(FixedLengthReader(gz_file, data_len)) as data:"},{"line_number":277,"context_line":"            for row in iter(lambda: data.read(max_row_len), b\u0027\u0027):"},{"line_number":278,"context_line":"                type_code \u003d BYTES_TO_TYPE_CODE[ring_dict[\u0027dev_id_bytes\u0027]]"},{"line_number":279,"context_line":"                ring_dict[\u0027replica2part2dev_id\u0027].append("},{"line_number":280,"context_line":"                    read_network_order_array(type_code, row))"},{"line_number":281,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"b687e302_7ac8eca6","line":278,"updated":"2021-09-15 05:39:09.000000000","message":"The ring_dict[\u0027dev_id_bytes\u0027] doens\u0027t change to why move it down here.. maybe I need to go re-look at the rest of the chain.","commit_id":"001ffad72d747977226e268a4b38a85f0b5297a7"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dc3367763241376d950d15a5979b0bb2870757c4","unresolved":true,"context_lines":[{"line_number":325,"context_line":"    def serialize_v1(self, file_obj):"},{"line_number":326,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":327,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 1))"},{"line_number":328,"context_line":"        self.set_dev_id_bytes(2)"},{"line_number":329,"context_line":"        ring \u003d self.to_dict()"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        # Only include next_part_power if it is set in the"}],"source_content_type":"text/x-python","patch_set":2,"id":"a4e01104_6e72626a","line":328,"updated":"2021-09-15 05:39:09.000000000","message":"If it was a property setter:\n\n  self.dev_id_bytes \u003d 2\n\nWhich reads a little better.","commit_id":"001ffad72d747977226e268a4b38a85f0b5297a7"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":273,"context_line":"        data_len, \u003d struct.unpack(\u0027!Q\u0027, gz_file.read(8))"},{"line_number":274,"context_line":"        with contextlib.closing(FixedLengthReader(gz_file, data_len)) as data:"},{"line_number":275,"context_line":"            for row in iter(lambda: data.read(max_row_len), b\u0027\u0027):"},{"line_number":276,"context_line":"                type_code \u003d BYTES_TO_TYPE_CODE[ring_dict[\u0027dev_id_bytes\u0027]]"},{"line_number":277,"context_line":"                ring_dict[\u0027replica2part2dev_id\u0027].append("},{"line_number":278,"context_line":"                    read_network_order_array(type_code, row))"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"edc894f7_ea5b0fdd","line":276,"updated":"2021-10-15 17:11:14.000000000","message":"why do we do this every row?","commit_id":"531ae617f62516f37df6eca2d4fadd00afc9dc7e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        data_len, \u003d struct.unpack(\u0027!Q\u0027, gz_file.read(8))"},{"line_number":274,"context_line":"        with contextlib.closing(FixedLengthReader(gz_file, data_len)) as data:"},{"line_number":275,"context_line":"            for row in iter(lambda: data.read(max_row_len), b\u0027\u0027):"},{"line_number":276,"context_line":"                type_code \u003d BYTES_TO_TYPE_CODE[ring_dict[\u0027dev_id_bytes\u0027]]"},{"line_number":277,"context_line":"                ring_dict[\u0027replica2part2dev_id\u0027].append("},{"line_number":278,"context_line":"                    read_network_order_array(type_code, row))"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"419eee8a_ffa2f6b6","line":276,"in_reply_to":"edc894f7_ea5b0fdd","updated":"2021-10-15 18:55:39.000000000","message":"Matt had the same complaint ;-) Fixed.","commit_id":"531ae617f62516f37df6eca2d4fadd00afc9dc7e"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":427,"context_line":"                \u0027replica2part2dev_id\u0027: self._replica2part2dev_id,"},{"line_number":428,"context_line":"                \u0027part_shift\u0027: self._part_shift,"},{"line_number":429,"context_line":"                \u0027next_part_power\u0027: self.next_part_power,"},{"line_number":430,"context_line":"                \u0027dev_id_bytes\u0027: self.dev_id_bytes,"},{"line_number":431,"context_line":"                \u0027version\u0027: self.version}"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5fcf8927_d0fd116e","line":430,"updated":"2021-10-15 17:11:14.000000000","message":"so we don\u0027t write down the results of this to_dict?","commit_id":"531ae617f62516f37df6eca2d4fadd00afc9dc7e"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a3a9454b76639b827a892fea5f59b40e130c5ed9","unresolved":true,"context_lines":[{"line_number":181,"context_line":"        return (self._replica2part2dev_id[0].itemsize"},{"line_number":182,"context_line":"                if self._replica2part2dev_id else 0)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def set_dev_id_bytes(self, dev_id_bytes):"},{"line_number":185,"context_line":"        if dev_id_bytes not in BYTES_TO_TYPE_CODE:"},{"line_number":186,"context_line":"            raise ValueError(\u0027dev_id_bytes must be None or one of %r\u0027"},{"line_number":187,"context_line":"                             % (tuple(BYTES_TO_TYPE_CODE),))"}],"source_content_type":"text/x-python","patch_set":6,"id":"e62b61a3_108bf6c1","line":184,"updated":"2021-09-29 06:21:04.000000000","message":"If we already have a dev_if_bytes property, why not make this a setter:\n\n  @dev_id_bytes.setter\n  def set_dev_id_bytes(self, dev_id_bytes):\n      ...\n\nThen we can just use:\n\n   ringdata.dev_id_bytes \u003d 4\n\nand the this setter logic is run.","commit_id":"fd26e04de14e9c74873fba2aadde75b05d0b98f9"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":true,"context_lines":[{"line_number":181,"context_line":"        return (self._replica2part2dev_id[0].itemsize"},{"line_number":182,"context_line":"                if self._replica2part2dev_id else 0)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def set_dev_id_bytes(self, dev_id_bytes):"},{"line_number":185,"context_line":"        if dev_id_bytes not in BYTES_TO_TYPE_CODE:"},{"line_number":186,"context_line":"            raise ValueError(\u0027dev_id_bytes must be None or one of %r\u0027"},{"line_number":187,"context_line":"                             % (tuple(BYTES_TO_TYPE_CODE),))"}],"source_content_type":"text/x-python","patch_set":6,"id":"2381e2a2_00efe78d","line":184,"in_reply_to":"e62b61a3_108bf6c1","updated":"2021-10-15 18:55:39.000000000","message":"Nah -- having a setter like that makes it seem like a much cheaper operation than it is.\n\n ringdata.dev_id_bytes \u003d 4\n\nfeels like we\u0027re just updating some object\u0027s __dict__, while\n\n ringdata.set_dev_id_bytes(4)\n\nindicates that there\u0027s more going on and you probably don\u0027t want to go calling it all the time.","commit_id":"fd26e04de14e9c74873fba2aadde75b05d0b98f9"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a3a9454b76639b827a892fea5f59b40e130c5ed9","unresolved":true,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        if min_dev_id_bytes \u003d\u003d self.dev_id_bytes:"},{"line_number":204,"context_line":"            return  # Already done!"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        self._replica2part2dev_id \u003d ["},{"line_number":207,"context_line":"            resize_array(part2dev_id, min_dev_id_bytes)"},{"line_number":208,"context_line":"            for part2dev_id in self._replica2part2dev_id]"}],"source_content_type":"text/x-python","patch_set":6,"id":"402b3bc3_ee2e2d0e","line":205,"updated":"2021-09-29 06:21:04.000000000","message":"then we can just add:\n\n   self.dev_id_bytes \u003d min_dev_id_bytes\n\nbelow and be done with it.\n\nOr even better (I think I mentioned this in an earlier patchset) this whole method could become:\n\n\n  self.dev_id_bytes \u003d find_dev_id_bytes(len(self.devs) - 1)\n\nbecause the whole thing will be validated through the setter/set_dev_id_bytes method.","commit_id":"fd26e04de14e9c74873fba2aadde75b05d0b98f9"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        if min_dev_id_bytes \u003d\u003d self.dev_id_bytes:"},{"line_number":204,"context_line":"            return  # Already done!"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        self._replica2part2dev_id \u003d ["},{"line_number":207,"context_line":"            resize_array(part2dev_id, min_dev_id_bytes)"},{"line_number":208,"context_line":"            for part2dev_id in self._replica2part2dev_id]"}],"source_content_type":"text/x-python","patch_set":6,"id":"c88d36d2_9e27a2ef","line":205,"in_reply_to":"402b3bc3_ee2e2d0e","updated":"2021-10-15 18:55:39.000000000","message":"I probably *should* make this use set_dev_id_bytes, though -- it bugs me a bit that I had to update both of these in https://review.opendev.org/c/openstack/swift/+/790550/12/swift/common/ring/ring.py\n\nOTOH, the extra validation and recalculation of min_dev_id_bytes seems unnecessary.","commit_id":"fd26e04de14e9c74873fba2aadde75b05d0b98f9"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a3a9454b76639b827a892fea5f59b40e130c5ed9","unresolved":true,"context_lines":[{"line_number":273,"context_line":"        data_len, \u003d struct.unpack(\u0027!Q\u0027, gz_file.read(8))"},{"line_number":274,"context_line":"        with contextlib.closing(FixedLengthReader(gz_file, data_len)) as data:"},{"line_number":275,"context_line":"            for row in iter(lambda: data.read(max_row_len), b\u0027\u0027):"},{"line_number":276,"context_line":"                type_code \u003d BYTES_TO_TYPE_CODE[ring_dict[\u0027dev_id_bytes\u0027]]"},{"line_number":277,"context_line":"                ring_dict[\u0027replica2part2dev_id\u0027].append("},{"line_number":278,"context_line":"                    read_network_order_array(type_code, row))"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"e798f38d_9918350e","line":276,"updated":"2021-09-29 06:21:04.000000000","message":"Why does type_code need to be recalculated every loop, was this suppose to move down here? The dev_id_bytes wont change between part2dev_id replica right?","commit_id":"fd26e04de14e9c74873fba2aadde75b05d0b98f9"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        data_len, \u003d struct.unpack(\u0027!Q\u0027, gz_file.read(8))"},{"line_number":274,"context_line":"        with contextlib.closing(FixedLengthReader(gz_file, data_len)) as data:"},{"line_number":275,"context_line":"            for row in iter(lambda: data.read(max_row_len), b\u0027\u0027):"},{"line_number":276,"context_line":"                type_code \u003d BYTES_TO_TYPE_CODE[ring_dict[\u0027dev_id_bytes\u0027]]"},{"line_number":277,"context_line":"                ring_dict[\u0027replica2part2dev_id\u0027].append("},{"line_number":278,"context_line":"                    read_network_order_array(type_code, row))"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bd38e8e4_f00c7a08","line":276,"in_reply_to":"e798f38d_9918350e","updated":"2021-10-15 18:55:39.000000000","message":"Done","commit_id":"fd26e04de14e9c74873fba2aadde75b05d0b98f9"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @property"},{"line_number":192,"context_line":"    def dev_id_bytes(self):"},{"line_number":193,"context_line":"        return (self._replica2part2dev_id[0].itemsize"},{"line_number":194,"context_line":"                if self._replica2part2dev_id else 0)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def set_dev_id_bytes(self, dev_id_bytes):"}],"source_content_type":"text/x-python","patch_set":8,"id":"12a9a7df_f33ff6ed","line":193,"updated":"2021-10-15 17:11:14.000000000","message":"i\u0027m not sure which came first:\n\n1) my frustration about infering this critical piece of [de]serialization metadata from the first array in the list\n\n2) my frustration about all the test churn so we can rely on all the items in list being arrays","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":328,"context_line":"    def serialize_v1(self, file_obj):"},{"line_number":329,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":330,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 1))"},{"line_number":331,"context_line":"        self.set_dev_id_bytes(2)"},{"line_number":332,"context_line":"        ring \u003d self.to_dict()"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        # Only include next_part_power if it is set in the"}],"source_content_type":"text/x-python","patch_set":8,"id":"0a2bf24e_12127a49","line":331,"updated":"2021-10-15 17:11:14.000000000","message":"if you have too many devices for a v1 ring should we just upgrade them instead of throwing an inscruitable DevIdBytesTooSmall error?","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":true,"context_lines":[{"line_number":328,"context_line":"    def serialize_v1(self, file_obj):"},{"line_number":329,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":330,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 1))"},{"line_number":331,"context_line":"        self.set_dev_id_bytes(2)"},{"line_number":332,"context_line":"        ring \u003d self.to_dict()"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        # Only include next_part_power if it is set in the"}],"source_content_type":"text/x-python","patch_set":8,"id":"818ae1c6_061db972","line":331,"in_reply_to":"0a2bf24e_12127a49","updated":"2021-10-15 18:55:39.000000000","message":"I\u0027m going to put a stake in the ground and say serialize_v1() should *never* write v2 rings ;-)\n\nWe might could catch it in save() and upgrade (assuming we move this up ahead of the first write() call), but we\u0027d want to change up the signature so we could differentiate between format_version-not-provided and format_version\u003d1 calls; the latter should still get an error IMO.\n\nYou don\u0027t think the error handling in cli/ringbuilder is enough to help? Or are you more concerned for consumers that only use this as a library?","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":360,"context_line":"    def serialize_v2(self, file_obj):"},{"line_number":361,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":362,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 2))"},{"line_number":363,"context_line":"        self.auto_update_dev_id_bytes()"},{"line_number":364,"context_line":"        ring \u003d self.to_dict()"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        # Only include next_part_power if it is set in the"}],"source_content_type":"text/x-python","patch_set":8,"id":"831cc279_7a1ff118","line":363,"updated":"2021-10-15 17:11:14.000000000","message":"I guess it\u0027s significant that this change doesn\u0027t have to update *de*serialize_v2\n\nAFAIK this \"auto-ness\" only happens *right here* - is it really \"auto\" or just something that we have to do before serialize v2 rings?","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":true,"context_lines":[{"line_number":360,"context_line":"    def serialize_v2(self, file_obj):"},{"line_number":361,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":362,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 2))"},{"line_number":363,"context_line":"        self.auto_update_dev_id_bytes()"},{"line_number":364,"context_line":"        ring \u003d self.to_dict()"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        # Only include next_part_power if it is set in the"}],"source_content_type":"text/x-python","patch_set":8,"id":"b1b85783_a1f06131","line":363,"in_reply_to":"831cc279_7a1ff118","updated":"2021-10-15 18:55:39.000000000","message":"I\u0027d intended \"auto\" to differentiate it from set_dev_id_bytes, where the caller chooses what it should be.","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":361,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":362,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 2))"},{"line_number":363,"context_line":"        self.auto_update_dev_id_bytes()"},{"line_number":364,"context_line":"        ring \u003d self.to_dict()"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        # Only include next_part_power if it is set in the"},{"line_number":367,"context_line":"        # builder, otherwise just ignore it"}],"source_content_type":"text/x-python","patch_set":8,"id":"4ba519b1_bc895bea","line":364,"updated":"2021-10-15 17:11:14.000000000","message":"IIUC we maybe *just* changed array.itemsize with this magic-at-distance auto/resize/recreate dance; now we\u0027re going to *infer* self.dev_id_bytes with a property that looks back at very array we just build using a dev_id_bytes that we calculated","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":true,"context_lines":[{"line_number":361,"context_line":"        # Write out new-style serialization magic and version:"},{"line_number":362,"context_line":"        file_obj.write(struct.pack(\u0027!4sH\u0027, b\u0027R1NG\u0027, 2))"},{"line_number":363,"context_line":"        self.auto_update_dev_id_bytes()"},{"line_number":364,"context_line":"        ring \u003d self.to_dict()"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"        # Only include next_part_power if it is set in the"},{"line_number":367,"context_line":"        # builder, otherwise just ignore it"}],"source_content_type":"text/x-python","patch_set":8,"id":"a256c2e5_cfb31e64","line":364,"in_reply_to":"4ba519b1_bc895bea","updated":"2021-10-15 18:55:39.000000000","message":"Yes -- my take on it is that the single source of truth should be the arrays themselves -- they know how big each element is, they can\u0027t *not* know how big each element is, and they\u0027re in charge of determining how things get serialized on-disk via tostring()/tofile().","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"}],"swift/common/ring/utils.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"ce135d9fb2fe2857d8b5af47c98d78f1481a04e7","unresolved":true,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def find_dev_id_bytes(max_dev_id):"},{"line_number":44,"context_line":"    for x in sorted(BYTES_TO_TYPE_CODE):"},{"line_number":45,"context_line":"        if max_dev_id \u003c none_dev_id(x):"},{"line_number":46,"context_line":"            return x"},{"line_number":47,"context_line":"    else:"},{"line_number":48,"context_line":"        # \u003e 1.8e19 devices??"}],"source_content_type":"text/x-python","patch_set":1,"id":"52bf68e7_c5ff3062","line":45,"updated":"2021-09-11 04:39:24.000000000","message":"Lol, I love that you can use none_dev_id here to check the MAX devid. Very cleaver 😊\n\nMight be confusing to people first coming across this, but the method is directly above so should be fine. We could:\n\n  max_dev_id \u003d none_dev_id\n\nThen we can use either max_dev_id() or or none_dev_id() but meh.","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"14072f2c10bc9e81ee8b60a194bccb0371c5ee6c","unresolved":true,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def find_dev_id_bytes(max_dev_id):"},{"line_number":44,"context_line":"    for x in sorted(BYTES_TO_TYPE_CODE):"},{"line_number":45,"context_line":"        if max_dev_id \u003c none_dev_id(x):"},{"line_number":46,"context_line":"            return x"},{"line_number":47,"context_line":"    else:"},{"line_number":48,"context_line":"        # \u003e 1.8e19 devices??"}],"source_content_type":"text/x-python","patch_set":1,"id":"443957a3_16d638a8","line":45,"in_reply_to":"52bf68e7_c5ff3062","updated":"2021-09-13 22:31:30.000000000","message":"I should maybe rename the max_dev_id arg here... a separate max_dev_id(dev_id_bytes) function does seem nice...","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":45,"context_line":"        if max_dev_id \u003c none_dev_id(x):"},{"line_number":46,"context_line":"            return x"},{"line_number":47,"context_line":"    else:"},{"line_number":48,"context_line":"        # \u003e 1.8e19 devices??"},{"line_number":49,"context_line":"        raise exceptions.DevIdBytesTooSmall(\u0027Way too many devices!\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"6663a34f_24d33a07","line":48,"updated":"2021-09-13 18:57:48.000000000","message":"LOL","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dc3367763241376d950d15a5979b0bb2870757c4","unresolved":true,"context_lines":[{"line_number":46,"context_line":"            return x"},{"line_number":47,"context_line":"    else:"},{"line_number":48,"context_line":"        # \u003e 1.8e19 devices??"},{"line_number":49,"context_line":"        raise exceptions.DevIdBytesTooSmall(\u0027Way too many devices!\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"def tiers_for_dev(dev):"}],"source_content_type":"text/x-python","patch_set":2,"id":"f62c2f0e_43781130","line":49,"updated":"2021-09-15 05:39:09.000000000","message":"Lol, love it.","commit_id":"001ffad72d747977226e268a4b38a85f0b5297a7"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":49,"context_line":"            return x"},{"line_number":50,"context_line":"    else:"},{"line_number":51,"context_line":"        # \u003e 4B devices??"},{"line_number":52,"context_line":"        raise exceptions.DevIdBytesTooSmall(\u0027Way too many devices!\u0027)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def resize_array(old_arr, new_dev_id_bytes):"}],"source_content_type":"text/x-python","patch_set":8,"id":"68221fed_51837e1c","line":52,"updated":"2021-10-15 17:11:14.000000000","message":"this function bugs the snot out of me\n\n1) the name \"find\" has more to do with the implementation than the usage, in context it\u0027s more like \"calculate_minimum_dev_id_bytes(max_dev_id)\"\n\n2) the meat is only 3 lines, and we double that trying to raise two different ValueErrors - if you really want to laugh on py2 try a string!\n\n3) rasing TooSmall with the string \"too many\" is stupid - do we really need a special exception for a situation we thing is entirely unrealistic, just ValueError(\u0027this will never happen\u0027) and let\u0027s see which one of us is still working on swift when the bug report finally comes in","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":52,"context_line":"        raise exceptions.DevIdBytesTooSmall(\u0027Way too many devices!\u0027)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def resize_array(old_arr, new_dev_id_bytes):"},{"line_number":56,"context_line":"    old_none_dev \u003d none_dev_id(old_arr.itemsize)"},{"line_number":57,"context_line":"    new_none_dev \u003d none_dev_id(new_dev_id_bytes)"},{"line_number":58,"context_line":"    return array.array("}],"source_content_type":"text/x-python","patch_set":8,"id":"18ce6aef_8dd02a0a","line":55,"updated":"2021-10-15 17:11:14.000000000","message":"docstring explaining that \"resize\" in this context means \"translate and create new\"","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5c9847a7d4247539d6cfa12edbcf01edb15bec32","unresolved":true,"context_lines":[{"line_number":52,"context_line":"        raise exceptions.DevIdBytesTooSmall(\u0027Way too many devices!\u0027)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"def resize_array(old_arr, new_dev_id_bytes):"},{"line_number":56,"context_line":"    old_none_dev \u003d none_dev_id(old_arr.itemsize)"},{"line_number":57,"context_line":"    new_none_dev \u003d none_dev_id(new_dev_id_bytes)"},{"line_number":58,"context_line":"    return array.array("}],"source_content_type":"text/x-python","patch_set":8,"id":"a818e4fa_0143dc3b","line":55,"in_reply_to":"18ce6aef_8dd02a0a","updated":"2021-10-15 18:55:39.000000000","message":"#willfix\n\nMight also change it to \"resized_array\"?","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"}],"test/functional/__init__.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":645,"context_line":"            f)"},{"line_number":646,"context_line":"    container_ring_path \u003d os.path.join(_testdir, \u0027container.ring.gz\u0027)"},{"line_number":647,"context_line":"    with closing(GzipFile(container_ring_path, \u0027wb\u0027)) as f:"},{"line_number":648,"context_line":"        pickle.dump("},{"line_number":649,"context_line":"            ring.RingData("},{"line_number":650,"context_line":"                [array.array(\u0027H\u0027, [0, 1, 0, 1]),"},{"line_number":651,"context_line":"                 array.array(\u0027H\u0027, [1, 0, 1, 0])],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7fab3890_c6cff0fc","line":648,"updated":"2021-10-15 17:11:14.000000000","message":"pickle what now?!  let\u0027s use either v1 or v2 rings please.","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"}],"test/unit/common/ring/test_ring.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3637ac39984d266aa972825551a6f2f72e717fae","unresolved":true,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_attrs(self):"},{"line_number":70,"context_line":"        r2p2d \u003d [array.array(\u0027H\u0027, [0, 1, 0, 1]),"},{"line_number":71,"context_line":"                 array.array(\u0027H\u0027, [0, 1, 0, 1])]"},{"line_number":72,"context_line":"        d \u003d [{\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 0, \u0027ip\u0027: \u002710.1.1.0\u0027, \u0027port\u0027: 7000},"},{"line_number":73,"context_line":"             {\u0027id\u0027: 1, \u0027zone\u0027: 1, \u0027region\u0027: 1, \u0027ip\u0027: \u002710.1.1.1\u0027, \u0027port\u0027: 7000}]"},{"line_number":74,"context_line":"        s \u003d 30"}],"source_content_type":"text/x-python","patch_set":1,"id":"f448a41e_bc3f4b30","line":71,"updated":"2021-09-13 18:57:48.000000000","message":"this is all so that you can get .itemsize in the __init__ ???","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"14072f2c10bc9e81ee8b60a194bccb0371c5ee6c","unresolved":true,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_attrs(self):"},{"line_number":70,"context_line":"        r2p2d \u003d [array.array(\u0027H\u0027, [0, 1, 0, 1]),"},{"line_number":71,"context_line":"                 array.array(\u0027H\u0027, [0, 1, 0, 1])]"},{"line_number":72,"context_line":"        d \u003d [{\u0027id\u0027: 0, \u0027zone\u0027: 0, \u0027region\u0027: 0, \u0027ip\u0027: \u002710.1.1.0\u0027, \u0027port\u0027: 7000},"},{"line_number":73,"context_line":"             {\u0027id\u0027: 1, \u0027zone\u0027: 1, \u0027region\u0027: 1, \u0027ip\u0027: \u002710.1.1.1\u0027, \u0027port\u0027: 7000}]"},{"line_number":74,"context_line":"        s \u003d 30"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f85b5e7_10774d8d","line":71,"in_reply_to":"f448a41e_bc3f4b30","updated":"2021-09-13 22:31:30.000000000","message":"Yup. And there\u0027s a bunch more that I missed :-(","commit_id":"93c793716c13d7d5c14694a023b60419ac333001"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":79,"context_line":"        self.assertEqual(rd._replica2part2dev_id, r2p2d)"},{"line_number":80,"context_line":"        self.assertEqual(rd.devs, d)"},{"line_number":81,"context_line":"        self.assertEqual(rd._part_shift, s)"},{"line_number":82,"context_line":"        self.assertEqual(rd.dev_id_bytes, 2)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def test_can_load_pickled_ring_data(self):"},{"line_number":85,"context_line":"        rd \u003d ring.RingData("}],"source_content_type":"text/x-python","patch_set":8,"id":"2426c030_ed06fb74","line":82,"updated":"2021-10-15 17:11:14.000000000","message":"unless you\u0027re going to add this assertion to all of the changed tests most of them would pass just find using lists instead of arrays","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"}],"test/unit/common/ring/test_utils.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a3a9454b76639b827a892fea5f59b40e130c5ed9","unresolved":true,"context_lines":[{"line_number":792,"context_line":"        self.assertEqual(none_dev_id(2), 0xffff)"},{"line_number":793,"context_line":"        self.assertEqual(none_dev_id(4), 0xffffffff)"},{"line_number":794,"context_line":"        # Never used, but can calculate"},{"line_number":795,"context_line":"        self.assertEqual(none_dev_id(3), 0xffffff)"},{"line_number":796,"context_line":""},{"line_number":797,"context_line":"    def test_find_dev_id_bytes(self):"},{"line_number":798,"context_line":"        self.assertEqual(find_dev_id_bytes(0), 1)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bdbea4c1_aa5cca04","line":795,"updated":"2021-09-29 06:21:04.000000000","message":"Do we need to deal with incorrect input, like None, floats, strings, etc in these 3 tests and helper method implementations?","commit_id":"fd26e04de14e9c74873fba2aadde75b05d0b98f9"}],"test/unit/obj/test_replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ca67c564a6d0b48e9d651a0ad08df7772f12a596","unresolved":true,"context_lines":[{"line_number":187,"context_line":"    intended_replica2part2dev_id \u003d ["},{"line_number":188,"context_line":"        array.array(\u0027B\u0027, [0, 1, 2, 3, 4, 5, 6]),"},{"line_number":189,"context_line":"        array.array(\u0027B\u0027, [1, 2, 3, 0, 5, 6, 4]),"},{"line_number":190,"context_line":"        array.array(\u0027B\u0027, [2, 3, 0, 1, 6, 4, 5]),"},{"line_number":191,"context_line":"    ]"},{"line_number":192,"context_line":"    intended_devs \u003d devs or ["},{"line_number":193,"context_line":"        {\u0027id\u0027: 0, \u0027device\u0027: \u0027sda\u0027, \u0027zone\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":8,"id":"937d109b_a583ed32","line":190,"updated":"2021-10-15 17:11:14.000000000","message":"I don\u0027t want to see a ring format change have a diff on the replicator tests.  I really see two options:\n\n1) catch AttributeError in dev_id and return 2 with a comment about legacy tests\n\n2) change all of the tests to use a \"build_replica2part2dev_id(list_of_arrays)\" helper","commit_id":"237ee02c4bfec4c7bb7a042cd13a0e3ab9ed5677"}]}
