Skip to content

Commit

Permalink
Merge pull request #479 from sgotti/fix_libkvstore_election_path
Browse files Browse the repository at this point in the history
sentinel: fix wrong libkv store election path
  • Loading branch information
sgotti committed Apr 26, 2018
2 parents db77fba + 6fd7d15 commit ca5ca5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit ca5ca5a

Please sign in to comment.