Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: Close datalog write hole #56499

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

adamemerson
Copy link
Contributor

@adamemerson adamemerson commented Mar 27, 2024

A specter is haunting RGW.

The specter of objects not syncing if RGW crashes between adding them to to the set of bucketshards to be refreshed and actually writing the entry into FIFO.

This PR will close that write hole.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
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

Copy link

github-actions bot commented Apr 3, 2024

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

Copy link

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

@adamemerson adamemerson force-pushed the wip-rgw-close-datalog-write-hole branch 3 times, most recently from 87c1016 to 4ea1c77 Compare April 16, 2024 16:08
@adamemerson adamemerson force-pushed the wip-rgw-close-datalog-write-hole branch from 4ea1c77 to 4deb05c Compare April 25, 2024 23:37
@adamemerson adamemerson force-pushed the wip-rgw-close-datalog-write-hole branch 3 times, most recently from 600c530 to 95455d5 Compare April 30, 2024 00:28
@adamemerson adamemerson marked this pull request as ready for review April 30, 2024 00:29
@adamemerson adamemerson requested a review from a team as a code owner April 30, 2024 00:29
@adamemerson adamemerson force-pushed the wip-rgw-close-datalog-write-hole branch from 95455d5 to 2710fb4 Compare May 1, 2024 16:10
Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

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

not done yet, but sharing initial review up to commit 'common/async: Non-blocking condition variable'

src/neorados/cls/version.h Outdated Show resolved Hide resolved
src/neorados/cls/log.h Outdated Show resolved Hide resolved
src/test/cls_log/test_neocls_log.cc Show resolved Hide resolved
src/common/async/async_call.h Outdated Show resolved Hide resolved
src/common/async/async_call.h Outdated Show resolved Hide resolved
src/common/async/coro_aiocomplete.h Outdated Show resolved Hide resolved
src/common/async/async_yield.h Outdated Show resolved Hide resolved
src/common/async/async_cond.h Outdated Show resolved Hide resolved
src/common/async/async_cond.h Outdated Show resolved Hide resolved
src/common/async/async_cond.h Outdated Show resolved Hide resolved
@adamemerson adamemerson requested a review from a team as a code owner May 7, 2024 17:54
Copy link

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

Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

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

more review, haven't gotten to the recovery bits yet

src/cls/sem_set/module.cc Outdated Show resolved Hide resolved
src/cls/sem_set/module.cc Outdated Show resolved Hide resolved
src/cls/sem_set/module.cc Outdated Show resolved Hide resolved
src/cls/sem_set/ops.h Outdated Show resolved Hide resolved
src/cls/sem_set/module.cc Outdated Show resolved Hide resolved
src/rgw/driver/rados/rgw_datalog.cc Outdated Show resolved Hide resolved
src/rgw/driver/rados/rgw_neorados.h Outdated Show resolved Hide resolved
src/rgw/driver/rados/rgw_neorados.h Outdated Show resolved Hide resolved
src/rgw/driver/rados/rgw_datalog.cc Outdated Show resolved Hide resolved
src/rgw/driver/rados/rgw_neorados.cc Outdated Show resolved Hide resolved
@adamemerson adamemerson force-pushed the wip-rgw-close-datalog-write-hole branch from 876025d to c8b3e9f Compare May 13, 2024 21:44
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Since reading CLS values in a friendly way requires calling out to RADOS
then decoding the returned structure, make a function to help with that.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
We should not be using std::list everywhere, and this is an excellent
time to switch.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This stores a collection of key-based semaphores, intended to serve as
a backend to the project to close the datalog write-hole.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
Signed-off-by: Adam Emerson <aemerson@redhat.com>
Signed-off-by: Adam Emerson <aemerson@redhat.com>
Since we're plumbing the driver around and it's where our neorados
handle lives.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Rewrite all of `RGWDataChangesLog` and supporting classes to use
non-blocking, C++20 coroutines.

Make interfaces for `optional_yield` and `librados::AioCompletion`.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam Emerson <aemerson@redhat.com>
Except in one particular case.

This is necessary to close the data replication write hole, so that if
we fail to write to the semaphore set, the client will receive an
error.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
So we can reconstitute bucket shards from listings during recovery.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
Increment in add_entry, decrement in renew_entry, and recover on
startup.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
Signed-off-by: Adam Emerson <aemerson@redhat.com>
Signed-off-by: Adam Emerson <aemerson@redhat.com>
Also tests renew_entry, backend, and list.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
Since, outside of testing, it's only called from stackful coroutines,
for now.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
This works fine on GCC11, which is the actual target we use for
builds on Shaman.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
Process shards piecewise. Send each set of shards in a window to the
other RGWs and have them acknowledge having it or not.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
@adamemerson adamemerson force-pushed the wip-rgw-close-datalog-write-hole branch from 6b3a956 to 28ae31c Compare June 4, 2024 08:13
add_executable(unittest_async_max_concurrent_for_each test_async_max_concurrent_for_each.cc)
add_ceph_unittest(unittest_async_max_concurrent_for_each)
target_link_libraries(unittest_async_max_concurrent_for_each ceph-common Boost::system Boost::context)

if(NOT WIN32)
add_executable(unittest_async_co_throttle test_async_co_throttle.cc)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit concerned that we may hit the seg faults again later.

https://paste.openstack.org/raw/bLnxLRTrzYjCyREDWQS8/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cbodley Could you take a look at this?

Copy link
Contributor

Choose a reason for hiding this comment

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

how do we prevent windows from running this test?

Copy link
Contributor

Choose a reason for hiding this comment

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

This patch already skips the test. My concern was that we may see the segmentation faults on Windows if this async coroutine throttling code gets used by librados, librbd or libcephfs.

I'm wondering if it's caused by the llvm version that we're using.

@adamemerson
Copy link
Contributor Author

jenkins test make check

@adamemerson
Copy link
Contributor Author

jenkins test make check arm64

@adamemerson
Copy link
Contributor Author

jenkins test api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants