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

Fix leader info repopulation #6167

Merged
merged 4 commits into from
Feb 6, 2019
Merged

Fix leader info repopulation #6167

merged 4 commits into from
Feb 6, 2019

Conversation

jefferai
Copy link
Member

@jefferai jefferai commented Feb 5, 2019

  • Change how we populate and clear leader UUID. This fixes a case where
    if a standby disconnects from an active node and reconnects, without the
    active node restarting, the UUID doesn't change so triggers on a new
    active node don't get run.

  • Add a bunch of test helpers and minor updates to things.

* Change how we populate and clear leader UUID. This fixes a case where
if a standby disconnects from an active node and reconnects, without the
active node restarting, the UUID doesn't change so triggers on a new
active node don't get run.

* Add a bunch of test helpers and minor updates to things.
@jefferai jefferai added this to the 1.0.3 milestone Feb 5, 2019
Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks 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!

import "golang.org/x/crypto/blake2b"

func Blake2b256Hash(key string) []byte {
hf, _ := blake2b.New256(nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

The error being dropped here made me a little nervous at first, but I played with it and tested it out and agree that's the way to go.

vault/ha.go Outdated Show resolved Hide resolved
@@ -108,28 +108,41 @@ func (c *Core) Leader() (isLeader bool, leaderAddr, clusterAddr string, err erro
return false, "", "", nil
}

c.clusterLeaderParamsLock.RLock()
localLeaderUUID := c.clusterLeaderUUID
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we now remove these values from Core?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah

briankassouf
briankassouf previously approved these changes Feb 5, 2019
@jefferai jefferai merged commit 9a980d3 into master Feb 6, 2019
@jefferai jefferai deleted the refreshleaderinfo branch February 6, 2019 02:01
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.

3 participants