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

DAOS-16924 dfs: new readdir API #15687

Open
wants to merge 1 commit into
base: feature/dfs_dcache
Choose a base branch
from

Conversation

mchaarawi
Copy link
Contributor

Add a new DFS readdir API that utilizes a new DFS anchor object which can be updated to include caching parameters for future calls. This API will be more useful when client side caching for readdir is implemented to access buckets of readdir entries.

Required-githooks: true

Before requesting gatekeeper:

  • Two review approvals and any prior change requests have been resolved.
  • Testing is complete and all tests passed or there is a reason documented in the PR why it should be force landed and forced-landing tag is set.
  • Features: (or Test-tag*) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.
  • Commit messages follows the guidelines outlined here.
  • Any tests skipped by the ticket being addressed have been run and passed in the PR.

Gatekeeper:

  • You are the appropriate gatekeeper to be landing the patch.
  • The PR has 2 reviews by people familiar with the code, including appropriate owners.
  • Githooks were used. If not, request that user install them and check copyright dates.
  • Checkpatch issues are resolved. Pay particular attention to ones that will show up on future PRs.
  • All builds have passed. Check non-required builds for any new compiler warnings.
  • Sufficient testing is done. Check feature pragmas and test tags and that tests skipped for the ticket are run and now pass with the changes.
  • If applicable, the PR has addressed any potential version compatibility issues.
  • Check the target branch. If it is master branch, should the PR go to a feature branch? If it is a release branch, does it have merge approval in the JIRA ticket.
  • Extra checks if forced landing is requested
    • Review comments are sufficiently resolved, particularly by prior reviewers that requested changes.
    • No new NLT or valgrind warnings. Check the classic view.
    • Quick-build or Quick-functional is not used.
  • Fix the commit message upon landing. Check the standard here. Edit it to create a single commit. If necessary, ask submitter for a new summary.

Copy link

github-actions bot commented Jan 6, 2025

Ticket title is 'add readdir api that uses a new DFS anchor'
Status is 'Open'
https://daosio.atlassian.net/browse/DAOS-16924

@daosbuild1
Copy link
Collaborator

Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15687/1/testReport/

@daosbuild1
Copy link
Collaborator

Test stage NLT on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15687/2/testReport/

@daosbuild1
Copy link
Collaborator

Test stage Functional on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15687/3/testReport/

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Large completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-15687/5/testReport/

@mchaarawi mchaarawi force-pushed the mschaara/dfs_readdir_dcache branch from ed233a5 to cc3cadb Compare January 8, 2025 21:57
Add a new DFS readdir API that utilizes a new DFS anchor object which
can be updated to include caching parameters for future calls. This API
will be more useful when client side caching for readdir is implemented
to access buckets of readdir entries.

Required-githooks: true

Signed-off-by: Mohamad Chaarawi <[email protected]>
@mchaarawi mchaarawi force-pushed the mschaara/dfs_readdir_dcache branch from cc3cadb to fa69eed Compare January 8, 2025 22:12
@daosbuild1
Copy link
Collaborator

Test stage Unit Test on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-15687/6/display/redirect

@mchaarawi mchaarawi marked this pull request as ready for review January 9, 2025 15:00
@mchaarawi mchaarawi requested review from a team as code owners January 9, 2025 15:00
Copy link
Contributor

@knard38 knard38 left a comment

Choose a reason for hiding this comment

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

Overall looks good to me.
Just minor questions.

@@ -990,3 +991,6 @@ drec_del(dfs_dcache_t *dcache, char *path, dfs_obj_t *parent)

return dcache->drec_del_fn(dcache, path, parent);
}

// dcache_readdir(dfs_dcache_t *dcache, dfs_obj_t *obj, dfs_dir_anchor_t *anchor, struct dirent dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be usefull to add some comments on why this function declaration is commented.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since i plan to add it next :-)
note this is all going to the feature branch, so this is just the first piece of the puzzle

/** if we did not enumerate anything, try again to make sure we hit EOF */
if (nr == 0) {
if (daos_anchor_is_eof(&anchor->dda_anchor_int))
return -1; /** typically EOF code */
Copy link
Contributor

@knard38 knard38 Jan 15, 2025

Choose a reason for hiding this comment

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

Probably a stupid question but why not using EOF macro directly ?

Suggested change
return -1; /** typically EOF code */
return EOF;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i can make that change in the follow on PR. i just wasn't sure if EOF was -1 on all linux platforms

if (dfs->dcache == NULL)
return readdir_int(dfs, obj, &anchor->dda_anchor_int, 1, &dir, NULL);
else
dcache_readdir(dfs->dcache, obj, anchor, dir);
Copy link
Contributor

Choose a reason for hiding this comment

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

dir --> entry?
You can update it in future PR since the code is currently commented out.

#if 0
/** if no caching, just use the internal anchor with 1 entry */
if (dfs->dcache == NULL)
return readdir_int(dfs, obj, &anchor->dda_anchor_int, 1, &dir, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

dir --> entry?

@wiliamhuang
Copy link
Contributor

This PR looks fine to me.
One concern: dfs_readdir_s() calls readdir_int() to retrieve a single dir entry when caching is not enabled. This could generate a lot of RPC.
If we always enable caching, it would not be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants