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

sentinel: fix wrong libkv store election path #479

Merged
merged 1 commit into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

## Upgrades notes.

In the k8s store backend, the label that defines the kind of stolon component has changed from `app` to `component`. When upgrading you should update the various resource descriptors setting the k8s component name (`stolon-keeper`, `stolon-sentinel`, `stolon-proxy`) inside the `component` label instead of the `app` label.
* In the k8s store backend, the label that defines the kind of stolon component has changed from `app` to `component`. When upgrading you should update the various resource descriptors setting the k8s component name (`stolon-keeper`, `stolon-sentinel`, `stolon-proxy`) inside the `component` label instead of the `app` label.
* When using the etcdv2 store, due to a wrong leader election path introduced in the last release and now fixed, if your sentinel returns an election error like `election loop error {"error": "102: Not a file ...` you should stop all the sentinels and remove the wrong dir using `etcdctl rmdir /stolon/cluster/$STOLONCLUSTER/sentinel-leader` where `$STOLONCLUSTER` should be substituted with the stolon cluster name (remember to set `ETCDCTL_API=2`).

### v0.10.0

Expand Down
5 changes: 2 additions & 3 deletions pkg/store/kvbacked.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,8 @@ func NewKVBackedElection(kvStore KVStore, path, candidateUID string) Election {
switch kvStore.(type) {
case *libKVStore:
s := kvStore.(*libKVStore)
electionPath := filepath.Join(path, common.SentinelLeaderKey)
candidate := leadership.NewCandidate(s.store, electionPath, candidateUID, MinTTL)
return &libkvElection{store: s, path: electionPath, candidate: candidate}
candidate := leadership.NewCandidate(s.store, path, candidateUID, MinTTL)
return &libkvElection{store: s, path: path, candidate: candidate}
case *etcdV3Store:
etcdV3Store := kvStore.(*etcdV3Store)
return &etcdv3Election{
Expand Down