1398 Commits

Author SHA1 Message Date
Alistair Coles
cc27780042 docs: add discussion of content-type metadata
Change-Id: I2aa13e2b23bda86c51ef6aaa69ea3fd0075bb9ad
2024-03-06 11:02:15 +00:00
Clay Gerrard
5af7719ef3 Support swift.proxy_logging_status in request env
When logging a request, if the request environ has a
swift.proxy_logging_status item then use its value for the log
message status int.

The swift.proxy_logging_status hint may be used by other middlewares
when the desired logged status is different from the wire_status_int.

If the proxy_logging middleware detects a client disconnect then any
swift.proxy_logging_status item is ignored and a 499 status int is
logged, as per current behaviour. i.e.:

  * client disconnect overrides swift.proxy_logging_status and the
    response status
  * swift.proxy_logging_status overrides the response status

If the proxy_logging middleware catches an exception then the logged
status int will be 500 regardless of any swift.proxy_logging_status
item.

Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: I9b5cc6d5fb69a2957b8c4846ce1feed8c115e6b6
2023-12-20 17:31:06 +00:00
Zuul
966340aeed Merge "Remove per-service auto_create_account_prefix" 2023-12-01 01:48:57 +00:00
Takashi Kajinami
49b19613d2 Remove per-service auto_create_account_prefix
The per-service option was deprecated almost 4 years ago[1].

[1] 4601548dabdec0a4dc89cefba11e963217255be3

Change-Id: I45f7678c9932afa038438ee841d1b262d53c9da8
2023-11-22 01:58:03 +09:00
Tim Burke
c94e1c1513 docs: Document WSGI server process management
Talk about graceful shutdowns, seamless reloads, and the swift-reload helper.

Change-Id: I9c86d1ce9853840d73e2107a6d79b2454c21438a
2023-11-09 14:09:48 -08:00
Tim Burke
fcf1110ab2 CI: Fix some known-failure formatting
Related-Change: Icff8cf57474dfad975a4f45bf2d500c2682c1129
Change-Id: Ic2283fab0d18ea03c6beb353c6b934344606c15e
2023-10-16 10:18:22 -07:00
Matthew Oliver
0996433fe5 s3api: Add basic GET object-lock support
Some tooling out there, like Ansible, will always call to see if
object-lock is enabled on a bucket/container. This fails as Swift doesn't
understand the object-lock or the get object lock api[0].

When you use the get-object-lock-configuration to a bucket in s3 that
doesn't have it applied it returns a specific 404:

  GET /?object-lock HTTP/1.1" 404 None
  ...

  <?xml version="1.0" encoding="UTF-8"?>
  <Error>
    <Code>ObjectLockConfigurationNotFoundError</Code>
    <Message>Object Lock configuration does not exist for this bucket</Message>
    <BucketName>bucket_name</BucketName>
    <RequestId>83VQBYP0SENV3VP4</RequestId>
  </Error>'

This patch doesn't add support for get_object lock, instead it always
returns a similar 404 as supplied by s3, so clients know it's not
enabled.

Also add a object-lock PUT 501 response.

[0] https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html

Change-Id: Icff8cf57474dfad975a4f45bf2d500c2682c1129
2023-10-05 16:38:35 +11:00
Jake Yip
8a2c8b128b Update doc for include_service_catalog with app cred
If swift is used with an Application Credential with access_rules [1],
the catalog needs to be sent with the token for it to be evaluated by
keystonemiddleware.

[1]: https://docs.openstack.org/keystone/2023.1/user/application_credentials.html#access-rules

Change-Id: I0b02821722ffc819bc8a97281a33391072242ffc
2023-08-11 13:30:34 +10:00
Tim Burke
0c9b545ea7 docs: Clean up proxy logging docs
Change-Id: I6ef909e826d3901f24d3c42a78d2ab1e4e47bb64
2023-08-04 11:30:42 -07:00
Zuul
1f9937b245 Merge "docs/SAIO: Make reconciler use the SAIO convention for logs" 2023-08-04 04:00:43 +00:00
Pete Zaitcev
27120b0523 docs/SAIO: Make reconciler use the SAIO convention for logs
Personally I'm not a big fan of how we arrange logs for SAIO,
but it is a historic standard. The reconciler has to conform.

