1428eb3b58e3b397250f19ac076afa0058487a47
6196 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
Jianjian Huo
|
ea1d84c1d7 |
Object-server: add periodic greenthread yielding during file write
Currently, when object-server serves PUT request and DiskFile writer write file chunks to disk, there is no explicit eventlet sleep called. When network outpace the slow disk IO, it's possible one large and slow PUT request could cause eventlet hub not to schedule any other green threads for a long period of time. To improve this, this patch enable the configurable yield parameter 'cooperative_period' into object server controller write path. Related-Change: I80b04bad0601b6cd6caef35498f89d4ba70a4fd4 Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Change-Id: I1c0aba9830433f093d024b4c39cd3a3b2f0d69f1 |
||
|
Zuul
|
0d9ea8d9bd | Merge "Add probe test for reconciler with object versioning" | ||
|
Zuul
|
51849df687 | Merge "Remove statds from the logs module" | ||
|
Alistair Coles
|
8699af83c9 |
Remove statds from the logs module
We would like to remove any Statsd related code from logs.py. That requires that SwiftLogAdapter no longer provides a StatsdClient interface by default. However, for backwards compatibility the main utils.get_logger/get_prefixed_logger entrypoints must provide a SwiftLogAdapter that does have a StatdsClient interface. The new utils._patch_statsd_methods helper function is therefore used to retrospectively patch a SwiftLogAdapter instance with the StatsdClient interface when necessary. The _patch_statsd_helper is used in get_logger, and again when we clone a logger in get_prefixed_logger. Co-Authored-By: Shreeya Deshpande <shreeyad@nvidia.com> Change-Id: I44694b92264066ca427bb96456d6f944e09b31c0 |
||
|
Alistair Coles
|
e751ccfb27 |
Add probe test for reconciler with object versioning
Verify that the reconciler is able to move objects to a container that has, or will have, versioning enabled, and versions of the moved object can subsequently be created. Change-Id: I019447614ebadbb9e2cc8a18c0369bc16a89c0d9 |
||
|
Zuul
|
447079399d | Merge "Add error msg validation for BadDigest" | ||
|
ashnair
|
41c614bbb5 |
Add error msg validation for BadDigest
Change-Id: I5c9af73cc66e17dc662d8c4d97cbf71ded1fed6f |
||
|
Clay Gerrard
|
4aadb54025 |
Ensure Content-Length in backend container/account HEAD response
A failing CORS test in the gate discovered that, when running with eventlet==0.38.0, container and account HEAD requests returned Content-Type of application/json to clients regardless of the requested format. This was due to the backend HEAD response no longer having a Content-Length header, causing the listing_formats middleware to not modify the returned Content-Type (see Related-Change). The Related-Change fixed the client facing issue by making listing_formats middleware ensure the correct Content-Type is returned to clients even when Content-Length is absent in the backend response. The Related-Change also ensured that the 204 response to clients always has a Content-Length header. This patch directly fixes the problem of backend account and container server HEADs no longer having 'Content-Length: 0' by adding it explicitly. This violates the RFC prohibition of a 204 response having a Content-Length header [1], but preserves Swift's historic behavior and is consistent with the proxy-server's 204 response to clients. [1] https://httpwg.org/specs/rfc7230.html#header.content-length Related-Change: If724485e1425d1481d10b9255436301e346f07e8 Change-Id: Idacc59c5f43367926eff5221ee7fc417a9bc2d50 |
||
|
Clay Gerrard
|
fa889358ac |
Ensure correct content-type in container HEAD response
A failing CORS test in the gate discovered that we were responding application/json to ?format=txt requests (which is maybe not even a valid value for that qs param?), but only when running with eventlet==0.38.0 This avoids the problem of backend container server HEADs no longer having 'Content-Length: 0' by fixing the client HEAD resp headers before we check for chunked-transfer resp. Drive-By: refactor listing_formats to use HeaderKeyDict and always set Content-Length explicitly Co-Authored-By: Alistair Coles <alistairncoles@gmail.com> Co-Authored-By: Matthew Oliver <matt@oliver.net.au> Change-Id: If724485e1425d1481d10b9255436301e346f07e8 |
||
|
Alistair Coles
|
ffbf17e47c |
Fix duplicate prefix in exception logging
This patch fixes a bug in the Related-Change that causes a prefix to be added twice at the start of an 'exception' log message. Previously, PrefixLoggerAdapter.exception would forward to the wrapped LogAdapter.exception, and not call back to PrefixLoggerAdapter.process. The prefix therefore needed to be added in both PrefixLoggerAdapter.exception and PrefixLoggerAdapter.process (for other log level methods). SwiftLogAdapter.exception *does* call back to SwiftLogAdapter.process, and so since the Related-Change it is not necessary to add the prefix in both the SwiftLogAdapter.exception and SwiftLogAdapter.process methods. Related-Change: I8988c0add6bb4a65cc8be38f0bf527f141aac48a Change-Id: Ia6e1f007989b0ef455b8dca8155b386a3fd9e8e1 |
||
|
Alistair Coles
|
66e4887c91 |
Rename probe/test_mixed_policy_upload.py to test_mpu.py
Give this test file a less specific name in anticipation of further mpu-related probe tests being added. Change-Id: Iea01928e1daad25f3425f486b9dda4c6fb58510c |
||
|
Zuul
|
aac4c14574 | Merge "Differentiate unlinks and outdated unlinks" | ||
|
Zuul
|
89815389d5 | Merge "probe tests: Set default timeout for subprocesses" | ||
|
Tim Burke
|
32fbf9eaae |
probe tests: Set default timeout for subprocesses
There's an upstream eventlet bug that seems to cause process hangs during an atexit hook; unfortunately, that means that every time we call "once" in probe tests, we can hang indefinitely waiting for a process that won't terminate. See https://github.com/eventlet/eventlet/issues/989 Now, wait with a timeout; if it pops, kill the offending process and hope for the best. Do this by patching out subprocess.Popen.wait, but only in probe tests -- this ensures that we won't impact any real systems, while also ensuring a broad coverage of probe tests (as opposed to, say, plumbing some new wait_timeout kwarg into all the Manager call sites). Closes-Bug: #2088027 Change-Id: I8983eafbb575d73d1654c354815a7de7ae141873 |
||
|
Zuul
|
71696d3a83 | Merge "Remove PrefixLoggerAdapter and SwiftLoggerAdapter" | ||
|
Shreeya Deshpande
|
f88efdb4df |
Remove PrefixLoggerAdapter and SwiftLoggerAdapter
In order to modernize swift's statsd configuration we're working to separate it from logging. This change is a pre-requisite for the Related-Change in order to simplfy the stdlib base logger instance wrapping in a single extended SwiftLogAdapter (previously LogAdapter) which supports all the features swift's servers/daemons need from our logger instance interface. Related-Change-Id: I44694b92264066ca427bb96456d6f944e09b31c0 Change-Id: I8988c0add6bb4a65cc8be38f0bf527f141aac48a |
||
|
Zuul
|
1d69f04d58 | Merge "probe tests: Run relinker via subprocess" | ||
|
Zuul
|
90f75e33b7 | Merge "reconciler: Record queue-clean-up later than old-policy-clean-up" | ||
|
Tim Burke
|
b262b16d55 |
probe tests: Run relinker via subprocess
Otherwise, test-run state (eventlet.tpool initialization, in particular) can bleed over and cause hangs. Closes-Bug: #2088026 Change-Id: I4f7dd0755b8dc8806d9b9046ac192d94ca705383 |
||
|
Tim Burke
|
3a43242e79 |
reconciler: Record queue-clean-up later than old-policy-clean-up
Previously, queue-clean-up would use the same timestamp/offset as the tombstone written down in the old policy to clean up now-moved data. This could lead to bad behaviors, as the reconciler-written tombstone could itself be enqueued to be reconciled, at the same timestamp. If that happened, replication would never bring the DB replicas to consistency, causing the reconciler to get different answers for whether there was work to do. Now, add an extra offset bump between the tombstone in the old policy and queue-clean-up. Also add an extra offset to the moved data in the new policy, to keep it one ahead of queue-clean-up. New ordering looks like: - data/ts in old policy at t0 (as well as queue entry time to move it) - tombstone in old policy at t0_1 - queue clean-up time at t0_2 - moved data/ts in new policy at t0_3 Closes-Bug: #2028175 Change-Id: Ib0dda0d338f48336d18d3d817a0c5994e201042e |
||
|
Zuul
|
7662cde704 | Merge "Add oldest failed async pending tracker" | ||
|
Alistair Coles
|
639251d4c5 |
slo: add more functional tests for copying
Add functional tests for copying from an SLO using PUT requests with an x-copy-from header. Add functional tests for copying from an SLO using part-number parameter. Change-Id: Ic40c4b104b11de9ab09485e82543521b37ea1daa |
||
|
Chinemerem
|
0a5348eb48 |
Add oldest failed async pending tracker
In the past we have had some async pendings that repeatedly fail for months at a time. This patch adds an OldestAsyncPendingTracker class which manages the tracking of the oldest async pending updates for each account-container pair. This class maintains timestamps for pending updates associated with account-container pairs. It evicts the newest pairs when the max_entries is reached. It supports retrieving the N oldest pending updates or calculating the age of the oldest pending update. Change-Id: I6d9667d555836cfceda52708a57a1d29ebd1a80b |
||
|
Zuul
|
5ee1e72c0b | Merge "object-expirer: add round_robin_cache_size option" | ||
|
Zuul
|
6221e5d8c1 | Merge "test-expirer: call tracking & exception stubs" | ||
|
Chinemerem
|
39e4ae3076 |
Differentiate unlinks and outdated unlinks
This commit differentiates async pendings that are unlinked due to a successful object update (unlinks)from those async pendings that are unlinked due to a newer async_pending existing for the same object (outdated_unlinks). Change-Id: I66e16207f3e368248617fc7ed3c6b5c80c54b1b5 |
||
|
Clay Gerrard
|
df22032d79 |
object-expirer: add round_robin_cache_size option
Drive-Bys: * DRY out redundent configuration examples in expiring objects overview documentation. * Add missing delay_reaping man page docs. Co-Authored-By: Alistair Coles <alistairncoles@gmail.com> Change-Id: I8879dbd13527233c878dff764ec411ce9619ee39 |
||
|
Clay Gerrard
|
31ef443715 |
test-expirer: call tracking & exception stubs
This change enhances the FakeInteralClient to make it easier to use the existing stubs to test error handling behaviors and make assertions about the behaviors. Co-Authored-By: Alistair Coles <alistairncoles@gmail.com> Change-Id: Ib652a752ba91dbc791eef2a1d6940bcb0d16e36a |
||
|
Tim Burke
|
c3f1ed3df1 |
CI: Move a bunch of func test jobs from py38 to py312
Change-Id: I8c65c7829fbe167e0c79239d577c38e90b93b5cf |
||
|
Tim Burke
|
b2386b9947 |
s3api: Stop upper-casing request-method for signatures
The AWS behaviour is weird: if I have my client signer always use the casing that will be sent on the wire, I reliably get back 405s, but if my client signer always converts to upper-case despite sending lower-case on the wire, it's roughly a coin toss for whether I get back a 405 or a 403 (with the string-to-sign indicating that the server was expecting lower-case). This is true for both v2 and v4 signatures, both in headers and in query params. Logically, though, it seems like using what's on the wire *ought* to be the way to go, and AWS's consistency in that case lends some credibility. Unfortunately, that breaks an existing functional test unless awscrt is installed, as boto3 (or botocore? somebody) will upper-case the request method by default, but trusts awscrt to handle things if available. So skip the part of the test that uses a lower-cased request method if we can't import awscrt. Change-Id: Ia6cacc51b2744986e703469f9e5215209194de8a |
||
|
Clay Gerrard
|
7a6dc095b4 |
functest: do not use account2 unless needed
Change-Id: I224e8706f1ee72b718e35a25ea417a1cf3a35938 |
||
|
Anish Kachinthaya
|
4f69ab3c5d |
fix x-open-expired 404 on HEAD?part-number reqs
Fixes a bug with the x-open-expired feature where our magic header does not get copied when refetching all manifests that causes 404 on HEAD requests with part-number=N query parameter since the object-server returns an empty response body and the proxy needs to refetch. The fix also applies to segment GET requests if the segments have expired. Change-Id: If0382d433f73cc0333bb4d0319fe1487b7783e4c |
||
|
Zuul
|
a427d2754f | Merge "trivial: Default value for EUCLEAN" | ||
|
Zuul
|
a2e8cf08d5 | Merge "FakeSwift: capture unexpected calls" | ||
|
Alistair Coles
|
056b2afbd7 |
FakeSwift: capture unexpected calls
Previously FakeSwift would raise a KeyError for a call that had no matching registered response *before* capturing the call. This prevents tests reliably asserting that only expected calls have been made. In particular, if the code being tested handles the KeyError gracefully then it was possible to write quite reasonable test assertions that passed despite unexpected calls being made. Tests in test/unit/container/test_reconciler.py seem to rely on this behaviour, so this patch adds a capture_unexpected_calls option for FakeSwift which defauts to True. This allows the reconciler tests to opt out of the new stricter call capturing. Change-Id: Idc6b6b5a2b665538e861700f5d0996fc39368f5b |
||
|
Tim Burke
|
d0b190f64a |
trivial: Default value for EUCLEAN
Apparently errno.EUCLEAN is not available on OS X, which can complicate running unit tests. Change-Id: Iaa3d7756949b4a67d4afe8a53b242ed9f41e9374 |
||
|
Jianjian Huo
|
7980b6a0d3 |
Object-expirer: continue to process next container on listing errors
When Expirer is iterating task containers and doing listings, it's possible one of the container nodes hosting the task container may become overloaded (or have a really low backend ratelimit set). Object-expirer should expect UnexpectedResponse and continue to try and list the task objects in the next container. And if the task container doesn't exist, expirer should not try to delete the non-existent containers, before continue to work on the next container. Co-Authored-By: Alistair Coles <alistairncoles@gmail.com> Change-Id: Id1966fa22725a02471e2d7c5a42fb243b1cfcf6a |
||
|
Zuul
|
02b17e43f6 | Merge "Make object-expirer respect internal_client_conf_path" | ||
|
Chinemerem
|
ee80f99aec |
Make object-expirer respect internal_client_conf_path
Previously the object-expirer would not respect an internal_client_conf_path option if its config was loaded from a "legacy" config filepath (e.g. **/object-expirer.conf). Legacy object-expirer config expected config sections for an internal-client to be included in the same file. However, "modern" object-expirer config files (e.g. **/object-server.conf) expect internal-client config to be loaded from a separate file specified by internal_client_conf_path and defaulting to 'internal_client_conf_path'. "Legacy" expirer config is still used in production clusters but it is useful to use a shared internal-client config. This patch therefore makes the internal_client_conf_path option always be respected regardless of the path of the object-expirer conf file. If 'internal_client_conf_path' is not specified, "modern" config will continue to use the default '/etc/swift/internal-client.conf', but "legacy" config will default to the path of the expirer conf file (i.e. the same as the previous behavior). Related-Change: Ib21568f9b9d8547da87a99d65ae73a550e9c3230 Change-Id: I24ec702cd2ed074ca9df084cefc896418cece394 |
||
|
Zuul
|
4807999749 | Merge "func tests: fix etag-quoter insertion in pipeline" | ||
|
Zuul
|
b0138f3a7b | Merge "trivial: remove print from functional tests" | ||
|
Alistair Coles
|
6e4ecfc5dc |
proxy: fix is_useful_response for py2
py2 http responses don't have a 'headers' attribute, so don't try to use it. Unfortunately the unit test infrastructure's FakeConn class does have a 'headers' attribute (whose value doesn't match the result of calling its 'getheaders()' method!), so this bug was not caught by tests in the Related-Change. Related-Change: I96f28ab0b2b5f9374c399e8905ee240e7b093f8b Change-Id: I2cd820280b8c69cafc5730183903c9d379d8dde5 |
||
|
Alistair Coles
|
86081b7822 |
func tests: fix etag-quoter insertion in pipeline
Previously the in-process functional test setup attempted to insert etag-quoter in the proxy pipeline by replacing the substring 'cache listing_formats' with 'cache etag-quoter listing_formats'. However, the pipeline had already been modified to have 'cache domain-remap listing_formats', so the etag-quoter replacement failed silently. This patch modifies the etag-quoter replacement to match just 'cache'. Some helper functions are also introduced to make the pipeline modification more uniform and to consistently verify the intended modifications have been achieved, or otherwise raise an exception. Change-Id: I640837a4da985bcbe48f9ae5eeb56385b11034eb |
||
|
Alistair Coles
|
81547cb67d |
trivial: remove print from functional tests
A print statement, presumably for debugging, crept in with the Related-Change. Change-Id: I0cccb960b51446a3aa58be95c8c9d06cc6b6eada Related-Change: I69974cc8a39731c980b54137b799a36b2e63a44a |
||
|
Alistair Coles
|
60c0ab2ea0 |
Quiten boto logging in func tests
Some s3api functional tests were setting boto logging level to DEBUG, which results in a very large amount of logging output from the test runner, including large request bodies. This makes it extremely hard to inspect test output. This patch makes the quiet_boto_logging context manager revert the logger level to its original value rather than indiscriminately leaving it set to DEBUG. Change-Id: I1dd9603adf9a19e89da5a461d3c6810a3432ae46 |
||
|
Alistair Coles
|
ffdf962598 |
object-expirer: fix unused _make_internal_client arg
The RelatedChange introduced a _make_internal_client() method with an unused argument 'is_legacy_conf'. This patch completes the original intention i.e. for the selection of internal client config path to also be moved to the new method and use the 'is_legacy_conf' arg. Change-Id: I5075cb446a15edc7f47e83f6aa038c626bd1dd82 RelatedChange: Ia6e1e6a8b58a8476fa16a3c7d45e620c6d7f88e4 |
||
|
Zuul
|
8efb333872 | Merge "diskfile: Treat EUCLEAN like ENODATA" | ||
|
Zuul
|
98eb28d510 | Merge "utils: paths with empty components are invalid" | ||
|
Zuul
|
5726778ab6 | Merge "functest: add checks for quota count API" | ||
|
Zuul
|
146bfeb643 | Merge "proxy-logging: Clean up some timing assertions" |