-
Notifications
You must be signed in to change notification settings - Fork 6k
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: The Lifecycle cannot delete objects when using multi-version and setting metadata by RGWRados::set_attrs #28100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sign your commits. See also [1]. This is required for your PR to be merged.
[1] https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#1-sign-your-work
OK, I have just modified it according to your suggestion, Thank you for your comments |
} else { | ||
int flags_tmp = instance_list_entry.flags; | ||
instance_list_entry = entry; | ||
instance_list_entry.flags = flags_tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe instance_list_entry.meta.mtime = meta.mtime is more clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe instance_list_entry.meta.mtime = meta.mtime is more clear
Yes, I do it at the beginning, It has almost no risk. But I think the values of [BI_BUCKET_OBJS_INDEX] and [BI_BUCKET_OBJ_INSTANCE_INDEX] should be the same(According to cls_rgw.cc:rgw_bucket_link_olh ---> cls_rgw.cc: write_obj_entries), then it caused another problem(due to "entry.flags = (entry.key.instance.empty() ? 0 : RGW_BUCKET_DIRENT_FLAG_VER);", current version is not visible, I am not sure what this line of code means)
[PS: In fact, at the beginning I want to call set_olh in the set_attrs function, Just like write_meta]
I wonder if tested reput of null version, it will enter here not from set_attr call. |
Yes, I have considered this problem, so I call "int ret_tmp = read_index_entry(hctx, instance_list_idx, &instance_list_entry);" first, if "ret_tmp == -ENOENT", then it will not execute any statement |
I means versioned object with "null" version id |
Yes, I do it |
9064a2f
to
3608403
Compare
Hello, are there any other questions? |
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
jenkins test make check |
related questions: ceph#17400 Fixes: http://tracker.ceph.com/issues/39368 Signed-off-by: Snow Si <silonghu@inspur.com>
get_list_index_key(entry, &instance_list_idx); | ||
int ret_tmp = read_index_entry(hctx, instance_list_idx, &instance_list_entry); | ||
if (ret_tmp == -ENOENT) { | ||
} else if (ret_tmp < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should just check for >0, unless you want to actually do something in those cases.
could you please add a s3test case that reproduces this bug? |
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
can't reproduce the issue in master, can you provide an example using s3cli or so, I did the following as per #17400 (comment) and see the historical versions being expired as expected |
At present, the master does not have this problem. It removes "if (state-> mtime! = Obj_iter-> meta.mtime) // Check mtime again to avoid delete a recently update object as much as possible" in rgw_lc.cc |
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
@theanalyst @cbodley @dang we can reproduce this way
config lc for the bucket and in the rgw log
the VysPnoeIh9HPP3IvRVkcNClUh5nSO.v version object will never be transition, the other 2 with not tag set is success transition Lines 4546 to 4549 in 4d6d146
|
rgw: fix bug http://tracker.ceph.com/issues/39368
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: #17400
Fixes: http://tracker.ceph.com/issues/39368
Signed-off-by: Snow Si silonghu@inspur.com