4764 Commits

Author SHA1 Message Date
Zuul
c51335d8c0 Merge "Fix test_parse_get_node_args" 2019-08-20 04:57:06 +00:00
Clay Gerrard
e921913065 Rename symlink method
Related-Change-Id: I179ea6180d31146bb947061c69b1807c59529ac8
Change-Id: I770ea1be25e339e5ce4341b532a1fff9e1373152
2019-08-19 11:06:32 -05:00
Tim Burke
74db367060 py3: Finish porting func tests
We were (indirectly) importing swiftclient (and therefore requests and
urllib3) before doing our eventlet monkey-patching. This would lead
boto3 (which digs an SSLContext out of urllib3) to trip RecursionErrors
on py3 similar to

   >>> from ssl import SSLContext, PROTOCOL_SSLv23
   >>> import eventlet
   >>> eventlet.monkey_patch(socket=True)
   >>> SSLContext(PROTOCOL_SSLv23).options |= 0
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/usr/lib/python3.6/ssl.py", line 465, in options
       super(SSLContext, SSLContext).options.__set__(self, value)
     File "/usr/lib/python3.6/ssl.py", line 465, in options
       super(SSLContext, SSLContext).options.__set__(self, value)
     File "/usr/lib/python3.6/ssl.py", line 465, in options
       super(SSLContext, SSLContext).options.__set__(self, value)
     [Previous line repeated 330 more times]
   RecursionError: maximum recursion depth exceeded while calling a Python object

Change-Id: I4bb59edd87336597791416c4f2a096efe0e72fe3
2019-08-16 20:34:16 -07:00
Zuul
9b4b57a880 Merge "py3: port SLO func tests" 2019-08-17 03:19:22 +00:00
Zuul
cf10f39102 Merge "Allow bulk delete of big SLO manifests" 2019-08-17 02:42:02 +00:00
Zuul
202a5d34eb Merge "dlo: Respond 200 on multi-range GETs" 2019-08-17 01:38:19 +00:00
Tim Burke
a21c0be70c dlo: Respond 200 on multi-range GETs
We already had a unit test for this, but it was inadvertently retesting
what test_get_suffix_range_many_segments tested.

Change-Id: I43eee7029ca884268c3f2ad74300b94b299fd8d2
Closes-Bug: #1831790
2019-08-16 16:35:34 -07:00
Tim Burke
7f42309a33 py3: Cover account/container func tests
Change-Id: I9a754f1eb06debbe16800a05fc8e969af2f89043
2019-08-16 10:51:55 -07:00
Tim Burke
1abc9c4f9d Allow "static symlinks"
... by embedding something like `If-Match: <etag>` semantics in the
symlink.

When creating a symlink, users may now specify an optional
X-Symlink-Target-Etag header. If present, the etag of the final object
returned to the client will be checked; if it does not match the
X-Symlink-Target-Etag header, a 409 Conflict error will be returned to
the client.

Note that, unlike "dynamic symlink" behavior, the target object must
exist with the matching Etag for the "static symlink" to be created.

Since we're validating the Etag anyway, we also set the content-type of
the symlink to match if the client didn't otherwise specifiy and send
the etag & content-length along to the container listing as well.

Bonus goodness:

- Tighten assertions on Content-Location
- Get rid of swift.source-sniffing by making versioned_writes
  symlink-aware ('cause I'm going to want to make it symlink-aware
  later anyway)
- Allow middlewares left of symlink to set their own
  Container-Update-Override-Etag when creating a symlink
- Set dynamic symlink content type if client doesn't supply something

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Change-Id: I179ea6180d31146bb947061c69b1807c59529ac8
2019-08-16 11:22:36 -05:00
Zuul
2a54619609 Merge "py3: port dlo func tests" 2019-08-16 13:48:41 +00:00
Tim Burke
3750285bc8 py3: fix up listings on sharded containers
We were playing a little fast & loose with types before; as a result,
marker/end_marker weren't quite working right. In particular, we were
checking whether a WSGI string was contained in a shard range, while
ShardRange assumes all comparisons are against native strings.

