Commit Graph

10567 Commits

Author SHA1 Message Date
Clay Gerrard f3adce1375 expirer: bad config should not loop forever
Change-Id: I9413c72f41465fb8026848f71ec3b39fa990c3b7
2024-05-23 12:50:37 -05:00
Clay Gerrard a2df74ffe2 tests: new test_config module for utils.config
Drive-by: fix ValueError message for non_negative_int

Change-Id: I06508279d59fa57296dd85548f271a7812aeb45f
2024-05-23 12:50:31 -05:00
Zuul c620a192d0 Merge "docs: Update further-reading URL for cross-domain policies" 2024-05-22 21:36:02 +00:00
Zuul 337079f21f Merge "replicator: Ensure handoffs can clear with large handoff_delete" 2024-05-20 21:41:28 +00:00
Zuul d5c26bb690 Merge "test: more test for s3api v4 checksum" 2024-05-18 00:34:18 +00:00
Tim Burke b447234b2f Allow StatsdClients to no-op if no host provided
We've been working toward separating our logger from our statsd client.
This is generally a good idea; it's always been a little weird to have
our special-case loggers that would allow you to *also* increment some
counters.

The end goal is to take a bunch of places that look like

    logger = utils.get_logger(conf)
    ...
    logger.info(...)
    logger.increment(...)

and turn them into something more like

    logger = logs.get_adapted_logger(conf)
    stats = statsd_client.get_statsd_client(conf, logger=logger)
    ...
    logger.info(...)
    stats.increment(...)

Take a lesson from logging: callers don't need to know whether the
log_level is high enough that their message will be logged, or even
whether logging is enabled at all. Code wanting to emit stats shouldn't
need to know whether statsd collection has been configured, either.

Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: I6eb5b27a387cc2b7310ee11cc49d38fd2b6cbab8
2024-05-17 13:49:03 -05:00
Zuul a1916855c2 Merge "bump lxml to 4.2.3" 2024-05-16 20:24:59 +00:00
Zuul d47811fc3e Merge "make statsd_client more explicit" 2024-05-16 19:39:51 +00:00
Zuul 3ac4030424 Merge "s3api: Improve checksum-mismatch detection" 2024-05-16 17:49:43 +00:00
Clay Gerrard b40ae84f85 make statsd_client more explicit
Even if stdlib socket is probably patched by the time StatsdClient
creates a socket, we want to import the green socket module explicitly
for better testing.

Move test_statsd.py to test_statsd_client.py so it matches the naming
convention of the rest of our test files.

Fix some patching of utils in test_statsd_client to patch
statsd_client.

Rename some vars in test_statsd_client that shadowed the statsd_client
module name.

Move some utils tests out of test_statsd_client and back into
test_utils.

Related-Change: I4b5b12a3b0288b696a39903264741bc862a94ad7
Change-Id: I3de22b7f15dd386fa9c873587782f0dfc4c42a27
2024-05-16 16:49:54 +00:00
Clay Gerrard 893deca274 test: more test for s3api v4 checksum
Related-Change: I9924ff3b8d7d246631fe61b916823e028e2c01f2
Change-Id: I2a4581e408e3012a44bfb0cd58563b82040e23fc
2024-05-16 10:44:55 -05:00
Tim Burke a3ee04152d docs: Update further-reading URL for cross-domain policies
The old one now just redirects to https://developer.adobe.com/

Change-Id: Iba281bb8dceedef9bbb702abf0b93473bf91d9f7
2024-05-15 08:28:03 -07:00
Zuul 35a00caf3a Merge "Move old rolling-upgrade jobs to point to EOM tags" 2024-05-14 20:40:54 +00:00
indianwhocodes 54e13ee9b5 bump lxml to 4.2.3
Change-Id: Ia83ab181277e04e473e33680b3f2d686f534a084
2024-05-14 11:03:51 -07:00
Zuul d1aa735a37 Merge "backend ratelimit: support per-method rate limits" 2024-05-13 16:11:19 +00:00
Zuul bf206ed2fe Merge "backend ratelimit: support reloadable config file" 2024-05-11 20:26:40 +00:00
Zuul 13f82f532c Merge "Mark rolling-upgrade job voting again" 2024-05-11 00:55:58 +00:00
Tim Burke 178265d209 Mark rolling-upgrade job voting again
We got fixes everwhere we needed; this actually could have been voting
a while back.

