8374 Commits

Author SHA1 Message Date
Tim Burke
a48ac28efe Authors/changelog for 2.22.0
Change-Id: I09c099339d02943baa0944b5a208263536d1a547
2.22.0
2019-07-15 18:12:57 +00:00
Zuul
4643412bd1 Merge "func tests: tolerate more 404s when deleting" 2019-07-13 01:03:59 +00:00
Zuul
cf18e1f47b Merge "sharding: Cache shard ranges for object writes" 2019-07-13 00:34:06 +00:00
Zuul
d147ab84e0 Merge "reconciler: Enqueue right work for shard containers" 2019-07-12 23:13:13 +00:00
Zuul
1e079cdfc5 Merge "py3: Fix header_to_environ_key" 2019-07-12 23:13:11 +00:00
Zuul
b202292338 Merge "Move calls to self.app outside of error handling" 2019-07-12 22:12:28 +00:00
Zuul
f03b03861a Merge "functests: Make test_PUT_metadata less flakey" 2019-07-11 23:19:35 +00:00
Tim Burke
a1af3811a7 sharding: Cache shard ranges for object writes
Previously, we issued a GET to the root container for every object PUT,
POST, and DELETE. This puts load on the container server, potentially
leading to timeouts, error limiting, and erroneous 404s (!).

Now, cache the complete set of 'updating' shards, and find the shard for
this particular update in the proxy. Add a new config option,
recheck_updating_shard_ranges, to control the cache time; it defaults to
one hour. Set to 0 to fall back to previous behavior.

Note that we should be able to tolerate stale shard data just fine; we
already have to worry about async pendings that got written down with
one shard but may not get processed until that shard has itself sharded
or shrunk into another shard.

Also note that memcache has a default value limit of 1MiB, which may be
exceeded if a container has thousands of shards. In that case, set()
will act like a delete(), causing increased memcache churn but otherwise
preserving existing behavior. In the future, we may want to add support
for gzipping the cached shard ranges as they should compress well.

Change-Id: Ic7a732146ea19a47669114ad5dbee0bacbe66919
Closes-Bug: 1781291
2019-07-11 10:40:38 -07:00
zengjia
0ae1ad63c1 Update auth_url in install docs
Beginning with the Queens release, the keystone install guide
recommends running all interfaces on the same port.This patch
updates the swift install guide to reflect that change

Change-Id: Id00cfd2c921da352abdbbbb6668b921f3cb31a1a
Closes-bug: #1754104
2019-07-11 15:03:16 +08:00
Tim Burke
f4bb1bea28 reconciler: Enqueue right work for shard containers
This fixes newly-enqueued work going forward, but doesn't offer anything
to try to parse existing bad work items or even to kick shards so they
reset their reconciler high-water marks.

Change-Id: I79d20209cea70a6447c4e94941e5e854889cbec5
Closes-Bug: 1836082
2019-07-10 23:48:39 -07:00
Zuul
e62f07d988 Merge "py3: port staticweb and domain_remap func tests" 2019-07-11 05:40:19 +00:00
Zuul
7e95e3d1ea Merge "Run all func tests under py2 against services running py3" 2019-07-11 05:08:37 +00:00
Zuul
9367bff8fc Merge "py3: add swift-dsvm-functional-py3 job" 2019-07-11 05:01:59 +00:00
Tim Burke
c1d1702252 functests: Make test_PUT_metadata less flakey
Change-Id: I846e746c2fe7591a3ab502428f587e3cbe753225
2019-07-10 15:37:44 -07:00
Zuul
5c651ac451 Merge "functests: make container creation less flakey in test_object" 2019-07-10 21:26:48 +00:00
Zuul
733b82be33 Merge "container: Unify storage-policy error paths" 2019-07-10 18:54:29 +00:00
Tim Burke
9d1b749740 py3: port staticweb and domain_remap func tests
Drive-by: Tighten domain_remap assertions on listings, which required
that we fix proxy pipeline placement. Add a note about it to the sample
config.

