Skip to content

Commit

Permalink
Fix RaftCluster boostrap being based on v3 store while apply is based…
Browse files Browse the repository at this point in the history
… on v2 store.

Migration off v2 store was unfinished during v3.5 development etcd-io#12914 leaving RaftCluster broken, half migrated.
This was found in v3.5 and fixed in etcd-io#13348, however this is was not patched on main branch.

This PR makes v3.6 RaftCluster consistent with v3.5 so we can cleanly
migrate off v2 store.

Signed-off-by: Marek Siarkowicz <[email protected]>
  • Loading branch information
serathius committed Sep 26, 2023
1 parent 55253ce commit 8345727
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/etcdserver/api/membership/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ func (c *RaftCluster) Recover(onSet func(*zap.Logger, *semver.Version)) {
c.Lock()
defer c.Unlock()

if c.be != nil {
c.version = c.be.ClusterVersionFromBackend()
c.members, c.removed = c.be.MustReadMembersFromBackend()
} else {
if c.v2store != nil {
c.version = clusterVersionFromStore(c.lg, c.v2store)
c.members, c.removed = membersFromStore(c.lg, c.v2store)
} else {
c.version = c.be.ClusterVersionFromBackend()
c.members, c.removed = c.be.MustReadMembersFromBackend()
}
c.buildMembershipMetric()

Expand Down

0 comments on commit 8345727

Please sign in to comment.