func mustUpdateMemberAttrInStore(s store.Store, m *Member) { b, err := json.Marshal(m.Attributes) if err != nil { plog.Panicf("marshal raftAttributes should never fail: %v", err) } p := path.Join(MemberStoreKey(m.ID), attributesSuffix) if _, err := s.Set(p, false, string(b), store.TTLOptionSet{ExpireTime: store.Permanent}); err != nil { plog.Panicf("update raftAttributes should never fail: %v", err) } }
func mustSaveClusterVersionToStore(s store.Store, ver *semver.Version) { if _, err := s.Set(StoreClusterVersionKey(), false, ver.String(), store.TTLOptionSet{ExpireTime: store.Permanent}); err != nil { plog.Panicf("save cluster version should never fail: %v", err) } }