Change-Id: I45a25ff406b31b6b1b403e213554aaabfebc6eb5
2023-08-03 15:01:38 -05:00
Pete Zaitcev
dd664c47db doc/SAIO: Update the Fedora section
The never ending changes in package names march on.
This is for Fedora 38.

Change-Id: Idffd1df7e2f23681eb7d7bf1717471b594612dbc
2023-08-03 15:00:06 -05:00
Alistair Coles
8e051c5b8e docs: Fix link to sphinx project page
Change-Id: I5e75a359660315a34ec36f5cb748808257f4185a
2023-07-21 10:19:49 +01:00
Jianjian Huo
cb1e584e64 Object-server: keep SLO manifest files in page cache.
Currently, SLO manifest files will be evicted from page cache
after reading it, which cause hard drives very busy when user
requests a lot of parallel byte range GETs for a particular
SLO object.

This patch will add a new config 'keep_cache_slo_manifest', and
try keeping the manifest files in page cache by not evicting them
after reading if config settings allow so.

Co-Authored-By: Tim Burke <tim.burke@gmail.com>
Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: I557bd01643375d7ad68c3031430899b85908a54f
2023-07-07 12:48:24 -07:00
Tim Burke
1f298714af docs: Format metrics in fixed-width font, not italics
Change-Id: I6fc9eaf0903bdbe4ccb82c4e7647478a1eef9785
2023-05-30 11:38:42 -07:00
Tim Burke
307315bde2 docs: Move metric name/description tables out to separate page(s)
Offer it both by service and as a single, more easily searchable, page.

That admin guide is *still* too long, but this should help a bit.

Change-Id: I946c72f40dce2f33ef845a0ca816038727848b3a
2023-05-30 11:38:42 -07:00
Zuul
a0c5ac29a1 Merge "docs: Remove references to out-dated install guides" 2023-05-17 00:20:06 +00:00
Tim Burke
cff092b682 docs: Update versions in Getting Started doc
Change-Id: Ibed9dc0afbdb922d06f7798bdac01db7c55b19f1
2023-05-16 15:36:00 -07:00
Tim Burke
ca0dd8d703 docs: Remove references to out-dated install guides
Change-Id: Idbff951506ee2f3b288eda00217c902314393877
2023-05-16 15:31:13 -07:00
Tim Burke
716ae48eb8 docs: Fix broken paste/pastedeploy links
Closes-Bug: #2016463
Change-Id: Id500a2429b7412823970a06e3e82b1d1646c70b8
2023-04-27 13:52:55 -07:00
Tim Burke
ed1f5193e5 docs: Clean up cross-domain doc formatting; call out CWE-942
Change-Id: I7ab605d48972e8dc06e630d160c745baeea91355
2023-04-19 12:03:27 +01:00
Wei LingFei
5032b42b10 Update url
The OpenStack project is currently maintained on opendev.org, with github.com serving as a mirror repository.

Replace the source code repository address for the python-swiftclient project from github.com to opendev.org.

Change-Id: I650a80cb45febc457c42360061faf3a9799e6131
2023-03-24 14:44:18 +08:00
Tim Burke
cbba65ac91 quotas: Add account-level per-policy quotas
Reseller admins can set new headers on accounts like

   X-Account-Quota-Bytes-Policy-<policy-name>: <quota>

This may be done to limit consumption of a faster, all-flash policy, for
example.

This is independent of the existing X-Account-Meta-Quota-Bytes header, which
continues to limit the total storage for an account across all policies.

Change-Id: Ib25c2f667e5b81301f8c67375644981a13487cfe
2023-03-21 17:27:31 +00:00
Zuul
2a90eadc0d Merge "docs: Add memcache.conf config doc" 2023-02-28 22:44:07 +00:00
Alexander Fadeev
49ba1bc33a Present pytest steps in development guidelines
Explain how to prepare venv with `tox devenv`

Closes-Bug: #2003984
Change-Id: Idc536034a36646de9c1880c8d0bc0a387b130ac2
2023-02-25 02:01:07 +02:00
Matthew Oliver
2edd3e65da docs: Add memcache.conf config doc
Change-Id: I29d00e939a3842bd064382575955fa3e255242eb
2023-02-22 16:18:37 +11:00
Tim Burke
ef155bd74a Switch to pytest
nose has not seen active development for many years now. With py310, we
can no longer use it due to import errors.

