-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
VAULT-31755: Add removed and HA health to the sys/health endpoint #28991
base: main
Are you sure you want to change the base?
Conversation
CI Results: |
Build Results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
// Partition forces the inmem layer to disconnect itself from peers and prevents | ||
// creating new connections. The returned function will add all peers back | ||
// and re-enable connections | ||
func (l *InmemLayer) Partition() (unpartition func()) { | ||
l.l.Lock() | ||
peersCopy := make([]*InmemLayer, 0, len(l.peers)) | ||
for _, peer := range l.peers { | ||
peersCopy = append(peersCopy, peer) | ||
} | ||
l.l.Unlock() | ||
l.DisconnectAll() | ||
return func() { | ||
for _, peer := range peersCopy { | ||
l.Connect(peer) | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very neat!
@@ -977,6 +977,10 @@ func (c *TestClusterCore) ClusterListener() *cluster.Listener { | |||
return c.getClusterListener() | |||
} | |||
|
|||
func (c *TestClusterCore) NetworkLayer() cluster.NetworkLayer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I made an identical getter function in a yet-unmerged PR, and wrote this comment out, so I figured I might as well suggest the godoc here 😄
I know that the function itself is super simple, but our overall test cluster machinery is complex, so I think it's nice to clarify intent behind any exported functions for future devs, etc. Feel free to discard this if it's over the top.
func (c *TestClusterCore) NetworkLayer() cluster.NetworkLayer { | |
// NetworkLayer returns the network layer for the cluster core. This can be used | |
// in conjunction with the cluster.InmemLayer to disconnect specific nodes from | |
// the cluster when we need to simulate abrupt node failure or a network | |
// partition in NewTestCluster tests. | |
func (c *TestClusterCore) NetworkLayer() cluster.NetworkLayer { |
Description
This PR adds HA health and removed as statuses to the sys/health endpoint.
removedcode
query parameter)haunhealthycode
query parameter)The health response has new fields:
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.