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
Conversation
7cd1299
to
a25f266
Compare
@oritwas added a second commit that changes how |
@@ -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); |
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.
Let set the default vaule to false , it will result in less code change
a25f266
to
9e2c988
Compare
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>
9e2c988
to
280b8a1
Compare
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 |
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.
@oritwas how does this look?
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.
great
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