Change-Id: I41835148051294088a2c0fb4ed4e7a7b61273e5f
2019-07-10 09:51:38 -07:00
Tim Burke
38a24571ad functests: make container creation less flakey in test_object
Change-Id: If62d82beb202dea553776920a95c177518b162ab
2019-07-10 09:13:44 -07:00
Zuul
1be4be810a Merge "py3: Be able to read and write non-ASCII headers" 2019-07-10 09:35:35 +00:00
Zuul
4ae412e13b Merge "Increase some middleware test coverage" 2019-07-10 04:39:07 +00:00
Zuul
71f1532a18 Merge "py3: Specify an encoding when loading db.pending pickles" 2019-07-10 03:37:26 +00:00
Zuul
392c967af5 Merge "container-replicator: Add a timeout for get_shard_ranges" 2019-07-08 22:20:25 +00:00
Tim Burke
4c4bd778ea container-replicator: Add a timeout for get_shard_ranges
Previously this had no timeout, which meant that the replicator might
hang and fail to make progress indefinitely while trying to receive
shard ranges.

While we're at it, only call get_shard_ranges when the remote indicates
that it has shard ranges for us to sync -- this reduces the number of
requests necessary to bring unsharded replicas in sync.

Change-Id: I32f51f42d76db38271442a261600089404a00f91
Closes-Bug: #1835260
2019-07-03 22:29:47 -07:00
Tim Burke
345f577ff1 s3token: fix conf option name
Related-Change: Ica740c28b47aa3f3b38dbfed4a7f5662ec46c2c4
Change-Id: I71f411a2e99fa8259b86f11ed29d1b816ff469cb
2019-07-03 07:28:36 -07:00
Zuul
dc84c69c65 Merge "Add information about secret_cache_duration to sample config" 2019-07-03 05:08:47 +00:00
Tim Burke
76fde89261 py3: Be able to read and write non-ASCII headers
Apparently Python's stdlib got more picky about what a header should
look like. As a result, if an account, container, or object had a
non-ASCII metadata name (values were fine), the proxy-server wouldn't
parse all of the headers. See https://bugs.python.org/issue37093 for
more information.

This presented several problems:
- Since the non-ASCII header aborts parsing, we may lose important
  HTTP-level information like Content-Length or Transfer-Encoding.
- Since the offending header wouldn't get parsed, the client wouldn't
  even know what the problem was.
- Even if the client knew what the bad header was, it would have no way
  to clear it, as the server uses the same logic to parse incoming
  requests.

So, hack in our own header parsing if we detect that parsing was
aborted. Note that we also have to mangle bufferedhttp's putheader so we
can get non-ASCII headers to the backend servers.

Now, we can run the test_unicode_metadata tests in
test/functional/test_account.py and test/functional/test_container.py
under py2 against services running under py3.

Change-Id: I0f03c211f35a9a49e047a5718a9907b515ca88d7
2019-07-03 02:01:55 +00:00
Tim Burke
4f7c44a9d7 Add information about secret_cache_duration to sample config
Related-Change-Id: Id0c01da6aa6ca804c8f49a307b5171b87ec92228
Change-Id: Ica740c28b47aa3f3b38dbfed4a7f5662ec46c2c4
2019-07-02 18:43:59 +00:00
Zuul
bf3e2548b3 Merge "s3api: add unit test case for s3acl" 2019-07-02 00:25:53 +00:00
Zuul
ed8500b339 Merge "s3api: Put more information in the str() for InternalError" 2019-07-01 21:24:05 +00:00
Zuul
adb0b324f7 Merge "Use get_container_info to check existence before container PUT" 2019-07-01 21:24:04 +00:00
Kota Tsuyuzaki
072b404513 s3api: add unit test case for s3acl
To clarify the corner case when Swift is over-loaded, or user-errors.

Change-Id: I41867290a63b329781dc7030f9f3ce0118e2032b
2019-07-01 09:21:56 -07:00
Zuul
672a555816 Merge "Fix invalid assert states" 2019-07-01 03:45:55 +00:00
zhufl
c46b88ab74 Fix invalid assert states
"self.assertTrue(policies[1].is_deprecated, True)" and
"self.assertTrue(crashy_calls[0], 1)" are not correct, this is
to fix them.

Change-Id: I7b07f0833d675d2939c910f679b54da2b8cda482
2019-07-01 09:20:02 +08:00
Zuul
9d1f6bb57f Merge "Move call to global_conf_callback after loadapp()" 2019-06-29 01:29:51 +00:00
Tim Burke
88cec2c396 s3api: Put more information in the str() for InternalError
There are few things more frustrating when digging through a log than
finding a traceback that ends with

    raise InternalError('unexpected status code %d' % status)