Now, get everything to native strings before making comparisons, and
get them back to wsgi when we shove them in the params dict.

Change-Id: Iddf9e089ef95dc709ab76dc58952a776246991fd
2019-08-15 12:34:02 -07:00
Zuul
a2a1ebe7a3 Merge "py3: fix object-replicator rsync output parsing" 2019-08-15 04:51:03 +00:00
Zuul
8083255e34 Merge "py3: mostly port s3 func tests" 2019-08-15 01:10:29 +00:00
Zuul
6e84553318 Merge "py3: port test/functional/test_versioned_writes.py" 2019-08-14 22:17:03 +00:00
Zuul
83c033106f Merge "Add params to get_*_metadata internal client methods" 2019-08-14 20:14:54 +00:00
Zuul
61881797c7 Merge "s3api: Translate 503 to S3-style 503s" 2019-08-14 18:26:01 +00:00
Thiago da Silva
47c7058259 Add params to get_*_metadata internal client methods
Change-Id: I1d2d063904447a444ecb506b93ee698a5181b6b9
2019-08-14 16:13:25 +02:00
Samuel Merritt
cb30811916 Allow bulk delete of big SLO manifests
If you set SLO's max_manifest_segments to a value larger than 10000,
then clients are able to create manifests with that many segments, but
unable to use "?multipart-manifest=delete" to delete them.

This is because the SLO middleware has its very own bulk-deleter that
it uses to handle such requests, and that bulk-deleter only allows
10000 deletions per request by default. This commit removes the
limitation so that any SLO manifest can be deleted along with its
segments.

I considered setting max-deletes-per-request to be equal to SLO's
max_manifest_segments, but that only works if max_manifest_segments
has never been decreased.

Note that this commit does not increase max_manifest_segments. Clients
cannot make SLOs any bigger than they could before. Also note that
this commit does not affect user-initiated bulk deletes, i.e. POST
requests with "?bulk-delete=true" set. Those requests are still
limited in their size, and those limits are not changed.

Change-Id: I6a35937e8418f4f2b8e29825fc9c40415e34742f
Closes-Bug: 1746685
2019-08-13 16:51:50 -07:00
Zuul
ff62cff01b Merge "Allow Connection: value to be case-insensitive" 2019-08-10 03:57:34 +00:00
Tim Burke
227fe30251 py3: port test/functional/test_versioned_writes.py
Change-Id: I8c2517599a6d1cdf68050dc7acb039f09875fd53
2019-08-09 22:04:55 -05:00
Tim Burke
f05119c16f py3: mostly port s3 func tests
test_bucket.py is proving somewhat problematic.

Change-Id: I5b337ef66a23fc989762801dd6a5ba1ed903f57b
2019-08-09 16:09:55 -07:00
Pete Zaitcev
c90365f98d Allow Connection: value to be case-insensitive
Proxies and LBs parse the Connection: header and re-insert
the value with random casing. This occurs when we run functional
tests against realistic clusters.

Change-Id: Icb0d3e3708949127e9750f2022de8c74ce51ebe9
2019-08-09 15:06:47 -05:00
Zuul
394d4655fa Merge "slo: Add X-Manifest-Etag to responses" 2019-08-09 17:21:47 +00:00
Zuul
96ece6e18e Merge "py3: Add swift-tox-func-encryption-py37 gate job" 2019-08-09 08:19:36 +00:00
Tim Burke
3ee6de408e slo: Add X-Manifest-Etag to responses
This matches the ETag of the underlying swift object, as opposed to the
MD5-of-MD5s that is the large object's ETag.

Change-Id: Ifab726f63739f62aeef495c970939410341694d1
2019-08-08 14:20:05 -07:00
Tim Burke
7c74dbd255 py3: port dlo func tests
Drive-by: fix an issue where tf.config wasn't initialized when we decide
whether to skip test_dlo_referer_on_segment_container.