Also update lower contraints

Closes-Bug: #1993531
Change-Id: I215ba0d4654c9c637c3b97953d8659ac80892db8
2022-12-09 11:38:02 -08:00
Zuul
0470994a03 Merge "slo: Default allow_async_delete to true" 2022-12-01 19:25:50 +00:00
Tim Burke
5c6407bf59 proxy: Add a chance to skip memcache for get_*_info calls
If you've got thousands of requests per second for objects in a single
container, you basically NEVER want that container's info to ever fall
out of memcache. If it *does*, all those clients are almost certainly
going to overload the container.

Avoid this by allowing some small fraction of requests to bypass and
refresh the cache, pushing out the TTL as long as there continue to be
requests to the container. The likelihood of skipping the cache is
configurable, similar to what we did for shard range sets.

Change-Id: If9249a42b30e2a2e7c4b0b91f947f24bf891b86f
Closes-Bug: #1883324
2022-08-30 18:49:48 +10:00
Zuul
24acc6e56b Merge "Add backend rate limiting middleware" 2022-08-30 07:18:57 +00:00
Zuul
d8af3d7a0d Merge "Various doc formatting cleanups" 2022-08-15 19:51:39 +00:00
Zuul
fc6555d9f3 Merge "Update "Getting Started" requirements" 2022-08-10 10:52:16 +00:00
jiaqi07
3a71df1335 Stop using unicode literals in docs conf.py
Change-Id: I8ce6749c3d634c68e5d4a15d812a046514cc35f5
2022-08-03 00:01:30 +00:00
Tim Burke
52a4fe37aa Various doc formatting cleanups
* Get rid of a bunch of accidental blockquote formatting
* Always declare a lexer to use for ``.. code::`` blocks

Change-Id: I8940e75b094843e542e815dde6b6be4740751813
2022-08-02 14:28:36 -07:00
Tim Burke
7e5c78423f Update "Getting Started" requirements
* Call out liberasurecode as a requirement
* Include more py3 versions
* Use anonymous links

Change-Id: Ib1f8ef5e36825b9c241d2a4d838ea01b3df70da0
2022-08-02 14:24:30 -07:00
Zuul
9b0e5ea975 Merge "formpost: deprecate sha1 signatures" 2022-07-26 05:53:59 +00:00
Matthew Oliver
2d063cd61f formpost: deprecate sha1 signatures
We've known this would eventually be necessary for a while [1], and
way back in 2017 we started seeing SHA-1 collisions [2].