Related-Change: https://review.opendev.org/c/openstack/swift/+/863929
Change-Id: I86012f7f4703becfbc6bb59b865a123cc9823f77
2024-05-10 13:04:06 -07:00
Tim Burke 0444a056e7 Move old rolling-upgrade jobs to point to EOM tags
Change-Id: Iba4a9271910b032b8726c0dc605d95cf8da05e44
2024-05-10 12:42:00 -07:00
Zuul c4ebcaa438 Merge "import exceptions "correctly"" 2024-05-10 18:29:45 +00:00
Zuul 47cde0b28b Merge "Test under py312" 2024-05-09 20:17:49 +00:00
Zuul 927e75aa4c Merge "Use ClosingMapper to ensure prompt client disconnect logging" 2024-05-09 20:17:42 +00:00
Clay Gerrard acbcdc9b8c import exceptions "correctly"
Change-Id: Ie7da4369152aa5d571a8c834da7390c518143c84
2024-05-09 14:09:40 -05:00
OpenStack Proposal Bot 2712a5598f Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I9d529828b25276dccd2e631b6fe50882fb373889
2024-05-09 04:47:12 +00:00
Tim Burke 829df42490 Test under py312
Change-Id: I52153d27f53b81de63b6b3590e1ab22f563f178f
2024-05-07 09:19:41 -07:00
Tim Burke 9ec83c44fd Use ClosingMapper to ensure prompt client disconnect logging
Adds ClosingMapper class which is like map() but closes the
iterable.

Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: Idd0ac21b365a138b065f01d05a257af62ea88177
2024-05-07 09:19:33 -07:00
Shreeya Deshpande 9da22bb5fe Move statsd testing to its own module
Change-Id: I4b5b12a3b0288b696a39903264741bc862a94ad7
2024-05-03 15:08:23 -07:00
Zuul ec3224cc18 Merge "Clean up watchdog threads" 2024-05-02 18:17:12 +00:00
Zuul c12e4ac9db Merge "CI: Add rolling-upgrade job for Caracal" 2024-05-02 16:31:55 +00:00
Tim Burke 38d0b3fabc Clean up watchdog threads
This shouldn't impact real servers, as those processes were about to
wrap up anyway. It *can* cause some confusing behaviors in tests,
though.

Change-Id: Ifd8a64efcd3fc983596ba7cd9fe28eb9663c93d6
2024-05-02 08:30:54 -07:00
Tim Burke e3eab3facb CI: Add rolling-upgrade job for Caracal
Change-Id: Ief0771dcb17c4ed3d239d60872454e2d35936e39
2024-05-01 22:10:38 -07:00
Tim Burke 761d919677 tests: Use mock.patch more
Change-Id: I68974338f8e0284ed77960048a83f72855b93348
2024-05-01 17:33:11 -07:00
Tim Burke b4dddb7406 tests: Use @with_tempdir more
Change-Id: I33e71f6c201bb4f2cf3481afd40cf489eb1fcd1f
2024-05-01 17:30:52 -07:00
Zuul 0a3c46e6c4 Merge "Refactor utils" 2024-05-02 00:27:02 +00:00
Shreeya Deshpande bc3a59bdd3 Refactor utils
- Move statsd client into it's own module
- Move all logging functions into their own module
- Move all config functions into their own module
- Move all helper functions into their own module

Partial-Bug: #2015274
Change-Id: Ic4b5005e3efffa8dba17d91a41e46d5c68533f9a
2024-04-30 20:27:47 +00:00
OpenStack Release Bot 51e4b6e279 reno: Update master for unmaintained/zed
Update the zed release notes configuration to build from
unmaintained/zed.

