Skip to content

Commit 0c578a1

Browse files
committed
rgw: shouldn't call index_op.cancel() when rados op return ETIMEDOUT
when rados op return ETIMEOUT, rgw can't determine whether or not the rados op succeeded, we shouldn't be calling index_op->cancel() in this case Instead, we should leave that pending entry in the index so than bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes() Signed-off-by: Shasha Lu <[email protected]>
1 parent 23fcab7 commit 0c578a1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3343,12 +3343,17 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si
33433343
return 0;
33443344

33453345
done_cancel:
3346-
int ret = index_op->cancel(rctx.dpp, meta.remove_objs, rctx.y, log_op);
3347-
if (ret < 0) {
3348-
ldpp_dout(rctx.dpp, 0) << "ERROR: index_op.cancel() returned ret=" << ret << dendl;
3349-
}
3346+
// if r == -ETIMEDOUT, rgw can't determine whether or not the rados op succeeded
3347+
// we shouldn't be calling index_op->cancel() in this case
3348+
// Instead, we should leave that pending entry in the index so than bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes()
3349+
if (r != -ETIMEDOUT) {
3350+
int ret = index_op->cancel(rctx.dpp, meta.remove_objs, rctx.y, log_op);
3351+
if (ret < 0) {
3352+
ldpp_dout(rctx.dpp, 0) << "ERROR: index_op.cancel() returned ret=" << ret << dendl;
3353+
}
33503354

3351-
meta.canceled = true;
3355+
meta.canceled = true;
3356+
}
33523357

33533358
/* we lost in a race. There are a few options:
33543359
* - existing object was rewritten (ECANCELED)

0 commit comments

Comments
 (0)