Skip to content

rgw/rados: don't rely on IoCtx::get_last_version() for async ops - #59998

Merged
cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-63935
Sep 30, 2024
Merged

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

Conversation

@cbodley

@cbodley cbodley commented Sep 26, 2024 •

Copy link
Copy Markdown
Contributor

rgw uses IoCtx::get_last_version() in a few places to determine the order of racing operations. most importantly, the rgw bucket index relies on this version number to detect racing writes/deletes so it can cancel the operations that lose the race

but the value of get_last_version() is only updated by synchronous calls to IoCtx::operate(). after switching to rgw_rados_operate() for these operations so that coroutines could suspend instead of block, get_last_version() is returning 0 because we're using IoCtx::aio_operate() under the hood

in the coroutine case, rgw_rados_operate() uses librados::async_operate() from librados_asio.h. these librados_asio.h functions now get the version number out of AioCompletion and return it to the caller

rgw_rados_operate() now receives this version number and exposes it as an optional output parameter. the following callers that used get_last_version() afterwards now use that output parameter instead:

  • RGWRados::Object::Write::_do_write_meta()
  • RGWRados::Object::Delete::delete_obj()
  • RGWRados::set_attrs()
  • RGWSI_SysObj_Core::read()
  • RGWRados::raw_obj_stat()
  • RGWRados::check_disk_state()

https://tracker.ceph.com/issues/63935

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

IoCtx::aio_operate() doesn't update IoCtx::get_last_version(). to make
the resulting version_t available to the caller, we have to read it out
of the AioCompletionImpl and return it to the caller

Signed-off-by: Casey Bodley <[email protected]>
@cbodley
cbodley marked this pull request as ready for review September 26, 2024 17:05
@cbodley
cbodley requested review from a team as code owners September 26, 2024 17:05
Comment thread src/rgw/driver/rados/rgw_rados.cc Outdated
Comment on lines 9654 to 9655

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.

this has been broken for ordered listings ever since CLSRGWIssueBucketList was added (10 years ago with 6f44f7a)

to make this work with sharded buckets, i think we'd need to track the versions for each shard object, and pass in the correct shard's version when sending dir suggestions

@cbodley

cbodley commented Sep 26, 2024

Copy link
Copy Markdown
Contributor Author

https://jenkins.ceph.com/job/ceph-pull-requests/144059/

The following tests FAILED:
32 - run-rbd-unit-tests-61.sh (Failed)
247 - unittest_rbd_mirror (Failed)

@cbodley

cbodley commented Sep 26, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@cbodley

cbodley commented Sep 26, 2024

Copy link
Copy Markdown
Contributor Author

confirmed that the reproducer from https://tracker.ceph.com/issues/63935#note-8 does produce version numbers again

~/ceph/build $ grep --binary-files=text 'rgw_bucket_complete_op: request' out/osd.0.log 
2024-09-26T15:43:20.093-0400 7fe8faa006c0  1 <cls> /home/cbodley/ceph/src/cls/rgw/cls_rgw.cc:1141: INFO: rgw_bucket_complete_op: request: op=write name=8m.iso() ver=6:2 tag=10cdd72b-bb29-4233-8573-984d033683a3.4179.15330131204001525545
2024-09-26T15:43:20.955-0400 7fe8ffa006c0  1 <cls> /home/cbodley/ceph/src/cls/rgw/cls_rgw.cc:1141: INFO: rgw_bucket_complete_op: request: op=write name=8m.iso() ver=6:5 tag=10cdd72b-bb29-4233-8573-984d033683a3.4179.14892126214858155106
2024-09-26T15:43:23.367-0400 7fe8faa006c0  1 <cls> /home/cbodley/ceph/src/cls/rgw/cls_rgw.cc:1141: INFO: rgw_bucket_complete_op: request: op=del name=8m.iso() ver=6:6 tag=_0Y7c5s8QoWyIt10qUiBNU7Jn1Q-JGM_

@cbodley

cbodley commented Sep 26, 2024

Copy link
Copy Markdown
Contributor Author

instead of calling ioctx.get_last_version() after a rados operation,
callers now pass version_t* as an output parameter. in the null_yield
case, that version is assigned to ioctx.get_last_version() as normal. in
the async case, we get the version out of librados::async_operate()'s
return value

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

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

cbodley commented Sep 27, 2024

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Sep 27, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@cbodley

cbodley commented Sep 27, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@cbodley

cbodley commented Sep 27, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test windows

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.

2 participants