Change-Id: I852953d8c06e44b4416818ae1ef1b1cf70864fb2
2024-04-30 11:06:13 +00:00
OpenStack Proposal Bot aa8604645c Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ifa3ea75a59bf946c800331c642574c87629ddc92
2024-04-27 02:55:15 +00:00
Anish Kachinthaya 1d30e8e696 Add Anish to authors.
Change-Id: I0441226e279b36a787ec85a459d6d1b72a2c8c84
2024-04-26 11:51:17 -07:00
Zuul 937af35e62 Merge "object-expirer: add example to delay_reaping sample config" 2024-04-26 15:14:34 +00:00
Zuul f7b9a72a6e Merge "object-expirer: test for mix of async and delayed deletes" 2024-04-26 15:04:15 +00:00
Zuul b6c377e7e5 Merge "support x-open-expired header for expired objects" 2024-04-26 13:07:57 +00:00
Zuul 2e487ba695 Merge "expirer: account and container level delay_reaping" 2024-04-26 10:28:47 +00:00
Clay Gerrard b490857b47 object-expirer: test for mix of async and delayed deletes
Related-Change: I106103438c4162a561486ac73a09436e998ae1f0
Change-Id: I95606aed5a5bd70424fbc51dd965f238fa7f064f
2024-04-26 10:53:19 +01:00
indianwhocodes 11eb17d3b2 support x-open-expired header for expired objects
If the global configuration option 'enable_open_expired' is set
to true in the config, then the client will be able to make a
request with the header 'x-open-expired' set to true in order
to access an object that has expired, provided it is in its
grace period. If this config flag is set to false, the client
will not be able to access any expired objects, even with the
header, which is the default behavior unless the flag is set.

When a client sets a 'x-open-expired' header to a true value for a
GET/HEAD/POST request the proxy will forward x-backend-open-expired to
storage server. The storage server will allow clients that set
x-backend-open-expired to open and read an object that has not yet
been reaped by the object-expirer, even after the x-delete-at time
has passed.

The header is always ignored when used with temporary URLs.

Co-Authored-By: Anish Kachinthaya <akachinthaya@nvidia.com>
Related-Change: I106103438c4162a561486ac73a09436e998ae1f0
Change-Id: Ibe7dde0e3bf587d77e14808b169c02f8fb3dddb3
2024-04-26 10:13:40 +01:00
Alistair Coles ce619137db object-expirer: add example to delay_reaping sample config
Add an example of a delay_reaping config option with quoted key.

Change-Id: I0c7ead6795822ea0fb0e81abc1e4685d7946942c
Related-Change: I106103438c4162a561486ac73a09436e998ae1f0
2024-04-26 09:37:40 +01:00
Mandell Degerness 5961ba0ca7 expirer: account and container level delay_reaping
The object expirer can be configured to delay the reaping of
objects from disk after their expiration time using account
and container level delay_reaping values. The delay_reaping
value of accounts and containers in seconds is configured in
the object server config. The object expirer references these
configured values to only reap objects from specified accounts
and containers after their corresponding delays.

The goal of the delay_reaping feature is to prevent accidental or
premature data loss if an object marked for deletion with the
'x-delete-at' feature should not be reaped immediately, for
whatever reason.

Configuring the delay_reaping value at a granular account and
container level is beneficial for being able to keep storage
capacity consumption in control while maintaining a desired
data recovery window.

This patch also adds a sample configuration, documentation, and
tests for bad configurations and grace period functionality.

Co-Authored-By: Anish Kachinthaya <akachinthaya@nvidia.com>
Change-Id: I106103438c4162a561486ac73a09436e998ae1f0
2024-04-25 13:59:36 -07:00
Zuul 5ba1fbf86b Merge "proxy_logging: unit test first-byte.timing metrics" 2024-04-19 16:36:09 +00:00
Zuul 22c4c9ba1c Merge "proxy-logging: emit stats more consistently" 2024-04-19 13:40:49 +00:00
Zuul dcf9c7ef54 Merge "test: assert behavior of proxy_logging metrics" 2024-04-19 13:29:05 +00:00
Alistair Coles 3d5a97f76b proxy_logging: unit test first-byte.timing metrics
Add some test assertions to cover the first-byte timing metrics
introduced in the related change.

Add ttfb param to log_request docstring.

Change-Id: I530652dd672d7d4e5eac351ccbad318773414f7d
Related-Change: I1611e34846e586703e9d3709fa64e8df41f2d685
2024-04-19 12:33:48 +01:00