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

radosgw-admin: fix for 'realm pull' #8404

Merged
merged 2 commits into from Apr 1, 2016

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Mar 31, 2016

this was causing teuthology failures in 'radosgw-admin realm pull':

ERROR creating control for new realm realm0: (17) File exists

'realm pull' calls RGWRealm::create() with exclusive=false, but RGWRealm::create_control() was using exclusive=true

Signed-off-by: Casey Bodley cbodley@redhat.com

@cbodley
Copy link
Contributor Author

cbodley commented Mar 31, 2016

@oritwas added a second commit that changes how RGWSystemMetaObj::set_as_default() works for 'realm create' and 'zone create', to address http://tracker.ceph.com/issues/15319

@@ -783,7 +783,7 @@ class RGWSystemMetaObj {
}
int init(CephContext *_cct, RGWRados *_store, bool setup_obj = true, bool old_format = false);
virtual int read_default_id(string& default_id, bool old_format = false);
virtual int set_as_default();
virtual int set_as_default(bool exclusive);
Copy link
Member

Choose a reason for hiding this comment

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

Let set the default vaule to false , it will result in less code change

this was causing failures in 'radosgw-admin realm pull':

  ERROR creating control for new realm realm0: (17) File exists

'realm pull' calls RGWRealm::create() with exclusive=false, but
RGWRealm::create_control() was using exclusive=true

Signed-off-by: Casey Bodley <cbodley@redhat.com>
this dodges the race in RGWRealm::create() and RGWZoneParams::create()
that decides whether to set the new object as a default. by calling
set_as_default() with exclusive=true, it will fail with EEXIST if a
default is already set

it also fixes an issue with 'realm pull' on a secondary zone, where a
'default' zone may be created but never actually set_as_default()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
ldout(cct, 0) << "WARNING: failed to set realm as default realm, ret=" << ret << dendl;
}
// try to set as default. may race with another create, so pass exclusive=true
// so we don't override an existing default
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oritwas how does this look?

Copy link
Member

Choose a reason for hiding this comment

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

great

@oritwas oritwas merged commit f53cb12 into ceph:master Apr 1, 2016
@cbodley cbodley deleted the wip-rgw-realm-pull-fix branch April 11, 2016 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants