Skip to content

Commit

Permalink
Merge pull request #20814 from niupengju/master
Browse files Browse the repository at this point in the history
rgw: Fix multisite Synchronization failed when read and write delete …

Reviewed-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed Apr 12, 2018
2 parents 1bc6634 + a8fd508 commit 607d6cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/rgw/rgw_data_sync.cc
Expand Up @@ -2761,6 +2761,9 @@ int RGWBucketShardIncrementalSyncCR::operate()
syncstopped = false;
continue;
}
if (e.op == CLS_RGW_OP_CANCEL) {
continue;
}
if (e.state != CLS_RGW_STATE_COMPLETE) {
continue;
}
Expand Down
3 changes: 3 additions & 0 deletions src/rgw/rgw_op.cc
Expand Up @@ -4450,6 +4450,9 @@ void RGWDeleteObj::execute()
}
}

if (op_ret == -ECANCELED) {
op_ret = 0;
}
if (op_ret == -ERR_PRECONDITION_FAILED && no_precondition_error) {
op_ret = 0;
}
Expand Down
9 changes: 3 additions & 6 deletions src/rgw/rgw_rados.cc
Expand Up @@ -9017,12 +9017,9 @@ int RGWRados::Object::Delete::delete_obj()

store->remove_rgw_head_obj(op);
r = ref.ioctx.operate(ref.oid, &op);
bool need_invalidate = false;
if (r == -ECANCELED) {
/* raced with another operation, we can regard it as removed */
need_invalidate = true;
r = 0;
}

/* raced with another operation, object state is indeterminate */
const bool need_invalidate = (r == -ECANCELED);

int64_t poolid = ref.ioctx.get_id();
if (r >= 0) {
Expand Down

0 comments on commit 607d6cf

Please sign in to comment.