-
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-4763 dfs: New API for anchor split to allow parallelizing dfs_readdir #2652
Conversation
To optimize find performance, we need to be able to execute a parallel readdir. To do that we need to be able to split an anchor among multiple clients. For this, we will split it depending on the number of shards a directory is shared over. We need a new API for the anchor split based on the shard number, and a new API for DFS to return the number of shards of a directory or file. Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
7995d93
to
a0b33e5
Compare
src/client/array/dc_array.c
Outdated
*num_shards = layout->ol_nr; | ||
daos_obj_layout_free(layout); | ||
return 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.
I am not clear on how this is intended to be used for an array TBH. The number of shards in the future might not be stable too (with GIGA+), so i am not sure whether this is a good idea to expose it to the end users.
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.
yea i was debating this myself.. I'll remove that.
src/include/daos_obj.h
Outdated
/** | ||
* Set an anchor for enumeration for one shard only. | ||
* | ||
* \param[in] oh Object open handle. |
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.
There is no object handle in the API below.
src/include/daos_obj.h
Outdated
* \param[in/out] | ||
* anchor Anchor modified for 1 shard only | ||
* | ||
* \return 0 Success and consistent |
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.
???
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.
it should always succeed.. i don't know where i copied that from
src/include/daos_obj.h
Outdated
* \return 0 Success and consistent | ||
*/ | ||
int | ||
daos_obj_anchor_split(uint32_t shard, daos_anchor_t *anchor); |
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.
What I had in mind was more something like this:
/**
* Generate an array of anchors that split the dkey address space for parallel enumeration.
*
* \param[in] oh Object open handle.
* \param[in/out]
* nr Size of anchors array. If 0 is passed, return the optimal size back.
* Number of split anchors returned.
* \param[in/out]
* anchors Array of split anchors
*
* \return ...
*/
int
daos_obj_anchor_split(daos_handle_t oh, uint32_t *nr, daos_anchor_t *anchors);
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.
hmm, but how would you distribute the array of anchors to everyone?
The way it works today is that one guy get the optimal number of anchors (which is number of shards today), and inserts works into the queue for each shard. Others pick that up and generate an anchor using this function for a particular shard. otherwise I will probably need to modify this patch more to allow an anchor to span a range but not all shards, which isn't supported today.
src/object/cli_obj.c
Outdated
dc_obj_anchor_split(uint32_t shard, daos_anchor_t *anchor) { | ||
daos_anchor_set_zero(anchor); | ||
dc_obj_shard2anchor(anchor, shard); | ||
daos_anchor_set_flags(anchor, DIOF_TO_SPEC_SHARD); |
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.
Does it return DAOS_ANCHOR_TYPE_EOF when we reach the end of the shard?
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.
yes, but it required that fix i made above on line 2156
Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
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.
Style warning(s) for job https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-2652/3/
Please review https://wiki.hpdd.intel.com/display/DC/Coding+Rules
src/include/daos_fs.h
Outdated
/** | ||
* Set an anchor with an index based on split done with dfs_obj_anchor_split. | ||
* The anchor passed will be re-intialized and set to start and finish iteration | ||
* based on the specified index. |
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.
(style) trailing whitespace
src/include/daos_fs.h
Outdated
*/ | ||
int | ||
dfs_obj_anchor_set(dfs_obj_t *obj, uint32_t index, daos_anchor_t *anchor); | ||
|
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.
(style) trailing whitespace
src/client/dfs/dfs.c
Outdated
/** TBD - support more than per shard iteration */ | ||
if (*nr !=0 && *nr != layout->ol_nr) { | ||
D_ERROR("For now, num anchors should be the same as what is" | ||
"reported as optimal\n"); |
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.
(style) break quoted strings at a space character
src/client/dfs/dfs.c
Outdated
if (*nr !=0 && *nr != layout->ol_nr) { | ||
D_ERROR("For now, num anchors should be the same as what is" | ||
"reported as optimal\n"); | ||
D_GOTO(out, rc = ENOSYS); |
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.
(style) ENOSYS means 'invalid syscall nr' and nothing else
src/client/dfs/dfs.c
Outdated
return rc; | ||
|
||
/** TBD - support more than per shard iteration */ | ||
if (*nr !=0 && *nr != layout->ol_nr) { |
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.
(style) spaces required around that '!=' (ctx:WxV)
Test stage checkpatch completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-2652/3/execution/node/56/log |
Test stage Functional_Hardware_Small completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-2652/3/execution/node/671/log |
Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
done for regular KV object. Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
Test stage Functional_Hardware_Small completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-2652/5/execution/node/685/log |
Test stage Functional_Hardware_Large completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-2652/5/execution/node/826/log |
Test stage Functional_Hardware_Medium completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-2652/5/execution/node/814/log |
@wangdi1 i think at least one of the rebuild test failures might be due to my change to fix iteration to stop when the SPEC flag is added to the anchor. |
@wangdi1 i think at least one of the rebuild test failures might be due to my change to fix iteration to stop when the SPEC flag is added to the anchor. @mchaarawi I checked the result for #6, it looks like I do not see other rebuild failures. or you mean other failures? |
well in here: I see 1 new failures and three existing. i thought the 1 new is caused by my patch. |
oh, that is 4623. Hmm, not sure why this is marked as new. |
To optimize find performance, we need to be able to execute a parallel
readdir. To do that we need to be able to split an anchor among multiple
clients.
This PR adds 2 new API calls each to DAOS obj and DFS:
Signed-off-by: Mohamad Chaarawi mohamad.chaarawi@intel.com