mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
rgw: Handle stale bucket info in RGWSetBucketVersioning
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
parent
ebb86301b2
commit
a0a1e7c2ef
@ -2090,17 +2090,20 @@ void RGWSetBucketVersioning::execute()
|
||||
}
|
||||
}
|
||||
|
||||
if (versioning_status == VersioningEnabled) {
|
||||
s->bucket_info.flags |= BUCKET_VERSIONED;
|
||||
s->bucket_info.flags &= ~BUCKET_VERSIONS_SUSPENDED;
|
||||
} else if (versioning_status == VersioningSuspended) {
|
||||
s->bucket_info.flags |= (BUCKET_VERSIONED | BUCKET_VERSIONS_SUSPENDED);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
op_ret = retry_raced_bucket_write(store, s, [this] {
|
||||
if (versioning_status == VersioningEnabled) {
|
||||
s->bucket_info.flags |= BUCKET_VERSIONED;
|
||||
s->bucket_info.flags &= ~BUCKET_VERSIONS_SUSPENDED;
|
||||
} else if (versioning_status == VersioningSuspended) {
|
||||
s->bucket_info.flags |= (BUCKET_VERSIONED | BUCKET_VERSIONS_SUSPENDED);
|
||||
} else {
|
||||
return op_ret;
|
||||
}
|
||||
op_ret = store->put_bucket_instance_info(s->bucket_info, false, real_time(),
|
||||
&s->bucket_attrs);
|
||||
return op_ret;
|
||||
});
|
||||
|
||||
op_ret = store->put_bucket_instance_info(s->bucket_info, false, real_time(),
|
||||
&s->bucket_attrs);
|
||||
if (op_ret < 0) {
|
||||
ldout(s->cct, 0) << "NOTICE: put_bucket_info on bucket=" << s->bucket.name
|
||||
<< " returned err=" << op_ret << dendl;
|
||||
|
Loading…
Reference in New Issue
Block a user