Merge pull request #39182 from cbodley/wip-49065

rgw multisite: fix RGWCoroutine error handling

Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
Casey Bodley 2021-02-04 11:04:03 -05:00 committed by GitHub
commit cbfc083289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -973,7 +973,9 @@ bool RGWCoroutine::drain_children(int num_cr_left,
yield wait_for_child();
int ret;
uint64_t stack_id;
while (collect(&ret, skip_stack, &stack_id)) {
bool again = false;
do {
again = collect(&ret, skip_stack, &stack_id);
if (ret < 0) {
ldout(cct, 10) << "collect() returned ret=" << ret << dendl;
/* we should have reported this error */
@ -982,7 +984,7 @@ bool RGWCoroutine::drain_children(int num_cr_left,
if (cb) {
(*cb)(stack_id, ret);
}
}
} while (again);
}
done = true;
}
@ -1000,7 +1002,9 @@ bool RGWCoroutine::drain_children(int num_cr_left,
yield wait_for_child();
int ret;
uint64_t stack_id;
while (collect(&ret, nullptr, &stack_id)) {
bool again = false;
do {
again = collect(&ret, nullptr, &stack_id);
if (ret < 0) {
ldout(cct, 10) << "collect() returned ret=" << ret << dendl;
/* we should have reported this error */
@ -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;
num_cr_left = 0; /* need to drain all */
}
}
}
} while (again);
}
done = true;
}

View File

@ -1226,8 +1226,6 @@ class RGWRunBucketSourcesSyncCR : public RGWCoroutine {
RGWRESTConn *conn{nullptr};
rgw_zone_id last_zone;
int ret{0};
int source_num_shards{0};
int target_num_shards{0};