From 6fd7d1576da834c6d34ec7d46d49288e3c836a4c Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Mon, 23 Apr 2018 15:19:47 +0200 Subject: [PATCH] sentinel: fix wrong libkv store election path --- CHANGELOG.md | 3 ++- pkg/store/kvbacked.go | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b477c08db..11f1fc251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pkg/store/kvbacked.go b/pkg/store/kvbacked.go index 761510edf..320e5c736 100644 --- a/pkg/store/kvbacked.go +++ b/pkg/store/kvbacked.go @@ -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{