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

mimic: rgw: swift object expiry fails when a bucket reshards #29258

Merged
merged 9 commits into from Oct 11, 2019

Conversation

@smithfarm
Copy link
Contributor

smithfarm commented Jul 24, 2019

@smithfarm smithfarm self-assigned this Jul 24, 2019
@smithfarm smithfarm added this to the mimic milestone Jul 24, 2019
@smithfarm smithfarm requested a review from theanalyst Jul 24, 2019
@smithfarm smithfarm added rgw and removed core labels Jul 24, 2019
@smithfarm

This comment has been minimized.

Copy link
Contributor Author

smithfarm commented Jul 24, 2019

@theanalyst Whelp

/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc: In function 'int rgw_remove_object(RGWRados*, const RGWBucketInfo&, const rgw_bucket&, rgw_obj_key&)':
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc:515:82: error: passing 'const RGWBucketInfo' as 'this' argument discards qualifiers [-fpermissive]
   return store->delete_obj(rctx, bucket_info, obj, bucket_info.versioning_status());
                                                                                  ^
In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_rados.h:17:0,
                 from /home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc:18:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_common.h:1370:7: note:   in call to 'int RGWBucketInfo::versioning_status()'
   int versioning_status() { return flags & (BUCKET_VERSIONED | BUCKET_VERSIONS_SUSPENDED | BUCKET_MFA_ENABLED); }
       ^~~~~~~~~~~~~~~~~
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc: In member function 'int RGWBucket::get_policy(RGWBucketAdminOpState&, RGWAccessControlPolicy&)':
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc:1235:36: error: 'obj_ctx' was not declared in this scope
   int ret = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name, bucket_info, NULL, &attrs);
                                    ^~~~~~~
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc:1235:36: note: suggested alternative: 'object_t'
   int ret = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name, bucket_info, NULL, &attrs);
                                    ^~~~~~~
                                    object_t
src/rgw/CMakeFiles/rgw_a.dir/build.make:234: recipe for target 'src/rgw/CMakeFiles/rgw_a.dir/rgw_bucket.cc.o' failed
make[3]: *** [src/rgw/CMakeFiles/rgw_a.dir/rgw_bucket.cc.o] Error 1
@@ -502,7 +502,7 @@ static bool bucket_object_check_filter(const string& oid)
return rgw_obj_key::oid_to_key_in_ns(oid, &key, ns);
}

int rgw_remove_object(RGWRados *store, RGWBucketInfo& bucket_info, rgw_bucket& bucket, rgw_obj_key& key)
int rgw_remove_object(RGWRados *store, const RGWBucketInfo& bucket_info, const rgw_bucket& bucket, rgw_obj_key& key)

This comment has been minimized.

Copy link
@smithfarm

smithfarm Jul 24, 2019

Author Contributor

@theanalyst This line appears to cause build failure:

/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc: In function 'int rgw_remove_object(RGWRados*, const RGWBucketInfo&, const rgw_bucket&, rgw_obj_key&)':
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc:515:82: error: passing 'const RGWBucketInfo' as 'this' argument discards qualifiers [-fpermissive]
   return store->delete_obj(rctx, bucket_info, obj, bucket_info.versioning_status());
                                                                                  ^
In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_rados.h:17,
                 from /home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_bucket.cc:18:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/rgw/rgw_common.h:1370:7: note:   in call to 'int RGWBucketInfo::versioning_status()'
   int versioning_status() { return flags & (BUCKET_VERSIONED | BUCKET_VERSIONS_SUSPENDED | BUCKET_MFA_ENABLED); }
       ^~~~~~~~~~~~~~~~~
src/rgw/CMakeFiles/rgw_a.dir/build.make:234: recipe for target 'src/rgw/CMakeFiles/rgw_a.dir/rgw_bucket.cc.o' failed
make[3]: *** [src/rgw/CMakeFiles/rgw_a.dir/rgw_bucket.cc.o] Error 1
@smithfarm smithfarm force-pushed the smithfarm:wip-39741-mimic branch from 0eec423 to 72de1ef Jul 24, 2019
@theanalyst

This comment has been minimized.

Copy link
Member

theanalyst commented Jul 24, 2019

looks correct

@yuriw

This comment has been minimized.

Copy link
Contributor

yuriw commented Aug 5, 2019

@smithfarm needs rebase

--- pr 29258 --- pulling https://github.com/smithfarm/ceph.git branch wip-39741-mimic
remote: Enumerating objects: 40, done.
remote: Counting objects: 100% (40/40), done.
remote: Total 50 (delta 40), reused 40 (delta 40), pack-reused 10
Unpacking objects: 100% (50/50), done.
From https://github.com/smithfarm/ceph

  • branch wip-39741-mimic -> FETCH_HEAD
    Auto-merging src/rgw/rgw_object_expirer_core.cc
    Auto-merging src/rgw/rgw_admin.cc
    Auto-merging doc/radosgw/dynamicresharding.rst
    Auto-merging PendingReleaseNotes
    CONFLICT (content): Merge conflict in PendingReleaseNotes
    Automatic merge failed; fix conflicts and then commit the result.
    Traceback (most recent call last):
    File "/home/yuriw/wip_master/src/script/build-integration-branch", line 62, in
    assert not r
    AssertionError
theanalyst and others added 9 commits Mar 8, 2019
Adding a note on LC fixes and reshard stale instance fixes

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit dee9ac2)
Some minor updates to the resharding documentation with the aim of
clarifying the language and using terms consistently.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 54b6b65)
Added a note about the commands added to support stale expired object deletion

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 40bf082)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 5c0ee28)
Previously we fetched the bucket instance info which changes during a reshard
causing the bucket info to fail, since the subsequent checks will assume that
would mean a deleted bucket, the expiry hint is purged as well, leaving a non
deleted object as well as a deleted hint. This should fix newer runs of object
expiry processes. Finding out stale expired objects will require more complex
rgw-admin tooling support

Fixes: https://tracker.ceph.com/issues/39495
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 7f958c6)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 1d1ea1f)
These commands help cleanup stale expired objects after a reshard has happened
Contains the following changesets:

* rgw_bucket: add a AdminOp function to cleanup stale expired objects
There is also a dry run option, which will allow listing to just view the
objects before we actually delete them
* rgw_bucket: introduce rgw_object_get_attr helper function
Since this could be re-used across other functions that try to get a single
xattr, both get acl and the new object expire stale commands now use this
function to read the value of a single xattr

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit d4c462a)

Conflicts:
    src/rgw/rgw_admin.cc
- no strcmp(cmd, "event") in mimic
    src/rgw/rgw_bucket.cc
- adapt to mimic
    src/rgw/rgw_bucket.h
- no "fix_lc_shards" in mimic
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 5e56ea6)

Conflicts:
	src/rgw/rgw_common.h
- no "static inline string rgw_bl_str" in mimic
- cbegin -> begin
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from ef8329f)

Conflicts:
    PendingReleaseNotes
@smithfarm smithfarm force-pushed the smithfarm:wip-39741-mimic branch from 72de1ef to 0e53929 Oct 1, 2019
@smithfarm smithfarm added the needs-qa label Oct 1, 2019
@smithfarm smithfarm requested a review from cbodley Oct 1, 2019
@yuriw

This comment has been minimized.

Copy link
Contributor

yuriw commented Oct 4, 2019

@yuriw yuriw merged commit e783331 into ceph:mimic Oct 11, 2019
4 checks passed
4 checks passed
Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
@smithfarm smithfarm deleted the smithfarm:wip-39741-mimic branch Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.