Project

General

Profile

Actions

Bug #39368

open

Setting custom metadata in multiple versions causes data mtime and metadata mtime to be inconsistent

Added by Snow Si about 5 years ago. Updated about 4 years ago.

Status:
Triaged
Priority:
Normal
Target version:
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Recently, I have encountered a problem:
1. Operation steps:
a) Create a bucket bucket01
b) Set multi-version properties for bucket01
c) Upload the object to bucket01
d) Set custom properties for the current object (mainly call RGWRados::set_attrs)
e) Set the life cycle of the bucket (for current and historical versions)
2. Phenomenon:
a) The historical version is correct and can be deleted
b) The current version is not operating correctly, there is no change (normally a delete tag version should be added)
3. Root cause of the problem:
a) The data mtime of the current object is inconsistent with the metadata mtime (rgw_lc.cc:RGWLC::bucket_lc_process, "if (state->mtime != obj_iter->meta.mtime)//Check mtime again to avoid delete a recently update object As much as possible")
b) The reason for causing a) is that there is a problem in calling RGWRados::set_attrs
4. Solve the problem:
a) Refer to RGWRados::Object::Write::write_meta, add set_olh(obj_ctx, bucket_info, obj, false, NULL, 0, real_time(), false) after calling index_op.complete
b) After the modification, it is found that versioned_epoch will jump (next versioned_epoch = current versioned_epoch + 2),
c) Solve the problem 4.b). Get obj's versioned_epoch (via cls_bucket_list), then call set_olh(obj_ctx, bucket_info, obj, false, NULL, versioned_epoch, real_time(), false)
5. Purpose:
a) Confirm that 2.b) is a problem or not
b) confirm the purpose of "Check mtime again to avoid delete a recently update object as much as possible"(I guess the inconsistency should happen in the process of uploading objects.)
c) Confirm that the idea of ​​4 is correct
d) Confirm a better solution to replace the cls_bucket_list in 4.c)

Actions #1

Updated by Matt Benjamin about 5 years ago

  • Status changed from New to Triaged
  • Assignee set to Matt Benjamin
Actions #3

Updated by Snow Si almost 5 years ago

fix bug:https://github.com/ceph/ceph/pull/28100

Actions #5

Updated by Abhishek Lekshmanan about 4 years ago

  • Assignee changed from Matt Benjamin to Abhishek Lekshmanan
Actions

Also available in: Atom PDF