Skip to content

rgw: add headers to guide cache update in 304 response - #54587

Merged
cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-45736
Jan 8, 2024
Merged

cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-45736

Conversation

@cbodley

@cbodley cbodley commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

revives the fix from #35284

needed an additional change to RGWGetObj::execute() to save the object attrs when read_op->prepare() returns an error (like -ERR_NOT_MODIFIED in this case)

Fixes: https://tracker.ceph.com/issues/45736

test case in ceph/s3-tests#533

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

IlsooByun and others added 2 commits November 24, 2023 10:35
when `ReadOp::prepare()` fails with `-ERR_NOT_MODIFIED`, it succeeded in
reading the head object for mtime and attrs like etag. make those attrs
available to RGWGetObj so we can still send ETag and other cache-related
response headers

Fixes: https://tracker.ceph.com/issues/45736

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Jan 5, 2024

Copy link
Copy Markdown
Contributor Author

Comment thread src/rgw/rgw_op.cc
s->obj_size = s->object->get_obj_size();
attrs = s->object->get_attrs();
multipart_parts_count = read_op->params.parts_count;
if (op_ret < 0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about other error codes? is it safe to get attributes, size etc, if the head read failed for some other reason?
maybe wrap with if (op_ret == 0 || op_ret == -ERR_NOT_MODIFIED) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the variables are safe to copy on a read error, they'd just have their default values

@yuvalif
yuvalif self-requested a review January 8, 2024 17:45
@cbodley
cbodley merged commit f872a2c into ceph:main Jan 8, 2024
@cbodley

cbodley commented Jan 8, 2024

Copy link
Copy Markdown
Contributor Author

tyvm @yuvalif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants