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 multisite: fix RGWCoroutine error handling #39182

Merged
merged 3 commits into from Feb 4, 2021
Merged

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Jan 29, 2021

two bug fixes that were preventing RGWRunBucketSourcesSyncCR from getting the errors from the RGWRunBucketSyncCoroutines it spawns

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

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

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 api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

added with yield_spawn_window() and drain_all_cb() but shadowed by the
'int ret' parameter in both callbacks

Signed-off-by: Casey Bodley <cbodley@redhat.com>
when the drain_children() callback function returns an error, set the
should_exit flag so that the drain_with_cb() macro can return that
error code via set_cr_error()

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

Signed-off-by: Casey Bodley <cbodley@redhat.com>
collect() returns false when it gets to the last stack. but it always
collects one result, so we need to check for errors even when it returns
false

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@@ -1010,10 +1014,11 @@ bool RGWCoroutine::drain_children(int num_cr_left,
int r = (*cb)(stack_id, ret);
if (r < 0) {
drain_status.ret = r;
drain_status.should_exit = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yehudasa this flag was added in #35511 but nothing set it to true. we need to set it here, so the drain_with_cb() macro can return the error from cb:

#define drain_with_cb(n, cb) \
  drain_status.init(); \
  yield_until_true(drain_children(n, cb)); \
  if (drain_status.should_exit) { \
    return set_cr_error(drain_status.ret); \                                   
  }

@cbodley
Copy link
Contributor Author

cbodley commented Jan 31, 2021

@cbodley cbodley merged commit cbfc083 into ceph:master Feb 4, 2021
@cbodley cbodley deleted the wip-49065 branch February 4, 2021 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants