)]}'
{"doc/source/overview_ring.rst":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"7c4c1c544c8f46204e7876703902590a272edca2","unresolved":true,"context_lines":[{"line_number":586,"context_line":"- a BLOB to store the devs as a ASCII-encoded JSON object. The devs structure was getting"},{"line_number":587,"context_line":"  rather large so having it as it\u0027s own BLOB means less data to load if we only want the ring metadata."},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"- a BLOB for the last primaries table. Its structure"},{"line_number":590,"context_line":"  is similar to the replica-to-part-to-device table, but ``\u003cdev\u003e`` may be"},{"line_number":591,"context_line":"  ``(2 ** dev_id_bytes) - 1`` to indicate the absence of a value."},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"- The final BLOB, always at the end, would be the metadata/index BLOB."},{"line_number":594,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"dffdc5bc_0bf25295","line":591,"range":{"start_line":589,"start_character":2,"end_line":591,"end_character":65},"updated":"2022-02-02 04:41:50.000000000","message":"Probably don\u0027t need to mention this yet.","commit_id":"7273ebb835f9e46976bf95774caea346fc407c5e"}],"swift/common/ring/ring.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"7c4c1c544c8f46204e7876703902590a272edca2","unresolved":true,"context_lines":[{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        # First we need to seek to the end and grab the length of the metadata"},{"line_number":248,"context_line":"        # from the end of the file."},{"line_number":249,"context_line":"        gz_file.seek(-8, os.SEEK_END)"},{"line_number":250,"context_line":"        json_len, \u003d struct.unpack(\u0027!Q\u0027, gz_file.read(8))"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        # Now we can grab the metadata section"}],"source_content_type":"text/x-python","patch_set":2,"id":"187e7783_e53dc13a","line":249,"range":{"start_line":249,"start_character":8,"end_line":249,"end_character":37},"updated":"2022-02-02 04:41:50.000000000","message":"Seek from the end might not be supported in Python 2.7. I thought I read somewhere it was.. but it\u0027s failing for me. Maybe I need to rebuild my 2.7 env :shrug:\n\nIf it doens\u0027t work in py2, then we can either:\n\n  1. Only allow v2 in py3.\n  2. Move v2 to something like bz2 as it apparently supports seeking more efficiently as it\u0027s a block based compression rather then stream.\n  3. Go a mixed approach where in the meta and index are not gzipped, and only the dev and replica2part2dev BLOBs are.","commit_id":"7273ebb835f9e46976bf95774caea346fc407c5e"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"6af9015a7178342fa557e4f8a592f90037d30ad1","unresolved":true,"context_lines":[{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        # First we need to seek to the end and grab the length of the metadata"},{"line_number":248,"context_line":"        # from the end of the file."},{"line_number":249,"context_line":"        gz_file.seek(-8, os.SEEK_END)"},{"line_number":250,"context_line":"        json_len, \u003d struct.unpack(\u0027!Q\u0027, gz_file.read(8))"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"        # Now we can grab the metadata section"}],"source_content_type":"text/x-python","patch_set":2,"id":"224f3e1f_4f52556c","line":249,"range":{"start_line":249,"start_character":8,"end_line":249,"end_character":37},"in_reply_to":"187e7783_e53dc13a","updated":"2022-02-07 23:49:38.000000000","message":"The current version of this patch will allow py2 to save to v2 but can\u0027t load it. Only a py3 can load, and it\u0027s because the py2 gzip can\u0027t seek from the back.\n\nHmm, maybe I could always seek forwards, so long as I have an accurate byte count of both the compressed and uncompressed it might be possible. But that would be something like:\n\n  gzip_file.seek(\u003cnumber 8 from the end\u003e, os.SEEK_START)\n  gzip_file.seek(\u003cnumber 8 + metadata length from the end\u003e, os.SEEK_START)\n\nOr we could just keep it as only load from Py3, so the code stays tidier (only because Py3 only should be just aroud the corner) maybe even before this patch lands?","commit_id":"7273ebb835f9e46976bf95774caea346fc407c5e"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"7c4c1c544c8f46204e7876703902590a272edca2","unresolved":true,"context_lines":[{"line_number":405,"context_line":"        if next_part_power is not None:"},{"line_number":406,"context_line":"            _text[\u0027next_part_power\u0027] \u003d next_part_power"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"        _text[\u0027index\u0027] \u003d index"},{"line_number":409,"context_line":"        # Just adding the metadata offset for completeness"},{"line_number":410,"context_line":"        index.append({\u0027type\u0027: RING_METADATA_TYPE, \u0027offset\u0027: offset})"},{"line_number":411,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"e89417bc_5b802349","line":408,"range":{"start_line":408,"start_character":8,"end_line":408,"end_character":30},"updated":"2022-02-02 04:41:50.000000000","message":"Another option is to keep the index seperate from the metadata. So the metadata becomes another BLOB in the file. The end just has the index + index size?","commit_id":"7273ebb835f9e46976bf95774caea346fc407c5e"}]}
