-
Notifications
You must be signed in to change notification settings - Fork 306
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
DAOS-16486 object: return proper error on stale pool map #15064
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,21 @@ pool_child_lookup_noref(const uuid_t uuid) | |
return NULL; | ||
} | ||
|
||
struct ds_pool_child * | ||
ds_pool_child_find(const uuid_t uuid) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given the logic for find and lookup is mostly the same why not just add a bool opt to lookup to return all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that would cause more code changes. (every caller of ds_pool_child_lookup() needs be changed). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a improper name, I'd rather call it ds_pool_child_lookup_force(), it's confusing to have both find() and lookup() |
||
{ | ||
struct ds_pool_child *child; | ||
|
||
child = pool_child_lookup_noref(uuid); | ||
if (child == NULL) { | ||
D_ERROR(DF_UUID": Pool child isn't found.\n", DP_UUID(uuid)); | ||
return child; | ||
} | ||
|
||
child->spc_ref++; | ||
return child; | ||
} | ||
|
||
struct ds_pool_child * | ||
ds_pool_child_lookup(const uuid_t uuid) | ||
{ | ||
|
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.
just confirm why not just use ds_pool_child_lookup()?
the difference with ds_pool_child_find() is ds_pool_child_find() will not return NULL for POOL_CHILD_STOPPING, so you want it continue to serve IO request when POOL_CHILD_STOPPING?
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.
As the comment explained, If the ds_pool_child is already stopped, it's state will be NEW or STOPPING, then ds_pool_child_lookup() will return NULL.
We'll return error instead of continue server I/O request, but we need to ensure -DER_STALE is returned when pool map is stale (instead of -DER_NO_HDL).