swift/test/unit/obj
Tim Burke 4439c0d38f 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

Closes-Bug: 1856894
Cherry-Picked-From: Ie08f36e31a448a547468dd85911c3a3bc30e89f1
Change-Id: I5268a9282fa3b785427498188aff541679c1f915
2021-02-12 23:37:52 -06:00
..
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
common.py py3: port object auditor 2019-02-27 14:07:33 -06:00
test_auditor.py Use assertIn to check whether substring is in str 2019-04-16 08:56:36 +08:00
test_diskfile.py Merge "Remove invalid dict entries from hashes.pkl" 2019-06-17 20:38:45 +00:00
test_expirer.py Add more tests for async expirer 2019-05-22 16:24:05 -05:00
test_reconstructor.py ec: log durability of frags that fail to reconstruct 2019-08-20 22:23:00 -07:00
test_replicator.py Stop syncing empty suffixes list 2020-07-28 18:37:56 +00:00
test_server.py sharding: Better-handle newlines in container names 2021-02-12 23:37:52 -06:00
test_ssync.py py3: port ssync 2019-06-05 13:26:18 -07:00
test_ssync_receiver.py py3: port ssync 2019-06-05 13:26:18 -07:00
test_ssync_sender.py py3: port ssync 2019-06-05 13:26:18 -07:00
test_updater.py sharding: Better-handle newlines in container names 2021-02-12 23:37:52 -06:00