8669 Commits

Author SHA1 Message Date
Romain LE DISEZ
d8821c75bd proxy-logging: add fields ttfb and pid
Change-Id: I1611e34846e586703e9d3709fa64e8df41f2d685
2020-01-27 15:54:52 -05:00
Zuul
742835a6ec Merge "New Object Versioning mode" 2020-01-27 09:16:22 +00:00
Zuul
cbfcf18d48 Merge "container-sync: Sync static links similar to how we sync SLOs" 2020-01-27 07:24:20 +00:00
Zuul
82b667706d Merge "Store normalized x-delete-at on PUT/POST" 2020-01-26 19:41:57 +00:00
Clay Gerrard
2759d5d51c New Object Versioning mode
This patch adds a new object versioning mode. This new mode provides
a new set of APIs for users to interact with older versions of an
object. It also changes the naming scheme of older versions and adds
a version-id to each object.

This new mode is not backwards compatible or interchangeable with the
other two modes (i.e., stack and history), especially due to the changes
in the namimg scheme of older versions. This new mode will also serve
as a foundation for adding S3 versioning compatibility in the s3api
middleware.

Note that this does not (yet) support using a versioned container as
a source in container-sync. Container sync should be enhanced to sync
previous versions of objects.

Change-Id: Ic7d39ba425ca324eeb4543a2ce8d03428e2225a1
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Co-Authored-By: Thiago da Silva <thiagodasilva@gmail.com>
2020-01-24 17:39:56 -08:00
Thiago da Silva
26ff2eb1cb container-sync: Sync static links similar to how we sync SLOs
This allows static symlinks to be synced before their target. Dynamic
symlinks could already be synced even if target object has not been
synced, but static links previously required that target object existed
before it can be PUT. Now, have container_sync middleware plumb in an
override like it does for SLO.

Change-Id: I3bfc62b77b247003adcee6bd4d374168bfd6707d
2020-01-24 17:15:57 -08:00
Zuul
9548111e24 Merge "Allow Timestamp comparisons against out-of-range values" 2020-01-24 23:37:15 +00:00
Zuul
cd40cb3e98 Merge "Allow bulk to fwd some headers at tar extraction" 2020-01-23 11:03:19 +00:00
Zuul
d3916312d3 Merge "More multi-char-delimiter func test coverage" 2020-01-22 22:50:04 +00:00
Zuul
fc7ef9b26b Merge "packaging: Build universal wheels" 2020-01-22 22:18:28 +00:00
Clay Gerrard
2be4716bc9 More multi-char-delimiter func test coverage
Change-Id: I4cad872ef97313ec19a8e4ef042696565a56d4c5
2020-01-22 12:37:21 -08:00
Zuul
02aea34c46 Merge "swift-account-audit: work with encryption" 2020-01-22 16:59:19 +00:00
Zuul
b7c1f8d149 Merge "py3: Fix formpost unicode filename issues" 2020-01-21 05:21:14 +00:00
Tim Burke
dad8fb7c3c packaging: Build universal wheels
Apparently this had been done for us previously? See also:
http://lists.openstack.org/pipermail/openstack-discuss/2020-January/012097.html

Change-Id: I27288f9e503f26827a8274d46b07c1330a21de10
2020-01-20 21:17:43 -08:00
Zuul
68924d920c Merge "Have slo tell the object-server that it wants whole manifests" 2020-01-18 13:31:32 +00:00
Tim Burke
7bba3ad04d Store normalized x-delete-at on PUT/POST
Change-Id: I81e5d49623e884def8b5f6cbbf82f9b0d667d64a
Closes-Bug: 1860149
2020-01-18 02:52:31 +00:00
Romain LE DISEZ
ff0753fe19 Allow bulk to fwd some headers at tar extraction
Whitelisted headers include X-Delete-At/X-Delete-After and all Object
metadata headers (X-Object-Meta-*)

Closes-Bug: 1857546
Change-Id: If5fb164693e395f89d57899fb8ab355f1e3f817c
2020-01-17 11:34:39 -08:00
Tim Burke
57ca3570e9 Allow Timestamp comparisons against out-of-range values
Prior to the related change, clients may have written down X-Delete-At headers
that are outside of the Timestamp range, for example.

