Comment 3 for bug 1856894

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/699892
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=3f8890701259e24ef81c93947faf2d4ccf223c5f
Submitter: Zuul
Branch: master

commit 3f8890701259e24ef81c93947faf2d4ccf223c5f
Author: Tim Burke <email address hidden>
Date: Wed Dec 18 15:14:00 2019 -0800

    sharding: Better-handle newlines in container names

    Previously, if you were on Python 2.7.10+ [0], such a newline would cause the
    sharder to fail, complaining about invalid header values when trying to create
    the shard containers. On older versions of Python, it would most likely cause a
    parsing error in the container-server that was trying to handle the PUT.

    Now, quote all places that we pass around container paths. This includes:

      * The X-Container-Sysmeta-Shard-(Quoted-)Root sent when creating the (empty)
        remote shards
      * The X-Container-Sysmeta-Shard-(Quoted-)Root included when initializing the
        local handoff for cleaving
      * The X-Backend-(Quoted-)Container-Path the proxy sends to the object-server
        for container updates
      * The Location header the container-server sends to the object-updater

    Note that a new header was required in requests so that servers would
    know whether the value should be unquoted or not. We can get away with
    reusing Location in responses by having clients opt-in to quoting with
    a new X-Backend-Accept-Quoted-Location header.

    During a rolling upgrade,

      * old object-servers servicing requests from new proxy-servers will
        not know about the container path override and so will try to update
        the root container,
      * in general, object updates are more likely to land in the root
        container; the sharder will deal with them as misplaced objects, and
      * shard containers created by new code on servers running old code
        will think they are root containers until the server is running new
        code, too; during this time they'll fail the sharder audit and report
        stats to their account, but both of these should get cleared up upon
        upgrade.

    Drive-by: fix a "conainer_name" typo that prevented us from testing that
    we can shard a container with unicode in its name. Also, add more UTF8
    probe tests.

    [0] See https://bugs.python.org/issue22928

    Change-Id: Ie08f36e31a448a547468dd85911c3a3bc30e89f1
    Closes-Bug: 1856894