Skip to content

Commit

Permalink
Merge pull request etcd-io#17020 from ahrtr/cleanup_20231125
Browse files Browse the repository at this point in the history
Remove unused method and function
  • Loading branch information
serathius authored Nov 25, 2023
2 parents ce0a737 + a97052a commit 7fb6b75
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
17 changes: 0 additions & 17 deletions server/etcdserver/api/membership/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,23 +823,6 @@ func (c *RaftCluster) VotingMemberIDs() []types.ID {
return ids
}

// PushMembershipToStorage is overriding storage information about cluster's
// members, such that they fully reflect internal RaftCluster's storage.
func (c *RaftCluster) PushMembershipToStorage() {
if c.be != nil {
c.be.TrimMembershipFromBackend()
for _, m := range c.members {
c.be.MustSaveMemberToBackend(m)
}
}
if c.v2store != nil {
TrimMembershipFromV2Store(c.lg, c.v2store)
for _, m := range c.members {
mustSaveMemberToStore(c.lg, c.v2store, m)
}
}
}

// buildMembershipMetric sets the knownPeers metric based on the current
// members of the cluster.
func (c *RaftCluster) buildMembershipMetric() {
Expand Down
21 changes: 0 additions & 21 deletions server/etcdserver/api/membership/storev2.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,6 @@ func IsMetaStoreOnly(store v2store.Store) (bool, error) {
return true, nil
}

// TrimMembershipFromV2Store removes all information about members &
// removed_members from the v2 store.
func TrimMembershipFromV2Store(lg *zap.Logger, s v2store.Store) error {
members, removed := membersFromStore(lg, s)

for mID := range members {
_, err := s.Delete(MemberStoreKey(mID), true, true)
if err != nil {
return err
}
}
for mID := range removed {
_, err := s.Delete(RemovedMemberStoreKey(mID), true, true)
if err != nil {
return err
}
}

return nil
}

func verifyNoMembersInStore(lg *zap.Logger, s v2store.Store) {
members, removed := membersFromStore(lg, s)
if len(members) != 0 || len(removed) != 0 {
Expand Down

0 comments on commit 7fb6b75

Please sign in to comment.