From a97052acf4e2e6a8005047493f5234786eaf122e Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Sat, 25 Nov 2023 15:59:58 +0000 Subject: [PATCH] remove unused method and functions Signed-off-by: Benjamin Wang --- server/etcdserver/api/membership/cluster.go | 17 ----------------- server/etcdserver/api/membership/storev2.go | 21 --------------------- 2 files changed, 38 deletions(-) diff --git a/server/etcdserver/api/membership/cluster.go b/server/etcdserver/api/membership/cluster.go index ed035856f9d..f022d29c44e 100644 --- a/server/etcdserver/api/membership/cluster.go +++ b/server/etcdserver/api/membership/cluster.go @@ -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() { diff --git a/server/etcdserver/api/membership/storev2.go b/server/etcdserver/api/membership/storev2.go index 956b2ee21e4..4a1e702aa58 100644 --- a/server/etcdserver/api/membership/storev2.go +++ b/server/etcdserver/api/membership/storev2.go @@ -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 {