diff options
author | Zuul <zuul@review.opendev.org> | 2023-03-23 17:45:12 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-03-23 17:45:12 +0000 |
commit | 2dc9899b147663225540a71a5a591587c2284f6d (patch) | |
tree | 4517c05c8e2a52562f79dbda33fda7a0a70a0a92 /swift/container | |
parent | 9a1bfb8975fb1315fb417161a2865b6bb4760415 (diff) | |
parent | 29414ab1466610481dc9bf0b107e627141e4dbac (diff) | |
download | swift-2dc9899b147663225540a71a5a591587c2284f6d.tar.gz |
Merge "Allow internal container POSTs to not update put_timestamp"
Diffstat (limited to 'swift/container')
-rw-r--r-- | swift/container/server.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/swift/container/server.py b/swift/container/server.py index 8afc04750..080716d68 100644 --- a/swift/container/server.py +++ b/swift/container/server.py @@ -860,7 +860,14 @@ class ContainerController(BaseStorageServer): @public @timing_stats() def POST(self, req): - """Handle HTTP POST request.""" + """ + Handle HTTP POST request. + + A POST request will update the container's ``put_timestamp``, unless + it has an ``X-Backend-No-Timestamp-Update`` header with a truthy value. + + :param req: an instance of :class:`~swift.common.swob.Request`. + """ drive, part, account, container = get_container_name_and_placement(req) req_timestamp = valid_timestamp(req) if 'x-container-sync-to' in req.headers: @@ -878,7 +885,9 @@ class ContainerController(BaseStorageServer): broker = self._get_container_broker(drive, part, account, container) if broker.is_deleted(): return HTTPNotFound(request=req) - broker.update_put_timestamp(req_timestamp.internal) + if not config_true_value( + req.headers.get('x-backend-no-timestamp-update', False)): + broker.update_put_timestamp(req_timestamp.internal) self._update_metadata(req, broker, req_timestamp, 'POST') return HTTPNoContent(request=req) |