This patch follows the approach of soft deprecation of SHA1 in tempurl.
It's still a default digest, but we'll start with warning as the
middleware is loaded and exposing any deprecated digests
(if they're still allowed) in /info.

Further, because there is much shared code between formpost and tempurl, this
patch also goes and refactors shared code out into swift.common.digest.
Now that we have a digest, we also move digest related code:
 - get_hmac
 - extract_digest_and_algorithm

[1] https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html
[2] https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html

Change-Id: I581cadd6bc79e623f1dae071025e4d375254c1d9
2022-07-26 10:39:58 +10:00
Zuul
5ff37a0d5e Merge "DB Replicator: Add handoff_delete option" 2022-07-22 01:45:31 +00:00
Matthew Oliver
bf4edefce4 DB Replicator: Add handoff_delete option
Currently the object-replicator has an option called `handoff_delete`
which allows us to define the the number of replicas which are ensured
in swift. Once a handoff node ensures that many successful responses it
can go ahead and delete the handoff partition.

By default it's 'auto' or rather the number of primary nodes. But this
can be reduced. It's useful in draining full disks, but has to be used
carefully.

This patch adds the same option to the DB replicator and works the same
way. But instead of deleting a partition it's done at the per DB level.

Because it's done in the DB Replicator level it means the option is now
available to both the Account and Container replicators.

Change-Id: Ide739a6d805bda20071c7977f5083574a5345a33
2022-07-21 13:35:24 +10:00
Aymeric Ducroquetz
1831658b33 proxy-logging: Allow to add domain in log messages
Change-Id: Id441688aac1088041e243b8ee70710d9c5d7911b
2022-06-22 10:45:01 -07:00
Zuul
2ed6e08f98 Merge "s3api tests: allow AWS credential file loading" 2022-06-02 07:53:05 +00:00
Alistair Coles
5d9f1f009c s3api tests: allow AWS credential file loading
When switching the s3api cross-compatibility tests' target between a
Swift endpoint and an S3 endpoint, allow specifying an AWS CLI style
credentials file as an alternative to editing the swift 'test.conf'
file.

Change-Id: I5bebca91821552d7df1bc7fa479b6593ff433925
2022-06-01 21:46:41 -07:00
Zuul
5398204f22 Merge "tempurl: Deprecate sha1 signatures" 2022-06-01 15:54:25 +00:00
Alistair Coles
ccaf49a00c Add backend rate limiting middleware
This is a fairly blunt tool: ratelimiting is per device and
applied independently in each worker, but this at least provides
some limit to disk IO on backend servers.

GET, HEAD, PUT, POST, DELETE, UPDATE and REPLICATE methods may be
rate-limited.

Only requests with a path starting '<device>/<partition>', where
<partition> can be cast to an integer, will be rate-limited. Other
requests, including, for example, recon requests with paths such as
'recon/version', are unconditionally forwarded to the next app in the
pipeline.

OPTIONS and SSYNC methods are not rate-limited. Note that
SSYNC sub-requests are passed directly to the object server app
and will not pass though this middleware.

Change-Id: I78b59a081698a6bff0d74cbac7525e28f7b5d7c1
2022-05-20 14:40:00 +01:00
Tim Burke
d0cf743b6f ceph-tests: Remove known-failure
Apparently we fixed that recently without realizing it.

Change-Id: I2f623ffc1400f018c203e930a7b78dfdb9d6e61c
Related-Change: I8c98791a920eeedfc79e8a9d83e5032c07ae86d3
2022-05-18 16:31:49 -07:00
Tim Burke
11b9761cdf Rip out pickle support in our memcached client
We said this would be going away back in 1.7.0 -- lets actually remove it.

Change-Id: I9742dd907abea86da9259740d913924bb1ce73e7
Related-Change: Id7d6d547b103b4f23ebf5be98b88f09ec6027ce4
2022-04-27 11:16:16 -07:00
Tim Burke
118cf2ba8a tempurl: Deprecate sha1 signatures
We've known this would eventually be necessary for a while [1], and
way back in 2017 we started seeing SHA-1 collisions [2].

[1] https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html
[2] https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html

UpgradeImpact:
==============
"sha1" has been removed from the default set of `allowed_digests` in the
tempurl middleware config. If your cluster still has clients requiring
the use of SHA-1,

- explicitly configure `allowed_digests` to include "sha1" and
- encourage your clients to move to more-secure algorithms.

Depends-On: https://review.opendev.org/c/openstack/tempest/+/832771
Change-Id: I6e6fa76671c860191a2ce921cb6caddc859b1066
Related-Change: Ia9dd1a91cc3c9c946f5f029cdefc9e66bcf01046
Closes-Bug: #1733634
2022-04-22 20:43:01 +10:00
Takashi Kajinami
bb220f6f41 Doc: Update links in associated projects
Replace github by opendev because currently opendev is the source and
github is its mirror.

Also, update links for repositories managed by SwiftStack organization.
Unfortunately some repositories are no longer available so are removed
from the list.

Change-Id: Ic223650eaf7a1934f489c8b713c6d8da1239f3c5
2022-04-19 20:03:06 +09:00
Takashi Kajinami
5a272421d0 Swauth is retired
The swauth project is already retired[1]. The documentation is updated
to reflect status of the project.

Also, this change removes reference to this middleware in unit tests.

[1] https://opendev.org/x/swauth/
Change-Id: I3d8e46d85ccd965f9b51006c330e391dcdc24a34
2022-04-19 19:50:23 +09:00
Matthew Oliver
1cee51d526 doc: also add reverse option to pagination doc
Change-Id: I4ee5a52ec9fb5f1920cd6869f6b1245c3787391c
2022-04-08 12:59:27 +10:00