Change-Id: Iad8b3ab40dccb23847cde5c09f55627da0963fe0
2019-08-07 16:23:59 -07:00
Zuul
8d3d21e668 Merge "py3: port RBAC func tests" 2019-08-07 22:10:07 +00:00
Tim Burke
7bb7da6d2d s3api: Translate 503 to S3-style 503s
...instead of logging tracebacks about unexpected status codes.

Change-Id: Iadb0a40092b8347eb5c04785cc14d1324cc9396f
2019-08-06 14:52:54 -07:00
Tim Burke
2c727f65ff py3: Add swift-tox-func-encryption-py37 gate job
Change-Id: Ia9ae0fc226dfc9b40157faebac100c10a9180c62
2019-08-06 13:56:47 -07:00
Tim Burke
a48dd1950d Allow non-default domain to be used in func tests
Change-Id: I7afa7e367103bb9caaf74788a49cd055eca53cf6
2019-08-05 15:37:19 -07:00
Tim Burke
2e4c8a924e py3: port RBAC func tests
Yes, it really is just the import.

Change-Id: Id7e2891b6600af102176eaa2e87f81b528adde8d
2019-08-05 14:47:51 -07:00
Clay Gerrard
ab19241534 Increase node_timeout for real sever unittests
I saw an encryption test fail with 10s node timeout when the py36
unittests ran in the gate.  I believe there is an outsized potential for
a beneficial increase in test reliability when run in the gate compared
to relatively small chance of any negative side-effect in test failure
responsiveness.

Change-Id: Ia31912828d416d84c39782222e4636a97a8bfe44
2019-08-05 15:40:58 -05:00
Zuul
a9a57c7d54 Merge "Make GreenAsyncPile not hang" 2019-08-02 21:16:54 +00:00
Clay Gerrard
25aeb0ca49 Make GreenAsyncPile not hang
It's probably weird that StreamingPile has this interfaces that swallows
exceptions, but this seems better than hanging.

Change-Id: I8fe45c0f0d291efc84f3edf5d6b7cd116b5c7835
2019-08-02 08:19:41 -07:00
Zuul
9aaae58bdd Merge "Ignore 404s from handoffs for objects when calculating quorum" 2019-08-02 13:17:54 +00:00
Zuul
b7b80f3a8a Merge "Negative test for non-empty chunked put symlink" 2019-08-02 05:48:04 +00:00
Zuul
5260e74161 Merge "symlink: Allow symlinks to be created via chunk-encoded PUTs" 2019-08-02 04:17:00 +00:00
Tim Burke
f1b44b199a s3api: paginate listings when aborting MPUs
Even when your cluster's configured funny, like your
container_listing_limit is too low, or your max_manifest_segments and
max_upload_part_num are too high, an abort should (attempt to) clean up
*all* segments.

Change-Id: I5a57f919cc74ddb08bbb35a7d852fbc1457185e8
2019-08-01 20:54:51 -07:00
Tim Burke
3189410f9d Ignore 404s from handoffs for objects when calculating quorum
We previously realized we needed to do that for accounts and containers
where the consequences of treating the 404 as authoritative were more
obvious: we'd cache the non-existence which prevented writes until it
fell out of cache.

The same basic logic applies for objects, though: if we see

    (Timeout, Timeout, Timeout, 404, 404, 404)

on a triple-replica policy, we don't really have any reason to think
that a 404 is appropriate. In fact, it seems reasonably likely that
there's a thundering-herd problem where there are too many concurrent
requests for data that *definitely is there*. By responding with a 503,
we apply some back-pressure to clients, who hopefully have some
exponential backoff in their retries.

The situation gets a bit more complicated with erasure-coded data, but
the same basic principle applies. We're just more likely to have
confirmation that there *is* data out there, we just can't reconstruct
it (right now).

