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-7177 control: report nvme result from storage prepare #5350

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

Conversation

tanabarr
Copy link
Contributor

@tanabarr tanabarr commented Apr 6, 2021

Update dmg storage prepare command output to display results of SCM and
NVMe prepare operations in a way that will illustrate which actions were
performed in the cases that either one or the other failed and if only
one or the other was requested. If a particular host fails NVMe prepare
but succeeds SCM prepare for example, a host error will be displayed for
the NVMe failure and the coalesced result table will contain a separate
entry for the failed host indicating SCM success but no NVMe result.

Update hashstructure package to v2 in go.mod and update vendor directory.

Signed-off-by: Tom Nabarro tom.nabarro@intel.com

@tanabarr tanabarr requested review from mjmac and kjacque April 6, 2021 22:47
@daosbuild1
Copy link
Collaborator

Base automatically changed from tanabarr/control-clean-hugepages to master April 7, 2021 15:16
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.

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.

Small comments. It wasn't clear to me - wasn't the initial PR this was based on landed? Maybe I'm just confused but it looked like there were repeats of some of those commits showing up in the diff even though you changed the base.

src/control/cmd/dmg/pretty/storage_test.go Outdated Show resolved Hide resolved
src/control/server/ctl_storage_rpc.go Outdated Show resolved Hide resolved
src/control/server/ctl_storage_rpc.go Outdated Show resolved Hide resolved
@tanabarr tanabarr force-pushed the tanabarr/control-dmg-prep-results branch from 057f198 to 54f2de8 Compare April 8, 2021 22:35
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.

@tanabarr tanabarr force-pushed the tanabarr/control-dmg-prep-results branch from 54f2de8 to bf71fcf Compare April 8, 2021 22:38
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.

@tanabarr
Copy link
Contributor Author

tanabarr commented Apr 8, 2021

Small comments. It wasn't clear to me - wasn't the initial PR this was based on landed? Maybe I'm just confused but it looked like there were repeats of some of those commits showing up in the diff even though you changed the base.

Right I had to merge with master after the parent Branch landed, Ended up as quite a big change but the result is more reliable and the results differentiate between independently failing NVMe and SCM results on the same host during storage prepare, see the pretty printer tests for examples

@daosbuild1
Copy link
Collaborator

Test stage Build on CentOS 7 debug completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-5350/4/execution/node/459/log

@daosbuild1
Copy link
Collaborator

Test stage Build on Ubuntu 20.04 with Clang completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-5350/4/execution/node/396/log

@daosbuild1
Copy link
Collaborator

Test stage Build on CentOS 7 release completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-5350/4/execution/node/454/log

@daosbuild1
Copy link
Collaborator

Test stage Build on CentOS 8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-5350/4/execution/node/465/log

@tanabarr tanabarr requested a review from kjacque April 8, 2021 22:45
@daosbuild1
Copy link
Collaborator

Test stage Build RPM on CentOS 7 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-5350/4/execution/node/342/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-5350/4/execution/node/358/log

@daosbuild1
Copy link
Collaborator

Test stage Build on Leap 15 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-5350/4/execution/node/466/log

@tanabarr tanabarr force-pushed the tanabarr/control-dmg-prep-results branch from bf71fcf to 06e4c0c Compare April 8, 2021 22:54
@daosbuild1
Copy link
Collaborator

kjacque
kjacque previously approved these changes Apr 9, 2021
@daosbuild1
Copy link
Collaborator

@tanabarr tanabarr requested a review from kjacque April 9, 2021 10:32
@tanabarr
Copy link
Contributor Author

tanabarr commented Apr 9, 2021

Check patch failure identified here: https://build.hpdd.intel.com/blue/organizations/jenkins/daos-stack%2Fdaos/detail/PR-5350/6/pipeline/43#step-80-log-48 concerns a spelling mistake in a vendored dependency "hashstructure" and should not be fixed in this PR.

@tanabarr
Copy link
Contributor Author

tanabarr commented Apr 9, 2021

I initially thought about using the request flags to filter out the components of the response to print, but I don't want to rely on the correctness of the flags sent to the server (i.e. if some reason the server prepares SCM then I want to know about it, regardless of what was passed to it in the request, and yes the argument can be made that we should be able to operate with the assumption that the behaviour will be correct and the server will only ever perform what it is requested to do, but I would prefer to display the results that are returned Rather than mask based on what was requested)

in the specific case of prepare and scm/nvme results, if we have multiple hosts and on one of those hosts SCM succeeds but NVMe fails (whereas on the rest of the hosts both succeed), we will have a host failure that can be printed in a separate table but to correlate the NVMe failure with the host storage part of the response we need to return a differentiated value for NvmeDevices (otherwise the aggregated results will not reflect the failure),hence needing the ability to differentiate between a nil and empty slice when hashing.

@daosbuild1
Copy link
Collaborator

@tanabarr
Copy link
Contributor Author

tanabarr commented Apr 19, 2021

@mjmac I don't think the proposal to ...make the "prepare SCM" and "prepare NVMe" operations distinct at the API/RPC level will resolve the relevant issue.

The crux of the issue that this PR attempts to resolve is that when building the HostStorageMap that represents groupings of hosts that have responded with identical results, there is no distinction between a host that failed NVMe prepare and one that didn't.