while having no indication of what the status code was.

Change-Id: I08e9f7c0643ae0469bd1937a30c1c4477b67c31f
2019-06-27 12:32:09 -07:00
Yuxin Wang
e02b9b7980 Use get_container_info to check existence before container PUT
PUT request on an existing container will trigger an update on
container db. When disks where container db landed are under
heavy loads, update on the container db may fail due to LockTimout.

Hence, we first check existence, if it's not there, we PUT.

Change-Id: Ic61153948e35f1c09b05bfc97dfac3fb487b0898
Closes-Bug: 1780204
2019-06-26 17:01:00 -07:00
Clay Gerrard
044c919871 More tests for 404 handoff skipping
Sometimes we want 404, sometimes we want 503 - it's tricky

Change-Id: I30f5af07e2e1fc7cbb6bdb1c334a0a161caf0906
Related-Change-Id: I53ed04b5de20c261ddd79c98c629580472e09961
2019-06-25 13:42:26 -05:00
Clay Gerrard
563e1671cf Return 503 when primary containers can't respond
Closes-Bug: #1833612

Change-Id: I53ed04b5de20c261ddd79c98c629580472e09961
2019-06-25 12:23:12 -05:00
Clay Gerrard
82169ead1c Don't handle object without container
Closes-Bug: #1833616

Change-Id: I16ca1589abcea2bca942da7e97719286a8961ea6
2019-06-24 16:58:09 -05:00
Tim Burke
55b04d16c4 Run all func tests under py2 against services running py3
... at least, on the py3 dsvm job.

Depends-On: I0f03c211f35a9a49e047a5718a9907b515ca88d7
Change-Id: Ia783ae10344380eb5afd9d43273969b433962945
2019-06-21 22:37:32 -07:00
Tim Burke
39a54fecdc py3: add swift-dsvm-functional-py3 job
Note that keystone wants to stick some UTF-8 encoded bytes into
memcached, but we want to store it as JSON... or something?

Also, make sure we can hit memcache for containers with invalid UTF-8.
Although maybe it'd be better to catch that before we ever try memcache?

Change-Id: I1fbe133c8ec73ef6644ecfcbb1931ddef94e0400
2019-06-21 22:31:18 -07:00
Tim Burke
ff4459ed6b Move call to global_conf_callback after loadapp()
Otherwise, paste complains about not being able to interpolate values
into the replication_semaphore. As long as it gets dropped in before we
fork(), I think it's OK?

Closes-Bug: 1691075
Change-Id: Ib7e065c47871876786bcc9ff39737f5d1bb3c12c
2019-06-21 22:30:47 -07:00
Matthew Oliver
9f1ef35630 py3: Port the tempurl middleware
This patch ports the tempurl middleware over to PY3. We use
an "all-native" string model, where we convert WSGI strings
as soon as we see them. It helps to deal with HMAC.

Aaand, we fix formpost along the way. It _clearly_ was
doing a wrong thing, encoding the same body several times
if we had several keys. On py2 it wasn't noticeable, but
on py3 this breaks, because the bytes type cannot be encoded
again.

Change-Id: I69974cc8a39731c980b54137b799a36b2e63a44a
2019-06-20 12:41:50 -07:00
Zuul
d44a581cdd Merge "py3: port the test of locale" 2019-06-20 19:19:57 +00:00
Zuul
38e79890d1 Merge "Stop manually installing eventlet for our py3 tests" 2019-06-20 19:19:46 +00:00
Zuul
da08e208f6 Merge "s3api: stop adding etag quotes when there are already etag quotes" 2019-06-20 14:27:58 +00:00
Zuul
7d0c4aa9ee Merge "py3: Decode some things in s3api" 2019-06-20 07:57:42 +00:00
Zuul
026760c7d3 Merge "Stop sending non-UTF-8 prefixes in func tests" 2019-06-20 07:31:42 +00:00
Zuul
119e748ded Merge "Fix incorrect setting of symlink_target_account" 2019-06-20 02:09:09 +00:00
Zuul
d61f8fe80b Merge "Fix up how we memcache on py3" 2019-06-19 20:08:40 +00:00