Note that we *still want to check* those handoffs, of course. Our
fail-in-place strategy has us replicate (and, more recently,
reconstruct) to handoffs to maintain durability; it'd be silly *not* to
look.

UpgradeImpact:
--------------
Be aware that this may cause an increase in 503 Service Unavailable
responses served by proxy-servers. However, this should more accurately
reflect the state of the system.

Co-Authored-By: Thiago da Silva <thiagodasilva@gmail.com>
Change-Id: Ia832e9bab13167948f01bc50aa8a61974ce189fb
Closes-Bug: #1837819
Related-Bug: #1833612
Related-Change: I53ed04b5de20c261ddd79c98c629580472e09961
Related-Change: Ief44ed39d97f65e4270bf73051da9a2dd0ddbaec
2019-08-01 14:07:39 -07:00
Clay Gerrard
7678e94a2c Negative test for non-empty chunked put symlink
Change-Id: I0c3a235b8905e02d2e202215f7f0b43db295b79b
Related-Change-Id: I66f2f16d7cf0b9cb0888e3b9b1a17b9112233d21
2019-08-01 09:34:03 -05:00
Zuul
d33e569bee Merge "py3: Fix title-casing in HeaderKeyDict" 2019-07-30 08:13:26 +00:00
Tim Burke
a1455b3a35 symlink: Allow symlinks to be created via chunk-encoded PUTs
... provided they're still zero bytes.

Change-Id: I66f2f16d7cf0b9cb0888e3b9b1a17b9112233d21
2019-07-26 21:40:37 -07:00
Tim Burke
71f83963c2 py3: fix non-ascii metadata handling in account-server
Previously, we were storing the WSGI-style UTF-8-bytes-decoded-as-Latin-1
strings in the JSON field, and sending them back to eventlet directly.
If running in a mixed py2/py3 cluster, replication would eventually get
that back to the py2 server, and worse, the native-string version would
get back to the py3 server! Then on GET or HEAD, eventlet would barf
if any characters were outside the Latin-1 range.

Closes-Bug: #1837805
Change-Id: I31d942e72fd7bfbb1db4dbb1dd522dff69969e5d
2019-07-25 14:16:56 -07:00
Tim Burke
60c27d3aef py3: Fix title-casing in HeaderKeyDict
Change-Id: I1152c47c52f6482ec877142c96845b00bf6dcc5b
Related-Change: I130ba5014b7eff458d87ab29eb42fe45607c9a12
2019-07-25 12:55:03 -07:00
Tim Burke
a48104c545 py3: port SLO func tests
Drive-by: remove some py2/py3 code branches where encoding/decoding
should always succeed.

Change-Id: Iabfa157f2b20e6fd650a441e9c0f6163478ce147
2019-07-22 15:02:37 +01:00
Tim Burke
ef5a37c2bf slo: Better handle non-manifest responses when refetching manifest
Previously, we never checked whether the response we get when refetching
is even successful, much less whether it's still coming from an SLO.

Now, if the refetched data is newer, act on it. If it's older, 503.

Closes-Bug: #1837270
Change-Id: I106b94c77da220c762869aa800c31b87c3dffeeb
2019-07-19 21:42:43 -07:00
Thomas Goirand
12a7b42062 Fix test_parse_get_node_args
Looks like xattr_supported_check was missing ERANGE

Change-Id: I82263e48e836f38f77d81593c8435f64a4728b5d
2019-07-19 01:32:25 +02:00
Tim Burke
2926fc96a3 py3: Bring functional/test_object.py under test; add func-ec-py37 job
Change-Id: I2929ce1f8e08ae5b4059605d09189c8521852423
2019-07-18 14:04:39 -07:00
Tim Burke
ebf561026f py3: fix object-replicator rsync output parsing
Change-Id: I07707e99e4232b2cbe14986b958ce43c003a1ab6
2019-07-16 11:04:39 -07:00
Zuul
4643412bd1 Merge "func tests: tolerate more 404s when deleting" 2019-07-13 01:03:59 +00:00