For example even if we run separate RPCs for NVMe we still need to combine the response results and add to the HostStorageMap:

  • host1 returns HS with ScmNamespaces: S1 after prepare SCM success
  • host1 then returns empty HS from prepare NVMe after success
  • host2 returns HS with ScmNamespaces: S1 after prepare SCM success
  • host2 then returns empty HS from prepare NVMe after failure with an entry in HEM

In this scenario, regardless of how you combine the results, both HostStorage structs to be added to the Map will hash to the same key value because no hashable HostStorage field is altered to communicate the NVMe failure.

This can be resolved in a number of ways:

  • Existing solution where HostStorage fields are changed to references (to slice aliases) and NVMe prepare failure can be represented by nil and success by empty slice (the difference between which results in distinct hash digests).
  • Postprocessing HostStorageMap to move entries correlating to HostErrorMap entries into a distinct group for NVMe failures (IMO would look very ugly in the control API).
  • Similar to above but perform postprocessing in pretty printer; alter display of results by extracting entries from HostStorageMap and correlating with HostErrorsMap to reflect the distinction of hosts that have failed NVMe prepare, will require typing/recognition of NVMe specific errors (ugliness would be confined to the DMG layer).
  • Add another member to the HostStorage struct which indicates NVMe prepare result explicitly (similar to "reboot required"), probably the most "correct" way to do it in a number of senses but we are adding a storage prepare specific field to the generic HostStorage type.

Which route would you like me to follow? I don't personally see a particular disadvantage (in comparison to the others) with regard to the currently implemented solution.

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

@tanabarr tanabarr changed the base branch from master to tanabarr/control-scan-nvme-summary April 20, 2021 07:55
@daosbuild1
Copy link
Collaborator

Update dmg storage prepare command output to display results of SCM and
NVMe prepare operations in a way that will illustrate which actions were
performed in the cases that either one or the other failed and if only
one or the other was requested. If a particular host fails NVMe prepare
but succeeds SCM prepare for example, a host error will be displayed for
the NVMe failure and the coalesced result table will contain a separate
entry for the failed host indicating SCM success but no NVMe result.

Signed-off-by: Tom Nabarro <tom.nabarro@intel.com>
@tanabarr tanabarr force-pushed the tanabarr/control-dmg-prep-results branch from 508ee4d to c9878b8 Compare April 20, 2021 08:03
@tanabarr tanabarr requested review from mjmac and kjacque April 20, 2021 08:04
@daosbuild1
Copy link
Collaborator

@daosbuild1
Copy link
Collaborator

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.

It seems basically sane to me, but one thought I have is how stable should we expect the control API to be at this point? Maybe it would be worthwhile to create a different prepare result map, that could include errors for individual SSD components. The fact that it's hard to shoehorn all we need into the HostStorageMap without some subtlety like this, nil vs. empty, could indicate the use case is better served by a new type.

If you fix the unit test failures, I could approve as-is, but it might be better to step back and see if creating a new type reduces or removes the problems we've gone back and forth on.

@@ -34,19 +34,19 @@ var storageHashOpts = hashstructure.HashOptions{
type HostStorage struct {
// NvmeDevices contains the set of NVMe controllers (SSDs)
// in this configuration.
NvmeDevices storage.NvmeControllers `json:"nvme_devices"`
NvmeDevices *storage.NvmeControllers `json:"nvme_devices"`
Copy link
Contributor

Choose a reason for hiding this comment

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

These types are slices, right? Isn't it already possible for slices to be nil?

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 but hashstructure doesn't distinguish between a typed nil slice and an empty slice when generating a hash digest, so in order to generate distinct keys in the HSM I needed to change the field to a pointer, in which case a nil pointer could be distinguished from a pointer to an empty slice (for failure and success respectively) which would each generate a distinct key for the map when hashed

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the crux of the issue I am having with this PR. Because a third-party library doesn't behave the way we want it to in order to handle this narrow use case, we're making changes all throughout our codebase? What if the next version fixes it, or otherwise changes behavior? Will we have more ripples throughout our code to accommodate that?

Given that the code is open source under a permissive license, I think that we could fork it, fix it, use it and submit the fix upstream. I suspect that they would accept a contribution to fix this because after studying the code I think it's an oversight rather than a deliberate design decision.

Alternatively, we could use this as an opportunity to rethink what we're doing here. I'm still not convinced that we need to perform remote NVMe prepare/reset. The server already does an automatic prepare on startup. This seems to me like we're investing a lot of time and energy on solving a problem with limited application.

@tanabarr
Copy link
Contributor Author

It seems basically sane to me, but one thought I have is how stable should we expect the control API to be at this point? Maybe it would be worthwhile to create a different prepare result map, that could include errors for individual SSD components. The fact that it's hard to shoehorn all we need into the HostStorageMap without some subtlety like this, nil vs. empty, could indicate the use case is better served by a new type.

If you fix the unit test failures, I could approve as-is, but it might be better to step back and see if creating a new type reduces or removes the problems we've gone back and forth on.

have had a fair amount of discussion with @mjmac on the topic and he is considering his preferred approach

Signed-off-by: Tom Nabarro <tom.nabarro@intel.com>
@daosbuild1
Copy link
Collaborator

Base automatically changed from tanabarr/control-scan-nvme-summary to master April 22, 2021 19:45
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.

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

Signed-off-by: Tom Nabarro <tom.nabarro@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.

@tanabarr tanabarr requested a review from a team as a code owner February 22, 2022 21:50
@tanabarr tanabarr requested a review from a team as a code owner July 24, 2022 21:17
@kccain kccain removed the request for review from a team September 6, 2022 19:14
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