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-12751 control: Add a daos filesystem evict command. #12331

Merged
merged 16 commits into from
Jul 13, 2023

Conversation

ashleypittman
Copy link
Contributor

Add a command to tell dfuse and the kernel to evict a
path in dfuse. This is implemented via a ioctl that
sets a flag on the file handle, when the file is then
closed the kernel is then told the dentry for the file
is no longer valid which should cause the kernel to
forget the entry and any contents if the entry is
a directory.

Required-githooks: true

Signed-off-by: Ashley Pittman ashley.m.pittman@intel.com

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Bug-tracker data:
Ticket title is 'dfuse needs a mechanism to evict cached pool and container handles'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-12751

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@ashleypittman ashleypittman changed the title DAOS-12751 tool: Add a daos filesystem evict command. DAOS-12751 control: Add a daos filesystem evict command. Jun 9, 2023
@daosbuild1
Copy link
Collaborator

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

src/client/dfuse/ops/open.c Outdated Show resolved Hide resolved
@daosbuild1
Copy link
Collaborator

Add a command to tell dfuse and the kernel to evict a
path in dfuse.  This is implemented via a ioctl that
sets a flag on the file handle, when the file is then
closed the kernel is then told the dentry for the file
is no longer valid which should cause the kernel to
forget the entry and any contents if the entry is
a directory.