Change-Id: Ib8ae7ebcbdb32e0aa58446bd1ef949e5e2f63e74
Related-Change: I23666ec8a067d829eaf9bfe54bd086c320b3429e
Related-Bug: 1821204
Partial-Bug: 1860149
2020-01-17 08:11:34 -08:00
Zuul
e92288bb61 Merge "account-server: Add test for leading delimiter" 2020-01-17 01:38:06 +00:00
Zuul
7eccca9344 Merge "Early-return on non-Swift get_info requests" 2020-01-17 00:06:14 +00:00
Tim Burke
0901464513 Clean up container-sync docs
Change-Id: I98ebe15353d675ca00fee387003bf6572ac385e6
2020-01-15 18:32:19 -08:00
Tim Burke
9483630ae1 py3: Fix formpost unicode filename issues
Previously, we took the native string filename attribute and put it
directly in the (WSGI string) PATH_INFO field. Now, we convert it to
a WSGI string first.

Change-Id: I30e3beb8707b88c36bd3cdc7a0887d069e943ba6
Closes-Bug: #1858259
2020-01-15 16:52:37 -08:00
Sean McGinnis
5b26b749b5
Drop use of unittest2
unittest2 was needed for Python version <= 2.6, so it hasn't been needed
for quite some time. See unittest2 note one:

https://docs.python.org/2.7/library/unittest.html

This drops unittest2 in favor of the standard unittest module.

Change-Id: I2e787cfbf1709b7f9c889230a10c03689e032957
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-01-12 03:13:41 -06:00
Zuul
a4f1078864 Merge "Allow reconciler to handle reserved names" 2020-01-07 03:01:36 +00:00
Zuul
e23a3eacb6 Merge "Make FakeSwift query param order agnostic" 2020-01-07 01:30:33 +00:00
Zuul
e32689a96d Merge "Deprecate per-service auto_create_account_prefix" 2020-01-07 01:30:20 +00:00
Clay Gerrard
6140190791 Make FakeSwift query param order agnostic
Apparently FakeSwift has always been persnickety about the order of
query params of registered responses and the app making the calls.
Since query params can often be converted to dictionaries the order of
the encoded params should be able to change without effecting the apps
dispatching of registered responses.

Change-Id: Ied68c9334201a7663e9c85f3bdaa5b0643d4b6db
2020-01-06 16:27:06 -06:00
Zuul
4edfec339e Merge "Fix the duplicated words issue like "the the "" 2020-01-06 19:50:35 +00:00
zhufl
47eb78897d Fix the duplicated words issue like "the the "
This is to fix the duplicated words issue, like:
  * "both of which which must be stripped off"
  * "In addition the the values set"
  and so on

Change-Id: Id3d84281f15815b4185c76874575e91a3589981b
2020-01-06 10:34:42 +08:00
Zuul
fb538a9afe Merge "sharding: Better-handle newlines in container names" 2020-01-05 20:02:30 +00:00
Clay Gerrard
b1178b4a96 Allow reconciler to handle reserved names
Change-Id: Ib918f10e95970b9f562b88e923c25608b826b83f
2020-01-05 10:04:05 -06:00
Clay Gerrard
4601548dab Deprecate per-service auto_create_account_prefix
If we move it to constraints it's more globally accessible in our code,
but more importantly it's more obvious to ops that everything breaks if
you try to mis-configure different values per-service.

Change-Id: Ib8f7d08bc48da12be5671abe91a17ae2b49ecfee
2020-01-05 09:53:30 -06:00
Pete Zaitcev
0f13db30b6 Import directly from the inside of the ring module
An odd thing happened: when my code did only
"from swift.common.ring import Ring", and nothing else,
the interpreter looped on the CPU.

The import from the top of the ring module is our standard
protocol for Ring. It causes no problem in places like
container updater or list_endpoints.py. It is a big
mystery why it causes Python 3.7.3 to loop, and only
in specific circumstances.

But we noticed that the recursive import is unnecesasry
in this case, so an obviously harmless fix exists.

