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

Diagnose V0: Storage End to End Checks #11468

Merged
merged 30 commits into from
May 2, 2021
Merged

Diagnose V0: Storage End to End Checks #11468

merged 30 commits into from
May 2, 2021

Conversation

HridoyRoy
Copy link
Contributor

@HridoyRoy HridoyRoy commented Apr 26, 2021

This PR writes, reads, and deletes a secret to physical storage in the root path during the operator diagnose command, with a timeout of 20 seconds. The check aims to diagnose latency issues to storage when vault is down.

Copy link
Collaborator

@sgmiller sgmiller 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, we may have to do some error parsing to test the permissions failure case but the best test for storage configuration and operation working is to just try it out. Cheap to do as well.


// Attempt to use storage backend
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might break this out into it's own function for tidiness.

Base automatically changed from diagnose-consul-2 to master April 28, 2021 15:55
@vercel vercel bot temporarily deployed to Preview – vault April 29, 2021 16:13 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 29, 2021 16:15 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 29, 2021 16:59 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 29, 2021 16:59 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 29, 2021 18:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 29, 2021 18:28 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 29, 2021 18:41 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 29, 2021 18:41 Inactive
@HridoyRoy HridoyRoy marked this pull request as ready for review April 29, 2021 18:44
@vercel vercel bot temporarily deployed to Preview – vault April 29, 2021 19:05 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 29, 2021 19:05 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 30, 2021 01:45 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 30, 2021 01:45 Inactive
@HridoyRoy HridoyRoy requested a review from sgmiller April 30, 2021 01:45
@HridoyRoy HridoyRoy changed the title Storage End to End Check [draft] Diagnose V0: Storage End to End Checks Apr 30, 2021
@vercel vercel bot temporarily deployed to Preview – vault-storybook April 30, 2021 01:50 Inactive
@vercel vercel bot temporarily deployed to Preview – vault April 30, 2021 01:50 Inactive
Copy link
Contributor

@swayne275 swayne275 left a comment

Choose a reason for hiding this comment

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

A few style type things, but i think it looks good!

No reason to change if you disagree, i just thought those suggestions would be helpful.

"github.com/hashicorp/vault/sdk/physical"
)

const timeoutCallRead string = "lag Read"
Copy link
Contributor

Choose a reason for hiding this comment

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

could you do a const block here?

e.g.

const (
    thing1 = "hello"
    thing2 = "world"
   ...
)

Copy link
Contributor

Choose a reason for hiding this comment

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

i'm only gonna put one comment for this class of thing, but could you also do the same with other consts and vars? i think it makes it a bit cleaner

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, will do!

// but I don't think List is ever going to break in isolation.
func StorageEndToEndLatencyCheck(ctx context.Context, b physical.Backend) error {

c2 := make(chan string, 1)
Copy link
Contributor

@swayne275 swayne275 Apr 30, 2021

Choose a reason for hiding this comment

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

i don't think this channel needs to be buffered with the current code. you could also do a channel of errors (with nil check instead of success string) which would simplify the code a bit

same with c5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, will do!

@vercel vercel bot temporarily deployed to Preview – vault-storybook May 2, 2021 20:11 Inactive
@vercel vercel bot temporarily deployed to Preview – vault May 2, 2021 20:11 Inactive
@HridoyRoy HridoyRoy merged commit e06b90b into master May 2, 2021
@HridoyRoy HridoyRoy deleted the diagnose-consul-3 branch May 2, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants