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-15971 dfs: add support for mounting a snapshot #15321

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

johannlombardi
Copy link
Contributor

Add new dfs interface to mount a specific snapshot.
Provide dfuse command line options to use this feature.

Signed-off-by: Johann Lombardi <[email protected]>

Add new dfs interface to mount a specific snapshot.
Provide dfuse command line options to use this feature.

Signed-off-by: Johann Lombardi <[email protected]>
@johannlombardi johannlombardi requested review from a team as code owners October 15, 2024 13:50
Copy link

github-actions bot commented Oct 15, 2024

Ticket title is 'Add ability to mount a snapshot via dfuse'
Status is 'In Progress'
https://daosio.atlassian.net/browse/DAOS-15971

@daosbuild1
Copy link
Collaborator

@daosbuild1
Copy link
Collaborator

Test stage Build on Leap 15.5 with Intel-C and TARGET_PREFIX completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/1/execution/node/387/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 9 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/1/execution/node/334/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/1/execution/node/357/log

Signed-off-by: Johann Lombardi <[email protected]>
@johannlombardi johannlombardi requested review from a team as code owners October 15, 2024 13:57
@daosbuild1
Copy link
Collaborator

Test stage Build RPM on Leap 15.5 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/1/execution/node/328/log

@daosbuild1
Copy link
Collaborator

@daosbuild1
Copy link
Collaborator

Test stage Build on Leap 15.5 with Intel-C and TARGET_PREFIX completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/2/execution/node/386/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 9 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/2/execution/node/370/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/2/execution/node/360/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on Leap 15.5 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/2/execution/node/359/log

@daosbuild1
Copy link
Collaborator

Test stage Build DEB on Ubuntu 20.04 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/2/execution/node/371/log

Signed-off-by: Johann Lombardi <[email protected]>
@daosbuild1
Copy link
Collaborator

@daosbuild1
Copy link
Collaborator

Test stage Build on Leap 15.5 with Intel-C and TARGET_PREFIX completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/3/execution/node/383/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 9 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/3/execution/node/373/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/3/execution/node/374/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on Leap 15.5 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/3/execution/node/365/log

@daosbuild1
Copy link
Collaborator

Test stage Build DEB on Ubuntu 20.04 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/3/execution/node/342/log

Signed-off-by: Johann Lombardi <[email protected]>
@daosbuild1
Copy link
Collaborator

@daosbuild1
Copy link
Collaborator

Test stage Build on Leap 15.5 with Intel-C and TARGET_PREFIX completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/4/execution/node/385/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 9 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/4/execution/node/360/log

@johannlombardi johannlombardi requested a review from a team as a code owner October 17, 2024 20:24
@johannlombardi
Copy link
Contributor Author

adding @mjmac for the daos cmd output changes.

@@ -962,8 +962,8 @@ func printContainerInfo(out io.Writer, ci *daos.ContainerInfo, verbose bool) err
{"Pool UUID": ci.PoolUUID.String()},
{"Container redundancy factor": fmt.Sprintf("%d", ci.RedundancyFactor)},
{"Number of open handles": fmt.Sprintf("%d", ci.NumHandles)},
{"Latest open time": fmt.Sprintf("%#x (%s)", ci.OpenTime, daos.HLC(ci.OpenTime))},
{"Latest close/modify time": fmt.Sprintf("%#x (%s)", ci.CloseModifyTime, daos.HLC(ci.CloseModifyTime))},
{"Latest open time": fmt.Sprintf("%s (%#x) (%s)", daos.HLC(ci.OpenTime), ci.OpenTime)},
Copy link
Contributor

Choose a reason for hiding this comment

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

There are three formatting directives, but only two values, unless I'm missing something...

Comment on lines 236 to 237
cmd.Infof("%s\t\t\t%s\t\t\t%s", "Timestamp" , "Epoch", "Name")
cmd.Infof("---------\t\t\t-----\t\t\t----")
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency with other commands, it would be better to use the txtfmt package to format these. See printAttributes() for an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