Change-Id: I7373bbb0a50d090d6becf141e5832f8ae98381a4
2020-01-03 18:34:11 -06:00
Tim Burke
3f88907012 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
2020-01-03 16:04:57 -08:00
Zuul
f73a190837 Merge "Use less responses from handoffs" 2020-01-03 03:13:58 +00:00
Clay Gerrard
286082222d Use less responses from handoffs
Since we don't use 404s from handoffs anymore, we need to not let errors
on handoffs overwhelm primary responses either

Change-Id: I2624e113c9d945542f787e5f18f487bd7be3d32e
Closes-Bug: #1857909
2020-01-02 16:44:05 -08:00
Tim Burke
55ab08a5fa account-server: Add test for leading delimiter
Related-Change: I27701a31bfa22842c272b7781738e8c546b82cbc
Related-Change: If912f71d8b0d03369680374e8233da85d8d38f85
Change-Id: I0c850b8ae40d1ab477d0f5d18f92579c457da54e
Related-Bug: 1475018
2020-01-02 16:26:18 -08:00
Tim Burke
e8b654f318 Have slo tell the object-server that it wants whole manifests
Otherwise, we waste a request on some 416/206 response that won't be
helpful.

To do this, add a new X-Backend-Ignore-Range-If-Metadata-Present header
whose value is a comma-separated list of header names. Middlewares may
include this header to tell object-servers to send the whole object
(rather than a 206 or 416) if *any* of the metadata are present.

Have dlo and symlink use it, too; it won't save us any round-trips, but
it should clean up some object-server logging.

Change-Id: I4ff2a178d0456e7e37d561109ef57dd0d92cbd4e
2020-01-02 15:48:39 -08:00
Zuul
7862ec7b8a Merge "sharder: quote() more Swift paths when logging" 2019-12-24 00:19:59 +00:00
Zuul
ca4e2fdc13 Merge "sharding: Tolerate blank limits when listing" 2019-12-23 17:52:08 +00:00
Zuul
360afea57e Merge "sharding: Let swift-manage-shard-ranges accept a relative path" 2019-12-23 16:51:02 +00:00
Tim Burke
40edf07ab3 sharding: Let swift-manage-shard-ranges accept a relative path
Previously, passing a relative path would confuse the ContainerBroker about
which DB files are available, leading to an IndexError when none were found.

Just call realpath() on whatever the user provided so we don't have to muck
with any of the broker code.

Change-Id: Icdf100dfcd006d975b49d151b99aa9272452d013
2019-12-20 21:36:07 +00:00
Tim Burke
a06c0a4757 sharder: quote() more Swift paths when logging
The lack of quoting gets extra troublesome with reserved names,
where messages get truncated.

Change-Id: I415901d3a8cd24cb3cedc72235292bb9d1705bbc
2019-12-20 06:57:29 +00:00
Tim Burke
d246bf20ed sharding: Tolerate blank limits when listing
Otherwise, we can 500 with

   ValueError: invalid literal for int() with base 10: ''

Change-Id: I35614aa4b42e61d97929579dcb16f7dfc9fef96f
2019-12-19 22:27:27 -08:00
Tim Burke
54312b0b79 py3: Clean up some needlessly-noisy tracebacks
Change-Id: I5b391664b9260c762bd122a92387084c0582a362
Related-Change: I5f3bc6416207cab2c7e3a77ee6689360b55990e7
2019-12-19 22:09:57 -08:00
Zuul
5e9d5d101a Merge "Fix type on py3" 2019-12-18 02:15:03 +00:00
Tim Burke
c94f625fe4 Forward-port stable-release changelog entries
Change-Id: Ib2df3ec683c1670cadba72d1fc0d666975f64aab
2019-12-17 15:11:36 -08:00
Tim Burke
226e2c1201 Fix type on py3
This shouldn't have any practical effect, since *any* False-y value for
chunk will give us the correct behavior, but let's be consistent in the
type used with that name.

Change-Id: I1928883792e7a9945f3731ddeea992d14882d679
2019-12-17 14:52:17 -08:00
Zuul
e890b0f0fc Merge "WSGI server workers must drop_privledges" 2019-12-16 18:48:43 +00:00
Tim Burke
1f7b97ec0f Add normalize_etag() helper function
... and drive-by a import rename

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Change-Id: I1eaf075ff9855cfa03e7991bdf33375b0e4397e6
2019-12-14 01:53:43 +00:00