Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: rgw_rados: set_attrs now sets the same time for BI & object #17400

Merged
merged 1 commit into from Sep 11, 2017

Conversation

theanalyst
Copy link
Member

RGWRados::set_attrs() used to set slightly different mtimes for the
object and in the bucket dir entry as we do an object write and set the
time at bucket index as the time at that point. Fix this by using the
setting the same mtime for the object as well.

Fixes: http://tracker.ceph.com/issues/21200
Signed-off-by: Abhishek Lekshmanan abhishek@suse.com

`RGWRados::set_attrs()` used to set slightly different mtimes for the
object and in the bucket dir entry as we do an object write and set the
time at bucket index as the time at that point. Fix this by using the
setting the same mtime for the object as well.

Fixes: http://tracker.ceph.com/issues/21200
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
@theanalyst
Copy link
Member Author

currently used #17395 for testing this (eg,. as reported in http://tracker.ceph.com/issues/21200)

Copy link
Member

@yehudasa yehudasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yuriw yuriw merged commit 9addaba into ceph:master Sep 11, 2017
@xxcs
Copy link

xxcs commented Apr 15, 2019

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)

xxcs added a commit to xxcs/ceph that referenced this pull request May 15, 2019
rgw: When using versioning, "call Rados::set_attrs for a version (for example, set self-defined metadata)" resulting in inconsistency between [BI_BUCKET_OBJS_INDEX: entry.meta.mtime] and [BI_BUCKET_OBJ_INSTANCE_INDEX: entry.meta.mtime], [DATA : mtime].(The current version cannot be correctly deleted in the lifecycle function)

related questions: ceph#17400
xxcs added a commit to xxcs/ceph that referenced this pull request May 16, 2019
    rgw: When using versioning, "call Rados::set_attrs for a version (for example, set self-defined metadata)" resulting in inconsistency between [BI_BUCKET_OBJS_INDEX: entry.meta.mtime] and [BI_BUCKET_OBJ_INSTANCE_INDEX: entry.meta.mtime], [DATA : mtime].(The current version cannot be correctly deleted in the lifecycle function)

    related questions: ceph#17400

    Fixes: http://tracker.ceph.com/issues/39368
    Signed-off-by: Snow Si <2804536059@qq.com>
xxcs added a commit to xxcs/ceph that referenced this pull request Aug 6, 2019
    rgw: When using versioning, "call Rados::set_attrs for a version (for example, set self-defined metadata)" resulting in inconsistency between [BI_BUCKET_OBJS_INDEX: entry.meta.mtime] and [BI_BUCKET_OBJ_INSTANCE_INDEX: entry.meta.mtime], [DATA : mtime].(The current version cannot be correctly deleted in the lifecycle function)

    related questions: ceph#17400

    Fixes: http://tracker.ceph.com/issues/39368
    Signed-off-by: Snow Si <silonghu@inspur.com>
xxcs added a commit to xxcs/ceph that referenced this pull request Aug 6, 2019
rgw: When using versioning, "call Rados::set_attrs for a version (for example, set self-defined metadata)" resulting in inconsistency between [BI_BUCKET_OBJS_INDEX: entry.meta.mtime] and [BI_BUCKET_OBJ_INSTANCE_INDEX: entry.meta.mtime], [DATA : mtime].(The current version cannot be correctly deleted in the lifecycle function)

related questions: ceph#17400

Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si <silonghu@inspur.com>
xxcs added a commit to xxcs/ceph that referenced this pull request Aug 6, 2019
rgw: When using versioning, "call Rados::set_attrs for a version (for example, set self-defined metadata)" resulting in inconsistency between [BI_BUCKET_OBJS_INDEX: entry.meta.mtime] and [BI_BUCKET_OBJ_INSTANCE_INDEX: entry.meta.mtime], [DATA : mtime].(The current version cannot be correctly deleted in the lifecycle function)

related questions: ceph#17400

Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si <silonghu@inspur.com>
xxcs added a commit to xxcs/ceph that referenced this pull request Aug 6, 2019
related questions: ceph#17400
Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si <silonghu@inspur.com>
xxcs added a commit to xxcs/ceph that referenced this pull request Aug 7, 2019
related questions: ceph#17400
Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si <silonghu@inspur.com>
xxcs added a commit to xxcs/ceph that referenced this pull request Aug 7, 2019
related questions: ceph#17400
Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si <silonghu@inspur.com>
xxcs pushed a commit to xxcs/ceph that referenced this pull request Aug 7, 2019
related questions: ceph#17400
Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si <silonghu@inspur.com>
xxcs pushed a commit to xxcs/ceph that referenced this pull request Nov 15, 2019
related questions: ceph#17400
Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si <silonghu@inspur.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants