Repository navigation
rgw: Fix shutdown/reload issues. - #68265
adamemerson wants to merge 27 commits into
Conversation
5a926ab to
2722348
Compare
|
@soumyakoduri Take a look at the restore part of this. |
ddd482b to
f286e05
Compare
2009e9a to
2e5de57
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Thanks to Seena Fallah <[email protected]> for this fix, part of a larger commit. Fixes: https://tracker.ceph.com/issues/75164 Co-authored-by: Seena Fallah <[email protected]> Signed-off-by: Adam C. Emerson <[email protected]>
Rather than just dropping the reference, clean up the linger operation properly within Objecter. Also, clear out handlers before relinquishing reference to avoid use-after-free. Fixes: https://tracker.ceph.com/issues/75164 Signed-off-by: Adam C. Emerson <[email protected]>
The response can be empty on some errors. Attempting to decode an empty one loses the error value on valid errors. Also swallow any decode errors. Signed-off-by: Adam C. Emerson <[email protected]>
We were adding an overflow marker on every message above capacity, not just the first, vitiating the purpose of the bound. The shame, the shame. Signed-off-by: Adam C. Emerson <[email protected]>
An error coming in after `maybe_cleanup()` is called could trigger it again. Add a flag to prevent that. Signed-off-by: Adam C. Emerson <[email protected]>
Add missing unwatch call. Signed-off-by: Adam C. Emerson <[email protected]>
Leaving them out results in link errors on unoptimized debug builds. Signed-off-by: Adam C. Emerson <[email protected]>
Unbreaks loading on `-O0` builds. Signed-off-by: Adam C. Emerson <[email protected]>
test-rgw-multisite-single-cluster.sh sets up a single-cluster multisite topology (two zones, one RADOS cluster) matching the teuthology two-zonegroup layout. This is needed to reproduce reload deadlocks where both RGWs pause frontends simultaneously. test-rgw-period-reload-crash.py is a provocation script that hammers the primary zone with concurrent S3 PUT traffic via boto3 while firing period update commits to trigger realm reloads. It verifies reloads actually fire (checks RGW log), detects both crashes and freezes, and reports diagnostic info including core dump locations and gdb commands. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Adam C. Emerson <[email protected]>
Without this we can end up in an infinite loop where we just fill the log with -ECANCELED from `get_next()`. Signed-off-by: Adam C. Emerson <[email protected]>
To prevent a race condition/crash on realm reload where sync was trying to put objects through quota before quota was initialized. Signed-off-by: Adam C. Emerson <[email protected]>
Ensure that every completion that has a reference to the driver is drained before destroying the driver. Signed-off-by: Adam C. Emerson <[email protected]>
RGW's can potentially deadlock with each other on realm-reload. Each pauses its front-end then tries to join its thread with waiting requests. To break the cycle, shut down the HTTP Manager and cancel requests before joining. Signed-off-by: Adam C. Emerson <[email protected]>
Signed-off-by: Adam C. Emerson <[email protected]>
Signed-off-by: Adam C. Emerson <[email protected]>
I won't block your PR over style nits, but I will fix them myself. Signed-off-by: Adam C. Emerson <[email protected]>
So the namespace alias doesn't clash with the `rgw::asio` namespace. Also reformat to deal with all the identifiers being longer. Signed-off-by: Adam C. Emerson <[email protected]>
Destroying the entire coroutine frame on cancellation leaves in-flight operations spawned by the `co_compose` with the frame they're referencing destroyed. Signed-off-by: Adam C. Emerson <[email protected]>
Oops. Signed-off-by: Adam C. Emerson <[email protected]>
Logging functions accept null `DoutPrefixProvider*`s as no-ops. I had considered logging to `std::cerr` `dout_emergency` style, but that didn't seem consistent with the log priority for this message being 20. Signed-off-by: Adam C. Emerson <[email protected]>
As I have noticed `use_blocked` creeping into the code base in places it should not be, I am creating an ergonomic way to do the right thing. Signed-off-by: Adam C. Emerson <[email protected]>
In the attempt to use it as a completion token, give it an executor. If there is no yield_context, use a strand on the system executor, following practice in some parts of RGW. Signed-off-by: Adam C. Emerson <[email protected]>
Create an abstraction over promise to provide similar functionality to worker threads in Asio asynchronous form. Also include `ytask` and `yrun_loop` for stackful coroutines. Also add a few support functions. Signed-off-by: Adam C. Emerson <[email protected]>
Split shutdown into asynchronous and synchronous. Asynchronous cancellation (handled in the 'shutdown' function of the SAL) contains only non-blocking operations. Thread joins and similar should be reserved for synchronous shutdown, currently handled in destruction/driver close. For part one, since datalog was already using futures, adapt it to use the new promise-based architecture. We also use `co_throttle` during recovery as had been the original intention (foiled by GCC 12 at the time) to limit memory pressure. Signed-off-by: Adam C. Emerson <[email protected]>
Part of the shutdown/realm reload refactor, but generally something we want anyway. Also hook into the SAL shutdown idiom. Signed-off-by: Adam C. Emerson <[email protected]>
2e5de57 to
9942a36
Compare
GCC 14 has issues with parenthesized `co_await` expressions, so use a somewhat more unwieldy for loop instead of the while loop which was honestly kind of unwieldy in the first place. Signed-off-by: Adam C. Emerson <[email protected]>
| @@ -405,28 +396,25 @@ int Restore::process(int index, int max_secs, optional_yield y) | |||
|
|
|||
| // Skip the entry of object/bucket which no longer exists | |||
| if (ret < 0 && (ret != -ENOENT)) | |||
There was a problem hiding this comment.
Don't we need unlock before all these return calls?
soumyakoduri
left a comment
There was a problem hiding this comment.
Overall restore module changes look good to me. Thanks @adamemerson
| { | ||
| std::lock_guard l{lock}; | ||
| cond.notify_all(); | ||
| worker.run(); |
There was a problem hiding this comment.
If we choose to increase workers count in future, can all these changes (related to worker strand) be just applied in a loop? Or would they need any additional synchronization ?
| @@ -1088,6 +1088,10 @@ RGWRados::shutdown(rgw::shutdown_vector& to_wait) | |||
| svc.async_processor->set_down_flag(); | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
Restore background task relies on async_processor for some of its background tasks like list(), trim() etc right! Is it ok to stop the async_processor before stopping the restore worker?
In the current main code, async_processor is stopped before shutting down restore worker. Just checking if that may have been reason for some of the valgrind errors reported in shutdown code-path (https://tracker.ceph.com/issues/72772) and if that will get addressed with this change.
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
Work through issues of shutting down RGW.
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.