Merge pull request #22217 from tianshan/fix_dir_suggest_changes

rgw: fix index update in dir_suggest_changes

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
This commit is contained in:
Casey Bodley 2018-06-22 09:48:41 -04:00 committed by GitHub
commit cc9207745c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1912,7 +1912,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
string cur_change_key;
encode_obj_index_key(cur_change.key, &cur_change_key);
int ret = cls_cxx_map_get_val(hctx, cur_change_key, &cur_disk_bl);
if (ret < 0 && ret != -ENOENT)
if (ret < 0)
return -EINVAL;
if (cur_disk_bl.length()) {
@ -1969,18 +1969,6 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
}
break;
case CEPH_RGW_UPDATE:
if (!cur_disk.exists) {
// this update would only have been sent by the rgw client
// if the rgw_bucket_dir_entry existed, however between that
// check and now the entry has diappeared, so we were likely
// in the midst of a delete op, and we will not recreate the
// entry
CLS_LOG(10,
"CEPH_RGW_UPDATE not applied because rgw_bucket_dir_entry"
" no longer exists\n");
break;
}
CLS_LOG(10, "CEPH_RGW_UPDATE name=%s instance=%s total_entries: %" PRId64 " -> %" PRId64 "\n",
cur_change.key.name.c_str(), cur_change.key.instance.c_str(), stats.num_entries, stats.num_entries + 1);