)]}'
{"id":"openstack%2Fswift~952613","triplet_id":"openstack%2Fswift~master~Id2e4facc8610483a3677eb42ac2ded3f706dfe2a","project":"openstack/swift","branch":"master","topic":"refactor-ringv2","attention_set":{"1179":{"account":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"last_update":"2025-08-01 01:47:45.000000000","reason":"A robot voted negatively on a label"},"15343":{"account":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"last_update":"2025-08-01 01:25:14.000000000","reason":"\u003cGERRIT_ACCOUNT_1179\u003e replied on the change","reason_account":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"}}},"removed_from_attention_set":{},"hashtags":[],"change_id":"Id2e4facc8610483a3677eb42ac2ded3f706dfe2a","subject":"Alternative compatible v2 ring implementation","status":"NEW","created":"2025-06-13 20:48:39.000000000","updated":"2025-08-01 01:47:45.000000000","submit_type":"MERGE_IF_NECESSARY","mergeable":false,"submittable":false,"total_comment_count":14,"unresolved_comment_count":6,"has_review_started":true,"meta_rev_id":"b0e6590e3b4dd593dbfe899f8203bd01769e63f7","_number":952613,"virtual_id_number":952613,"owner":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"actions":{},"labels":{"Verified":{"disliked":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"tag":"autogenerated:zuul:check","value":-1,"date":"2025-08-01 01:47:45.000000000","permitted_voting_range":{"min":-2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","value":-1,"default_value":0,"optional":true},"Code-Review":{"all":[{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"all":[{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"CC":[{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"}],"REVIEWER":[{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2025-06-13 21:48:09.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2025-06-18 18:17:20.000000000","updated_by":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"reviewer":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"state":"CC"}],"messages":[{"id":"6d70d90d4d9f92d87ad865417b692ac376f4dc33","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"date":"2025-06-13 20:48:39.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"319c7ee1233b88cf17c4874b3c8330fc6f47f7ee","tag":"autogenerated:zuul:check","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2025-06-13 21:48:09.000000000","message":"Patch Set 1: Verified-1\n\n(2 comments)\n\nBuild failed (check pipeline).  For information on how to proceed, see\nhttps://docs.opendev.org/opendev/infra-manual/latest/developers.html#automated-testing\nand https://docs.openstack.org/project-team-guide/testing.html#how-to-handle-test-failures\n\nhttps://zuul.opendev.org/t/openstack/buildset/f05680043dd84e979544859437270672\n\n- openstack-tox-docs https://zuul.opendev.org/t/openstack/build/dccca5b887cc4deba589f458b99369a5 : SUCCESS in 10m 06s\n- grenade https://zuul.opendev.org/t/openstack/build/b63fd9d2c77d415ba74941113cbd4a80 : SUCCESS in 40m 12s\n- grenade-skip-level-always https://zuul.opendev.org/t/openstack/build/bbe00c59154c48a1abf433a120344d7c : SUCCESS in 33m 34s\n- tempest-integrated-object-storage https://zuul.opendev.org/t/openstack/build/d09e01ac66f14f968dd86e1f3d2ecdfc : SUCCESS in 30m 11s\n- openstacksdk-functional-devstack https://zuul.opendev.org/t/openstack/build/0379df46cbfd49b0afd0df48ae5263d4 : SUCCESS in 31m 27s\n- swift-tox-func-py39-centos-9-stream-fips https://zuul.opendev.org/t/openstack/build/9bc7c35795b44b119e8d166134e51e7e : FAILURE in 3m 42s (non-voting)\n- swift-tox-func-encryption-py39-centos-9-stream-fips https://zuul.opendev.org/t/openstack/build/122748ddb9884621a571bc4fc50a62ce : FAILURE in 5m 48s (non-voting)\n- swift-tox-func-ec-py39-centos-9-stream-fips https://zuul.opendev.org/t/openstack/build/207e7e1553b54a62a172b533b1bd4b89 : FAILURE in 5m 44s (non-voting)\n- swift-build-image https://zuul.opendev.org/t/openstack/build/478b41758b18410ba5bf2d46d1b2d769 : SUCCESS in 4m 31s (non-voting)\n- swift-tox-py37 https://zuul.opendev.org/t/openstack/build/c9dc027740df433f86ea33f0782059cb : FAILURE in 16m 54s\n- swift-tox-py39 https://zuul.opendev.org/t/openstack/build/92605ee0bca4426c846394ad06042568 : FAILURE in 16m 51s\n- swift-tox-py312 https://zuul.opendev.org/t/openstack/build/d0c4c98bac6840ccb7acfd9017c13de6 : FAILURE in 16m 55s\n- swift-tox-py313 https://zuul.opendev.org/t/openstack/build/a55c90ee95d94c628aa13805511394a8 : FAILURE in 19m 37s\n- swift-tox-func-py312 https://zuul.opendev.org/t/openstack/build/2074fb6f8f4f4372a3a9ec40b9d1892d : FAILURE in 3m 27s\n- swift-tox-func-encryption-py312 https://zuul.opendev.org/t/openstack/build/db7b93ee18694db994aacf510696c82b : FAILURE in 3m 20s\n- swift-tox-func-ec-py312 https://zuul.opendev.org/t/openstack/build/498b301ef887466e80a38c22091973e9 : FAILURE in 3m 19s\n- swift-func-cors https://zuul.opendev.org/t/openstack/build/ffd8aef4f7924c19833ab10a443b46b7 : SUCCESS in 5m 14s\n- swift-tox-func-ceph-s3tests-tempauth https://zuul.opendev.org/t/openstack/build/acd402e2f0634ef2b117309d461ac62a : SUCCESS in 13m 05s (non-voting)\n- swift-tox-func-s3api-compat-tests-tempauth https://zuul.opendev.org/t/openstack/build/6ea7337ae8e44c24a5441b104b0fc6da : SUCCESS in 6m 35s\n- swift-probetests-centos-9-stream https://zuul.opendev.org/t/openstack/build/7770dcfb54be4addbd47242e000ad0c1 : SUCCESS in 54m 50s\n- swift-dsvm-functional https://zuul.opendev.org/t/openstack/build/a231acf7522b4558a03fcd307a0c4caf : SUCCESS in 48m 11s\n- swift-dsvm-functional-ipv6 https://zuul.opendev.org/t/openstack/build/61292a2594ba4be684322de7301585a2 : SUCCESS in 49m 45s\n- swift-tox-lower-constraints https://zuul.opendev.org/t/openstack/build/aa9792eaaf79444c9f66f976d31238f9 : FAILURE in 14m 55s\n- openstack-tox-pep8 https://zuul.opendev.org/t/openstack/build/c8ed96bb73154962a1316b3b94a8133d : FAILURE in 3m 27s\n- swift-multinode-rolling-upgrade https://zuul.opendev.org/t/openstack/build/15c57368e4a7473dbdb5dce41314ba03 : SUCCESS in 19m 15s\n- tempest-integrated-object-storage-ubuntu-jammy https://zuul.opendev.org/t/openstack/build/b65c4d61781f49abbfe6608c7796d3d5 : SUCCESS in 37m 13s\n- tempest-ipv6-only https://zuul.opendev.org/t/openstack/build/fbcb1925fae34d63803eb764abcd43b4 : SUCCESS in 32m 52s","accounts_in_message":[],"_revision_number":1},{"id":"44ba30e5e1a37ea238b52752409e949dc2049156","tag":"autogenerated:zuul:check-arm64","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2025-06-13 22:01:02.000000000","message":"Patch Set 1:\n\nBuild failed (ARM64 pipeline).\nhttps://zuul.opendev.org/t/openstack/buildset/33316a64d72e442cab8657c78f6c12dc\n\n- swift-tox-py312-arm64 https://zuul.opendev.org/t/openstack/build/411905e7f0d84439852f06703f4db3fa : FAILURE in 1h 10m 50s","accounts_in_message":[],"_revision_number":1},{"id":"63588974216a95d827e30294550ad38268022a43","author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"date":"2025-06-18 18:17:20.000000000","message":"Patch Set 1:\n\n(6 comments)","accounts_in_message":[],"_revision_number":1},{"id":"8e204065a856c307918fcafff5ea749f52d0205f","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"date":"2025-08-01 00:37:50.000000000","message":"Uploaded patch set 2.\n\nOutdated Votes:\n* Verified-1\n","accounts_in_message":[],"_revision_number":2},{"id":"3c1d2ef871c0b29d6754cf879744101a8f2f685e","tag":"autogenerated:zuul:check-arm64","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2025-08-01 01:21:38.000000000","message":"Patch Set 2:\n\nBuild succeeded (ARM64 pipeline).\nhttps://zuul.opendev.org/t/openstack/buildset/11ffcdee1054406a8c7c4ee28792a4c1\n\n- swift-tox-py312-arm64 https://zuul.opendev.org/t/openstack/build/ec2fd9f4210e4f1f8c1d59bb8936a73d : SUCCESS in 41m 34s","accounts_in_message":[],"_revision_number":2},{"id":"d5fd7e18451e8b1d3e20bd17c89c46aa5cdc7a80","author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"date":"2025-08-01 01:25:14.000000000","message":"Patch Set 2:\n\n(8 comments)","accounts_in_message":[],"_revision_number":2},{"id":"b0e6590e3b4dd593dbfe899f8203bd01769e63f7","tag":"autogenerated:zuul:check","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2025-08-01 01:47:45.000000000","message":"Patch Set 2: Verified-1\n\nBuild failed (check pipeline).  For information on how to proceed, see\nhttps://docs.opendev.org/opendev/infra-manual/latest/developers.html#automated-testing\nand https://docs.openstack.org/project-team-guide/testing.html#how-to-handle-test-failures\n\nhttps://zuul.opendev.org/t/openstack/buildset/033d5c61df1e4ef8851b54de58cd6fe5\n\n- openstack-tox-docs https://zuul.opendev.org/t/openstack/build/da062b86349a441a89fef05dc63d0f23 : SUCCESS in 9m 56s\n- grenade https://zuul.opendev.org/t/openstack/build/2b235ce41b514478a4e4b3639c823558 : SUCCESS in 59m 18s\n- grenade-skip-level-always https://zuul.opendev.org/t/openstack/build/a5f2b753e6854cb19920a13d406e6288 : SUCCESS in 1h 04m 23s\n- tempest-integrated-object-storage https://zuul.opendev.org/t/openstack/build/922a2bc694874838bfec2142fd59b072 : SUCCESS in 53m 37s\n- openstacksdk-functional-devstack https://zuul.opendev.org/t/openstack/build/f376dc4fbfd84f8e8bdf8f9ba64090ec : SUCCESS in 1h 00m 54s\n- swift-tox-func-py39-centos-9-stream-fips https://zuul.opendev.org/t/openstack/build/51d24eed7b714c948dc980cf745a207c : SUCCESS in 19m 21s (non-voting)\n- swift-tox-func-encryption-py39-centos-9-stream-fips https://zuul.opendev.org/t/openstack/build/ac4c7a491922412a8ce62beb7c38e1fe : SUCCESS in 20m 03s (non-voting)\n- swift-tox-func-ec-py39-centos-9-stream-fips https://zuul.opendev.org/t/openstack/build/3c64e24bb37a4106ab9e1134d60c83b2 : SUCCESS in 19m 58s (non-voting)\n- swift-build-image https://zuul.opendev.org/t/openstack/build/e2dcd55bcdaa45758aa784583e1c89d7 : SUCCESS in 4m 56s (non-voting)\n- swift-tox-py37 https://zuul.opendev.org/t/openstack/build/b0f61665c7f4429ea717727c2eb6ef89 : SUCCESS in 21m 07s\n- swift-tox-py39 https://zuul.opendev.org/t/openstack/build/249bc9bd9101411ea57a2e1151c68ab3 : SUCCESS in 20m 19s\n- swift-tox-py312 https://zuul.opendev.org/t/openstack/build/1d7884e0fef24b3d95a8075874c4e877 : SUCCESS in 27m 43s\n- swift-tox-py313 https://zuul.opendev.org/t/openstack/build/d1ffadf41f3b47d5a55454b2a0f0a10b : SUCCESS in 29m 14s\n- swift-tox-func-py312 https://zuul.opendev.org/t/openstack/build/af3829dc663d4157b49221d7d57c79f4 : SUCCESS in 14m 37s\n- swift-tox-func-encryption-py312 https://zuul.opendev.org/t/openstack/build/5be08c3cada845879e4853bd193433f7 : SUCCESS in 15m 31s\n- swift-tox-func-ec-py312 https://zuul.opendev.org/t/openstack/build/ad54a0e906da4bddaaf2e519ccb0cc51 : SUCCESS in 14m 50s\n- swift-func-cors https://zuul.opendev.org/t/openstack/build/8e88789ecfb942f3a9cabe2e11b42934 : SUCCESS in 5m 28s\n- swift-tox-func-ceph-s3tests-tempauth https://zuul.opendev.org/t/openstack/build/dc778e90d846461caba100cea3dfc07a : SUCCESS in 15m 24s (non-voting)\n- swift-tox-func-s3api-compat-tests-tempauth https://zuul.opendev.org/t/openstack/build/51a00bb133234a049e3acf04032ef35d : SUCCESS in 8m 51s\n- swift-probetests-centos-9-stream https://zuul.opendev.org/t/openstack/build/55ea224aaaa14f0596156173932ae0d7 : SUCCESS in 50m 21s\n- swift-dsvm-functional https://zuul.opendev.org/t/openstack/build/9170408319114af88c3302cfb3d4caa7 : SUCCESS in 48m 40s\n- swift-dsvm-functional-ipv6 https://zuul.opendev.org/t/openstack/build/9ddc2eb0d1a842b499882a0f44d39a90 : SUCCESS in 45m 01s\n- swift-tox-lower-constraints https://zuul.opendev.org/t/openstack/build/21e91cbe23d64fedb7a5204dae3314f3 : SUCCESS in 20m 12s\n- openstack-tox-pep8 https://zuul.opendev.org/t/openstack/build/344e47e2affd4a1994bb4ebbccd45712 : FAILURE in 4m 04s\n- swift-multinode-rolling-upgrade https://zuul.opendev.org/t/openstack/build/dff415f13548443888a5aaf38d3628f8 : SUCCESS in 8m 26s\n- tempest-integrated-object-storage-ubuntu-jammy https://zuul.opendev.org/t/openstack/build/430ed359ebf2438bbc0fe982caa583d5 : SUCCESS in 32m 46s\n- tempest-ipv6-only https://zuul.opendev.org/t/openstack/build/792c22fb0c7549439140701b88806512 : SUCCESS in 40m 49s","accounts_in_message":[],"_revision_number":2}],"current_revision_number":2,"current_revision":"51c5cf5669371e20960d97f6eb9dad73dbed4ccf","revisions":{"c31514a5a821d4871f338f4e9ec0d7b9d4ee30c8":{"kind":"REWORK","_number":1,"created":"2025-06-13 20:48:39.000000000","uploader":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"ref":"refs/changes/13/952613/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/swift","ref":"refs/changes/13/952613/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/swift refs/changes/13/952613/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/swift refs/changes/13/952613/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/swift refs/changes/13/952613/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/swift refs/changes/13/952613/1"}}},"commit":{"parents":[{"commit":"b89ee3acd988c29df1ba1ce1542f2843388bb168","subject":"ring: Introduce a v2 ring format","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/swift/commit/b89ee3acd988c29df1ba1ce1542f2843388bb168"}]}],"author":{"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","date":"2025-04-18 13:44:44.000000000","tz":-300},"committer":{"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","date":"2025-06-13 20:48:18.000000000","tz":-300},"subject":"Refactor ring.io","message":"Refactor ring.io\n\nI had a few goals while working on this branch:\n\n * validate I understand ringv2 well enough to debug/refactor/maintain\n   it if necessary\n * validate you can read a ringv2 with just a gzip.GzipFile (this\n   required adding the uncompressed_start hint for the index)\n * Develop a model that places boundaries between reading/writing gzip\n   files vs reading/writing the compressed structures of legacy/v1/v2\n   rings (and see if I could document those abstraction boundaries in\n   code; i.e. `RingGzReader/Writer` vs `RingCodec`)\n * Consolidate all the [de]serialization implementation behind a single\n   class interface (`RingData.load/save`) w/o bleeding implementation\n   logic outside of the new `ring.io` module.\n * Enforce a maximum amount of symmetry between read/write size, blob,\n   json, ring_table as well as `SectionReader/Writer` and\n   `open/create_section`.\n\nI think I achieved those goals.  Even if none of this code influences\nwhat eventually merges any further; the introduction of the\nuncompressed_start hint feels like a sufficient win.  I definitely\nlearned a lot about the proposed ringv2 implementation from the related\nchange by working through these changes.\n\nIn order for this change to be considered a \"working code\" alternative\nto the proposed ringv2 implementation from the related change it would\nneed to add a `RingGzReader.compressed_seek` to go with the\n`RingGzWriter.compressed_tell` - this would also make the\n`RingGzReader`\u0027s `gzip.GzipFile` useless and stand in contrast to my\noriginal goal of validating you can can use a normal `gzip.GzipFile` to\nread ringv2 since at that point we\u0027re dealing with raw zlib deflate\nblocks insted of gzip files.  Strangely on master we\u0027ve already\nabandoned this symmetry: we use a `gzip.GzipFile` in `RingData.save`, but\n`RingReader` just uses `zlib` w/ the auto WBIT\n\n\u003e Add 32 to windowBits to enable zlib and gzip decoding with automatic\nheader detection\n\n... so restoring the \"ignore gzip heders, use zlib directly, manually\nbuffer uncompressed data and allow seeking on the compressed stream\"\nbehaviors would actually take us back *closer* to master - even tho\nringv1 doesn\u0027t need any of that.\n\nIf the `RingCodec` abstractions make sense to anyone else to encapsulate\nthe various ring format [de]serialization separately from the\n`RingGzReader/Writer` - I DO think they\u0027d be significantly easier to\npull forward into a \"introduce a ring.io module\" pre-factor compared to\nthe proposed ringv2 implementation from the related change which grafts\nringv2 index/section/checksumming directly onto the `RingReader/Writer`\nclasses.  However it\u0027s un-proven if re-organizing the legacy/ringv1\n[de]serialization in a separate change would make it significantly\neasier to grok/review the new v2 `RingCodec` and it\u0027s\nrelated/supplemental: `SectionReader/Writer`, `LengthWrapper`, and\n`IndexEntry` classes - but it might help.\n\nAdditionally, this refactoring also raises some questions about\nout-of-tree ring extensibility (which I think has dubious value); but in\nmaking the `RingData` class serialization agnostic and limiting\n`RingGzReader/Writer` to ONLY gzip related concepts which consolidates\nall ringv2 index/section knowledge in the v2 `RingCodec` - it becomes\nless clear what you\u0027d subclass if you \"only\" want to \"add a new\nsection\".  Presumably you could extend the `IndexedSectionCodec`, but\nit\u0027s [de]serialize methods clearly encapsulate all the ringv2 handling\nincluding the index - so if out-of-tree ring extensibility is a clear\nuse-case and a strong requirement we\u0027d probably want to introduce an\nexplicit \"add_other_random_sections\" hook and re-consider the\nrelationship and plumbing of `RingData.from_dict` through\n`Ring._reload`.  FWIW, for forward compatibility when adding new in-tree\nsections there\u0027s no concern with either approach; `RingData` provides\nserialization agnostic defaults when loading from ringv1 (or ringv2 w/o\nnew sections) - and `Ring` still has to decides how to handle any new\ninterfaces when faced with anemic `RingData` (regardless of where it\ncame from).\n\nRelated-Change-Id: Ia0ac4ea2006d8965d7fdb6659d355c77386adb70\nChange-Id: Id2e4facc8610483a3677eb42ac2ded3f706dfe2a\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/swift/commit/c31514a5a821d4871f338f4e9ec0d7b9d4ee30c8"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/swift/commit/c31514a5a821d4871f338f4e9ec0d7b9d4ee30c8"}]},"branch":"refs/heads/master"},"51c5cf5669371e20960d97f6eb9dad73dbed4ccf":{"kind":"REWORK","_number":2,"created":"2025-08-01 00:37:50.000000000","uploader":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"ref":"refs/changes/13/952613/2","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/swift","ref":"refs/changes/13/952613/2","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/swift refs/changes/13/952613/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/swift refs/changes/13/952613/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/swift refs/changes/13/952613/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/swift refs/changes/13/952613/2"}}},"commit":{"parents":[{"commit":"f39133055fff953f69f6b7ea62c47127d5b5c9a5","subject":"Merge \"sharder: make gap and overlap warning logs shorter\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/swift/commit/f39133055fff953f69f6b7ea62c47127d5b5c9a5"}]}],"author":{"name":"Tim Burke","email":"tim.burke@gmail.com","date":"2022-03-18 05:30:40.000000000","tz":-420},"committer":{"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","date":"2025-08-01 00:37:40.000000000","tz":-300},"subject":"Alternative compatible v2 ring implementation","message":"Alternative compatible v2 ring implementation\n\nI had a few goals while working on this branch:\n\n * validate I understand ringv2 well enough to debug/refactor/maintain\n   it if necessary\n * validate you can read a ringv2 with just a gzip.GzipFile (this\n   required adding the uncompressed_start hint for the index)\n * Develop a model that places boundaries between reading/writing gzip\n   files vs reading/writing the compressed structures of legacy/v1/v2\n   rings (and see if I could document those abstraction boundaries in\n   code; i.e. `RingGzReader/Writer` vs `RingCodec`)\n * Consolidate all the [de]serialization implementation behind a single\n   class interface (`RingData.load/save`) w/o bleeding implementation\n   logic outside of the new `ring.io` module.\n * Enforce a maximum amount of symmetry between read/write size, blob,\n   json, ring_table as well as `SectionReader/Writer` and\n   `open/create_section`.\n\nI think I achieved those goals.  Even if none of this code influences\nwhat eventually merges any further; the introduction of the\nuncompressed_start hint feels like a sufficient win.  I definitely\nlearned a lot about the proposed ringv2 implementation from the related\nchange by working through these changes.\n\nIn order for this change to be considered a \"working code\" alternative\nto the proposed ringv2 implementation from the related change it would\nneed to add a `RingGzReader.compressed_seek` to go with the\n`RingGzWriter.compressed_tell` - this would also make the\n`RingGzReader`\u0027s `gzip.GzipFile` useless and stand in contrast to my\noriginal goal of validating you can can use a normal `gzip.GzipFile` to\nread ringv2 since at that point we\u0027re dealing with raw zlib deflate\nblocks insted of gzip files.  Strangely on master we\u0027ve already\nabandoned this symmetry: we use a `gzip.GzipFile` in `RingData.save`, but\n`RingReader` just uses `zlib` w/ the auto WBIT\n\n\u003e Add 32 to windowBits to enable zlib and gzip decoding with automatic\nheader detection\n\n... so restoring the \"ignore gzip heders, use zlib directly, manually\nbuffer uncompressed data and allow seeking on the compressed stream\"\nbehaviors would actually take us back *closer* to master - even tho\nringv1 doesn\u0027t need any of that.\n\nIf the `RingCodec` abstractions make sense to anyone else to encapsulate\nthe various ring format [de]serialization separately from the\n`RingGzReader/Writer` - I DO think they\u0027d be significantly easier to\npull forward into a \"introduce a ring.io module\" pre-factor compared to\nthe proposed ringv2 implementation from the related change which grafts\nringv2 index/section/checksumming directly onto the `RingReader/Writer`\nclasses.  However it\u0027s un-proven if re-organizing the legacy/ringv1\n[de]serialization in a separate change would make it significantly\neasier to grok/review the new v2 `RingCodec` and it\u0027s\nrelated/supplemental: `SectionReader/Writer`, `LengthWrapper`, and\n`IndexEntry` classes - but it might help.\n\nAdditionally, this refactoring also raises some questions about\nout-of-tree ring extensibility (which I think has dubious value); but in\nmaking the `RingData` class serialization agnostic and limiting\n`RingGzReader/Writer` to ONLY gzip related concepts which consolidates\nall ringv2 index/section knowledge in the v2 `RingCodec` - it becomes\nless clear what you\u0027d subclass if you \"only\" want to \"add a new\nsection\".  Presumably you could extend the `IndexedSectionCodec`, but\nit\u0027s [de]serialize methods clearly encapsulate all the ringv2 handling\nincluding the index - so if out-of-tree ring extensibility is a clear\nuse-case and a strong requirement we\u0027d probably want to introduce an\nexplicit \"add_other_random_sections\" hook and re-consider the\nrelationship and plumbing of `RingData.from_dict` through\n`Ring._reload`.  FWIW, for forward compatibility when adding new in-tree\nsections there\u0027s no concern with either approach; `RingData` provides\nserialization agnostic defaults when loading from ringv1 (or ringv2 w/o\nnew sections) - and `Ring` still has to decides how to handle any new\ninterfaces when faced with anemic `RingData` (regardless of where it\ncame from).\n\nRelated-Change-Id: Ia0ac4ea2006d8965d7fdb6659d355c77386adb70\nSigned-off-by: Clay Gerrard \u003cclay.gerrard@gmail.com\u003e\nChange-Id: Id2e4facc8610483a3677eb42ac2ded3f706dfe2a\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/swift/commit/51c5cf5669371e20960d97f6eb9dad73dbed4ccf"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/swift/commit/51c5cf5669371e20960d97f6eb9dad73dbed4ccf"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[{"rule_name":"gerrit~DefaultSubmitRule","status":"OK","labels":[{"label":"Verified","status":"MAY","applied_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}},{"label":"Code-Review","status":"MAY"},{"label":"Workflow","status":"MAY"}]}],"submit_requirements":[{"name":"Verified","description":"Verified in gate by CI","status":"UNSATISFIED","is_legacy":false,"submittability_expression_result":{"expression":"label:Verified\u003dMAX AND -label:Verified\u003dMIN","fulfilled":false,"status":"FAIL","passing_atoms":[],"failing_atoms":["label:Verified\u003dMAX","label:Verified\u003dMIN"],"atom_explanations":{"label:Verified\u003dMAX":"","label:Verified\u003dMIN":""}}},{"name":"Code-Review","description":"Code reviewed by core reviewer","status":"UNSATISFIED","is_legacy":false,"submittability_expression_result":{"expression":"label:Code-Review\u003dMAX AND -label:Code-Review\u003dMIN","fulfilled":false,"status":"FAIL","passing_atoms":[],"failing_atoms":["label:Code-Review\u003dMAX","label:Code-Review\u003dMIN"],"atom_explanations":{"label:Code-Review\u003dMAX":"","label:Code-Review\u003dMIN":""}}},{"name":"Workflow","description":"Approved for gate by core reviewer","status":"UNSATISFIED","is_legacy":false,"submittability_expression_result":{"expression":"label:Workflow\u003dMAX AND -label:Workflow\u003dMIN","fulfilled":false,"status":"FAIL","passing_atoms":[],"failing_atoms":["label:Workflow\u003dMAX","label:Workflow\u003dMIN"],"atom_explanations":{"label:Workflow\u003dMAX":"","label:Workflow\u003dMIN":""}}}]}