if len(snaps) == 0 {
cmd.Info("no snapshots")
return nil
}
for _, snap := range snaps {
cmd.Infof("0x%x %s", snap.Epoch, snap.Name)
cmd.Infof("%s\t0x%x\t%s", snap.Timestamp, snap.Epoch, snap.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the JSON output look like? Is there any processing that needs to happen to make that output useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The json output looks good and already has the timestamp, epoch and name.

@daosbuild1
Copy link
Collaborator

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

Copy link
Contributor

@mchaarawi mchaarawi left a comment

Choose a reason for hiding this comment

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

looks good to me. but what is the plan for testing this feature?

Comment on lines +182 to +183
* \param[in] epoch Epoch associated with the snapshot to mount.
* If a null epoch is passed, then the snapshot is looked up by \a name.
Copy link
Contributor

Choose a reason for hiding this comment

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

replace null with DAOS_EPOCH_MAX

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 am using DAOS_EPOCH_MAX internally already to mean the tip of the container.

Copy link
Contributor

Choose a reason for hiding this comment

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

no i mean the comment here "If a null epoch is passed". did you mean if 0 epoch is passed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, i meant a epoch of value 0. Null and zero is the same, no? In any case, i can change that.

@daltonbohning
Copy link
Contributor

looks good to me. but what is the plan for testing this feature?

Quick suggestion if we want to use ftest.

  1. IOR, e.g. to write some data
  2. mount dfuse on snapshot
  3. IOR read-verify data in dfuse
  4. Write more data to container
  5. IOR read-verify data from dfuse is still the same

Related, if someone uses the datamover tools with a snapshot-dfuse mount as the source, I think the datamover utils will open the pool/cont NOT at the snapshot. Would need to verify

@johannlombardi
Copy link
Contributor Author

the plan for the testing is to extend the dfs test to have some coverage for the new API and then add a new ftest to run tests like suggested by dalton. I just would like to do that in a different PR because i know it is going to take me forever to complete due to the lack of jenkins access.

@daosbuild1
Copy link
Collaborator

@daosbuild1
Copy link
Collaborator

Test stage Build on Leap 15.5 with Intel-C and TARGET_PREFIX completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/10/execution/node/372/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 9 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/10/execution/node/343/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on EL 8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/10/execution/node/344/log

@daosbuild1
Copy link
Collaborator

Test stage Build RPM on Leap 15.5 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/10/execution/node/338/log

@daosbuild1
Copy link
Collaborator

Test stage Build DEB on Ubuntu 20.04 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-15321/10/execution/node/387/log

Signed-off-by: Johann Lombardi <[email protected]>
@ashleypittman
Copy link
Contributor

Related, if someone uses the datamover tools with a snapshot-dfuse mount as the source, I think the datamover utils will open the pool/cont NOT at the snapshot. Would need to verify

As this is still work-in-progress it would be an idea to just disable the ioctl in this PR, the ioctl will need updating to support this anyway and disabling it would at least prevent any incorrect behaviour by tools built on top of it.
https://github.com/daos-stack/daos/blob/master/src/client/dfuse/ops/ioctl.c#L28

Copy link
Contributor

@mjmac mjmac left a comment

Choose a reason for hiding this comment

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

Go changes look good to me, thanks.

kjacque
kjacque previously approved these changes Oct 22, 2024
src/client/dfs/mnt.c Show resolved Hide resolved
src/client/dfs/mnt.c Outdated Show resolved Hide resolved
@@ -211,6 +215,32 @@ func listContainerSnapshots(ap *C.struct_cmd_args_s, containerID string) ([]*sna
return snapshots, nil
}

func printSnaps(out io.Writer, snaps []*snapshot) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function looks good, but would be nice to have a unit test for this output. I would suggest shifting this function into the cmd/daos/pretty subpackage and reference the existing unit tests for verifying output.

Copy link
Contributor

@kjacque kjacque left a comment

Choose a reason for hiding this comment

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

My other comment is nonblocking. Thanks!

@daosbuild1
Copy link
Collaborator

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

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.

7 participants