Required-githooks: true

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Required-githooks: true
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Comment on lines 157 to 164
if (oh->doh_evict_on_close) {
rc = fuse_lowlevel_notify_inval_entry(fs_handle->dpi_info->di_session,
oh->doh_ie->ie_parent, oh->doh_ie->ie_name,
strnlen(oh->doh_ie->ie_name, NAME_MAX));

if (rc != 0)
DFUSE_TRA_ERROR(oh->doh_ie, "inval_entry() returned: %d (%s)", rc,
strerror(-rc));
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 think this is actually unsafe, once DFUSE_REPLY_ENTRY is called there's no longer a reference on the inode so I will take copies of this before landing.

Copy link
Contributor

@daltonbohning daltonbohning left a comment

Choose a reason for hiding this comment

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

Maybe I misunderstand the ioctl stuff, but how would this work in the case of evicting a pool or container handle? For example, to pick up ACL changes

@@ -37,6 +37,7 @@ type fsCmd struct {
ResetAttr fsResetAttrCmd `command:"reset-attr" description:"reset fs attributes"`
ResetChunkSize fsResetChunkSizeCmd `command:"reset-chunk-size" description:"reset fs chunk size"`
ResetObjClass fsResetOclassCmd `command:"reset-oclass" description:"reset fs obj class"`
DfuseEvict fsDfuseEvictCmd `command:"evict" description:"Evict object from dfuse"`
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is ONLY for dfuse - not DFS - maybe evict -> dfuse-evict?
Or maybe it's okay if it only makes sense for dfuse anyway

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 think the only thing al these commands have in common is they're for POSIX containers and therefore DFS at some level. evict doesn't mean anything in dfs directly that I'm aware of.

Copy link
Contributor

Choose a reason for hiding this comment

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

one thing i was thinking about here is that the daos fs options are on the container (server side), but these dfuse commands apply only on the client side (just the node they are running on). so they are just local operations and only executed on the node where this runs.
i don't know if that counts as grounds that we need to split this off into 2 tools or just have an extension to the dfuse command, or just keep it as it is. what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We discussed this extensively in the working group calls, this was your suggestion.

I'd be fine with making a new subcommand for the daos command other than daos filesystem but I don't want to do it in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes i know, and i was just rethinking this. im fine to keeping it that way for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

we should just add a comment that this is a local client operation

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 agree though, there's a clear distinction between commands that have an effect on the container itself vs commands that change local in-memory state.

Copy link
Contributor

Choose a reason for hiding this comment

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

Something else to keep in mind is that we currently don't guarantee backwards compatibility for the command line, but I wonder if that will/should be a requirement in the future, since changing the command line interface later can be disruptive to deployment, job setup/cleanup, etc.

Required-githooks: true

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Required-githooks: true
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@daosbuild1
Copy link
Collaborator

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

@daosbuild1
Copy link
Collaborator

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

Required-githooks: true
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Required-githooks: true
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Required-githooks: true
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Required-githooks: true
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-12331/12/execution/node/1276/log

docs/user/filesystem.md Outdated Show resolved Hide resolved
Comment on lines 500 to 506
if cmd.Ino != 0 {
if ap.dfuse_mem.found {
cmd.Infof(" Inode %#lx known", cmd.Ino)
} else {
cmd.Infof(" Inode %#lx not known", cmd.Ino)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. It seems like it would be better UX for the command to show an error for an unknown/invalid inode rather than making the user parse the output to figure it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not an error either way, it's in effect polling for the operation to have completed. Maybe the text in this output is badly worded but neither of these is an error. See the changes to filesystem.md in this PR for a full explanation.

Required-githooks: true

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

@daosbuild1
Copy link
Collaborator

Test stage Functional Hardware Medium completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-12331/13/execution/node/1286/log

Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

docs/user/filesystem.md Outdated Show resolved Hide resolved
Comment on lines 712 to 714
Paths can be requested for eviction from dfuse using the `daos filesystem evict` command, this does
not change any data that is stored in DAOS in any way but rather releases local resources. This
command will return the inode number of the path as well as key dfuse metrics.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Paths can be requested for eviction from dfuse using the `daos filesystem evict` command, this does
not change any data that is stored in DAOS in any way but rather releases local resources. This
command will return the inode number of the path as well as key dfuse metrics.
Paths can be requested for eviction from dfuse using the `daos filesystem evict` command. This does
not change any data that is stored in DAOS in any way but rather releases local resources. This
command will return the inode number of the path as well as key dfuse metrics.

docs/user/filesystem.md Outdated Show resolved Hide resolved
docs/user/filesystem.md Outdated Show resolved Hide resolved
src/utils/daos_hdlr.c Outdated Show resolved Hide resolved
utils/node_local_test.py Outdated Show resolved Hide resolved
Test-tag: dfuse
Required-githooks: true

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Copy link
Collaborator

@daosbuild1 daosbuild1 left a comment

Choose a reason for hiding this comment

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

LGTM. No errors found by checkpatch.

Comment on lines +2507 to +2508
rc = errno;
goto out;
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, shouldn't these use D_GOTO?

@wiliamhuang
Copy link
Contributor

Minor issues,
https://github.com/daos-stack/daos/blob/amd/dfuse-evict/src/client/dfuse/ops/ioctl.c#L329
"struct dfuse_mem_query query = {};" can be removed.

https://github.com/daos-stack/daos/blob/amd/dfuse-evict/src/client/dfuse/ops/ioctl.c#L333
"if (in_bufsz != sizeof(query))" --> "if (in_bufsz != sizeof(struct dfuse_mem_query))"

@ashleypittman
Copy link
Contributor Author

Minor issues, https://github.com/daos-stack/daos/blob/amd/dfuse-evict/src/client/dfuse/ops/ioctl.c#L329 "struct dfuse_mem_query query = {};" can be removed.

https://github.com/daos-stack/daos/blob/amd/dfuse-evict/src/client/dfuse/ops/ioctl.c#L333 "if (in_bufsz != sizeof(query))" --> "if (in_bufsz != sizeof(struct dfuse_mem_query))"

Yes, you're right. I've got more PRs to follow in this series, I can fix this up later.

@ashleypittman ashleypittman requested a review from a team July 12, 2023 18:26
@ashleypittman ashleypittman merged commit 20eee6d into master Jul 13, 2023
@ashleypittman ashleypittman deleted the amd/dfuse-evict branch July 13, 2023 07:40
jolivier23 pushed a commit that referenced this pull request Apr 26, 2024
Multiple cherry-picks to add daos fs query feature for fuse
statistics.  Helpful for understanding and tuning DAOS
performance when dfuse is used.

DAOS-13625 dfuse: Merge the info and projection_info structs. (#11881)
DAOS-13658 dfuse: Add filesystem query command. (#12367)
DAOS-12751 control: Add a daos filesystem evict command. (#12331)
DAOS-12751 dfuse: Improve evict command. (#12633)
DAOS-13625 dfuse: Remove dfuse_projection_info entirely. (#12796)
DAOS-13625 dfuse: Replace fs_handle with dfuse_info. (#12894)
DAOS-13625 dfuse: Add core inode_lookup() and inode_decref() functions. (#12573)
DAOS-14411 dfuse: Add per-container statistics. (#12819)

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
jolivier23 pushed a commit that referenced this pull request Apr 26, 2024
Multiple cherry-picks to add daos fs query feature for fuse
statistics.  Helpful for understanding and tuning DAOS
performance when dfuse is used.

DAOS-13625 dfuse: Merge the info and projection_info structs. (#11881)
DAOS-13658 dfuse: Add filesystem query command. (#12367)
DAOS-12751 control: Add a daos filesystem evict command. (#12331)
DAOS-12751 dfuse: Improve evict command. (#12633)
DAOS-13625 dfuse: Remove dfuse_projection_info entirely. (#12796)
DAOS-13625 dfuse: Replace fs_handle with dfuse_info. (#12894)
DAOS-13625 dfuse: Add core inode_lookup() and inode_decref() functions. (#12573)
DAOS-14411 dfuse: Add per-container statistics. (#12819)

Features: dfuse

Required-githooks: true

Change-Id: I8ae3cc743697c2434ae0d54b382ee6c585a3b033
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
jolivier23 pushed a commit that referenced this pull request Apr 26, 2024
Multiple cherry-picks to add daos fs query feature for fuse
statistics.  Helpful for understanding and tuning DAOS
performance when dfuse is used.

DAOS-13625 dfuse: Merge the info and projection_info structs. (#11881)
DAOS-13658 dfuse: Add filesystem query command. (#12367)
DAOS-12751 control: Add a daos filesystem evict command. (#12331)
DAOS-12751 dfuse: Improve evict command. (#12633)
DAOS-13625 dfuse: Remove dfuse_projection_info entirely. (#12796)
DAOS-13625 dfuse: Replace fs_handle with dfuse_info. (#12894)
DAOS-13625 dfuse: Add core inode_lookup() and inode_decref() functions. (#12573)
DAOS-14411 dfuse: Add per-container statistics. (#12819)

Features: dfuse

Required-githooks: true

Change-Id: I8ae3cc743697c2434ae0d54b382ee6c585a3b033
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
jolivier23 pushed a commit that referenced this pull request Apr 26, 2024
Multiple cherry-picks to add daos fs query feature for fuse
statistics.  Helpful for understanding and tuning DAOS
performance when dfuse is used.

DAOS-13625 dfuse: Merge the info and projection_info structs. (#11881)
DAOS-13658 dfuse: Add filesystem query command. (#12367)
DAOS-12751 control: Add a daos filesystem evict command. (#12331)
DAOS-12751 dfuse: Improve evict command. (#12633)
DAOS-13625 dfuse: Remove dfuse_projection_info entirely. (#12796)
DAOS-13625 dfuse: Replace fs_handle with dfuse_info. (#12894)
DAOS-13625 dfuse: Add core inode_lookup() and inode_decref() functions. (#12573)
DAOS-14411 dfuse: Add per-container statistics. (#12819)
DAOS-14411 control: Expose dfuse statistics as yaml. (#13876)

Features: dfuse

Required-githooks: true

Change-Id: I8ae3cc743697c2434ae0d54b382ee6c585a3b033
Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
jolivier23 added a commit that referenced this pull request Apr 29, 2024
Multiple cherry-picks to add daos fs query feature for fuse
statistics.  Helpful for understanding and tuning DAOS
performance when dfuse is used.

DAOS-13625 dfuse: Merge the info and projection_info structs. (#11881)
DAOS-13658 dfuse: Add filesystem query command. (#12367)
DAOS-12751 control: Add a daos filesystem evict command. (#12331)
DAOS-12751 dfuse: Improve evict command. (#12633)
DAOS-13625 dfuse: Remove dfuse_projection_info entirely. (#12796)
DAOS-13625 dfuse: Replace fs_handle with dfuse_info. (#12894)
DAOS-13625 dfuse: Add core inode_lookup() and inode_decref() functions. (#12573)
DAOS-14411 dfuse: Add per-container statistics. (#12819)
DAOS-14411 control: Expose dfuse statistics as yaml. (#13876)

Changed base branch to google/2.4 for daos_build test

Change-Id: I8ae3cc743697c2434ae0d54b382ee6c585a3b033

Signed-off-by: Ashley Pittman <ashley.m.pittman@intel.com>
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
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.

6 participants