kubernetes/vendor/go.etcd.io/etcd/server/v3/etcdserver/server.go

const DefaultSnapshotCount

const DefaultSnapshotCatchUpEntries

const StoreClusterPrefix

const StoreKeysPrefix

const HealthInterval

const purgeFileInterval

const maxInFlightMsgSnap

const releaseDelayAfterSnapshot

const maxPendingRevokes

const recommendedMaxRequestBytes

const readyPercent

const DowngradeEnabledPath

var monitorVersionInterval

var recommendedMaxRequestBytesString

var storeMemberAttributeRegexp

func init() {}

type Response

type ServerV2

type ServerV3

func (s *EtcdServer) ClientCertAuthEnabled() bool {}

type Server

type EtcdServer

type backendHooks

func (bh *backendHooks) OnPreCommitUnsafe(tx backend.BatchTx) {}

func (bh *backendHooks) SetConfState(confState *raftpb.ConfState) {}

// NewServer creates a new EtcdServer from the supplied configuration. The
// configuration is considered static for the lifetime of the EtcdServer.
func NewServer(cfg config.ServerConfig) (srv *EtcdServer, err error) {}

// assertNoV2StoreContent -> depending on the deprecation stage, warns or report an error
// if the v2store contains custom content.
func assertNoV2StoreContent(lg *zap.Logger, st v2store.Store, deprecationStage config.V2DeprecationEnum) error {}

func (s *EtcdServer) Logger() *zap.Logger {}

func (s *EtcdServer) Config() config.ServerConfig {}

func tickToDur(ticks int, tickMs uint) string {}

func (s *EtcdServer) adjustTicks() {}

// Start performs any initialization of the Server necessary for it to
// begin serving requests. It must be called before Do or Process.
// Start must be non-blocking; any long-running server functionality
// should be implemented in goroutines.
func (s *EtcdServer) Start() {}

// start prepares and starts server in a new goroutine. It is no longer safe to
// modify a server's fields after it has been sent to Start.
// This function is just used for testing.
func (s *EtcdServer) start() {}

func (s *EtcdServer) purgeFile() {}

func (s *EtcdServer) Cluster() api.Cluster {}

func (s *EtcdServer) ApplyWait() <-chan struct{}

type ServerPeer

func (s *EtcdServer) LeaseHandler() http.Handler {}

func (s *EtcdServer) RaftHandler() http.Handler {}

type ServerPeerV2

func (s *EtcdServer) DowngradeInfo() *membership.DowngradeInfo {}

type downgradeEnabledHandler

func (s *EtcdServer) DowngradeEnabledHandler() http.Handler {}

func (h *downgradeEnabledHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {}

// Process takes a raft message and applies it to the server's raft state
// machine, respecting any timeout of the given context.
func (s *EtcdServer) Process(ctx context.Context, m raftpb.Message) error {}

func (s *EtcdServer) IsIDRemoved(id uint64) bool {}

func (s *EtcdServer) ReportUnreachable(id uint64) {}

// ReportSnapshot reports snapshot sent status to the raft state machine,
// and clears the used snapshot from the snapshot store.
func (s *EtcdServer) ReportSnapshot(id uint64, status raft.SnapshotStatus) {}

type etcdProgress

type raftReadyHandler

func (s *EtcdServer) run() {}

func (s *EtcdServer) revokeExpiredLeases(leases []*lease.Lease) {}

// isActive checks if the etcd instance is still actively processing the
// heartbeat message (ticks). It returns false if no heartbeat has been
// received within 3 * tickMs.
func (s *EtcdServer) isActive() bool {}

// ensureLeadership checks whether current member is still the leader.
func (s *EtcdServer) ensureLeadership() bool {}

// Cleanup removes allocated objects by EtcdServer.NewServer in
// situation that EtcdServer::Start was not called (that takes care of cleanup).
func (s *EtcdServer) Cleanup() {}

func (s *EtcdServer) applyAll(ep *etcdProgress, apply *apply) {}

func (s *EtcdServer) applySnapshot(ep *etcdProgress, apply *apply) {}

func (s *EtcdServer) applyEntries(ep *etcdProgress, apply *apply) {}

func (s *EtcdServer) triggerSnapshot(ep *etcdProgress) {}

func (s *EtcdServer) hasMultipleVotingMembers() bool {}

func (s *EtcdServer) isLeader() bool {}

// MoveLeader transfers the leader to the given transferee.
func (s *EtcdServer) MoveLeader(ctx context.Context, lead, transferee uint64) error {}

// TransferLeadership transfers the leader to the chosen transferee.
func (s *EtcdServer) TransferLeadership() error {}

// HardStop stops the server without coordination with other members in the cluster.
func (s *EtcdServer) HardStop() {}

// Stop stops the server gracefully, and shuts down the running goroutine.
// Stop should be called after a Start(s), otherwise it will block forever.
// When stopping leader, Stop transfers its leadership to one of its peers
// before stopping the server.
// Stop terminates the Server and performs any necessary finalization.
// Do and Process cannot be called after Stop has been invoked.
func (s *EtcdServer) Stop() {}

// ReadyNotify returns a channel that will be closed when the server
// is ready to serve client requests
func (s *EtcdServer) ReadyNotify() <-chan struct{}

func (s *EtcdServer) stopWithDelay(d time.Duration, err error) {}

// StopNotify returns a channel that receives a empty struct
// when the server is stopped.
func (s *EtcdServer) StopNotify() <-chan struct{}

// StoppingNotify returns a channel that receives a empty struct
// when the server is being stopped.
func (s *EtcdServer) StoppingNotify() <-chan struct{}

func (s *EtcdServer) SelfStats() []byte {}

func (s *EtcdServer) LeaderStats() []byte {}

func (s *EtcdServer) StoreStats() []byte {}

func (s *EtcdServer) checkMembershipOperationPermission(ctx context.Context) error {}

func (s *EtcdServer) AddMember(ctx context.Context, memb membership.Member) ([]*membership.Member, error) {}

func (s *EtcdServer) mayAddMember(memb membership.Member) error {}

func (s *EtcdServer) RemoveMember(ctx context.Context, id uint64) ([]*membership.Member, error) {}

// PromoteMember promotes a learner node to a voting node.
func (s *EtcdServer) PromoteMember(ctx context.Context, id uint64) ([]*membership.Member, error) {}

// promoteMember checks whether the to-be-promoted learner node is ready before sending the promote
// request to raft.
// The function returns ErrNotLeader if the local node is not raft leader (therefore does not have
// enough information to determine if the learner node is ready), returns ErrLearnerNotReady if the
// local node is leader (therefore has enough information) but decided the learner node is not ready
// to be promoted.
func (s *EtcdServer) promoteMember(ctx context.Context, id uint64) ([]*membership.Member, error) {}

func (s *EtcdServer) mayPromoteMember(id types.ID) error {}

// check whether the learner catches up with leader or not.
// Note: it will return nil if member is not found in cluster or if member is not learner.
// These two conditions will be checked before apply phase later.
func (s *EtcdServer) isLearnerReady(id uint64) error {}

func (s *EtcdServer) mayRemoveMember(id types.ID) error {}

func (s *EtcdServer) UpdateMember(ctx context.Context, memb membership.Member) ([]*membership.Member, error) {}

func (s *EtcdServer) setCommittedIndex(v uint64) {}

func (s *EtcdServer) getCommittedIndex() uint64 {}

func (s *EtcdServer) setAppliedIndex(v uint64) {}

func (s *EtcdServer) getAppliedIndex() uint64 {}

func (s *EtcdServer) setTerm(v uint64) {}

func (s *EtcdServer) getTerm() uint64 {}

func (s *EtcdServer) setLead(v uint64) {}

func (s *EtcdServer) getLead() uint64 {}

func (s *EtcdServer) LeaderChangedNotify() <-chan struct{}

// FirstCommitInTermNotify returns channel that will be unlocked on first
// entry committed in new term, which is necessary for new leader to answer
// read-only requests (leader is not able to respond any read-only requests
// as long as linearizable semantic is required)
func (s *EtcdServer) FirstCommitInTermNotify() <-chan struct{}

type RaftStatusGetter

func (s *EtcdServer) ID() types.ID {}

func (s *EtcdServer) Leader() types.ID {}

func (s *EtcdServer) Lead() uint64 {}

func (s *EtcdServer) CommittedIndex() uint64 {}

func (s *EtcdServer) AppliedIndex() uint64 {}

func (s *EtcdServer) Term() uint64 {}

type confChangeResponse

// configure sends a configuration change through consensus and
// then waits for it to be applied to the server. It
// will block until the change is performed or there is an error.
func (s *EtcdServer) configure(ctx context.Context, cc raftpb.ConfChange) ([]*membership.Member, error) {}

// sync proposes a SYNC request and is non-blocking.
// This makes no guarantee that the request will be proposed or performed.
// The request will be canceled after the given timeout.
func (s *EtcdServer) sync(timeout time.Duration) {}

// publishV3 registers server information into the cluster using v3 request. The
// information is the JSON representation of this server's member struct, updated
// with the static clientURLs of the server.
// The function keeps attempting to register until it succeeds,
// or its server is stopped.
func (s *EtcdServer) publishV3(timeout time.Duration) {}

// publish registers server information into the cluster. The information
// is the JSON representation of this server's member struct, updated with the
// static clientURLs of the server.
// The function keeps attempting to register until it succeeds,
// or its server is stopped.
//
// Use v2 store to encode member attributes, and apply through Raft
// but does not go through v2 API endpoint, which means even with v2
// client handler disabled (e.g. --enable-v2=false), cluster can still
// process publish requests through rafthttp
// TODO: Remove in 3.6 (start using publishV3)
func (s *EtcdServer) publish(timeout time.Duration) {}

func (s *EtcdServer) sendMergedSnap(merged snap.Message) {}

// apply takes entries received from Raft (after it has been committed) and
// applies them to the current state of the EtcdServer.
// The given entries should not be empty.
func (s *EtcdServer) apply(
	es []raftpb.Entry,
	confState *raftpb.ConfState,
) (appliedt uint64, appliedi uint64, shouldStop bool) {}

// applyEntryNormal apples an EntryNormal type raftpb request to the EtcdServer
func (s *EtcdServer) applyEntryNormal(e *raftpb.Entry) {}

func (s *EtcdServer) notifyAboutFirstCommitInTerm() {}

// applyConfChange applies a ConfChange to the server. It is only
// invoked with a ConfChange that has already passed through Raft
func (s *EtcdServer) applyConfChange(cc raftpb.ConfChange, confState *raftpb.ConfState, shouldApplyV3 membership.ShouldApplyV3) (bool, error) {}

// TODO: non-blocking snapshot
func (s *EtcdServer) snapshot(snapi uint64, confState raftpb.ConfState) {}

// CutPeer drops messages to the specified peer.
func (s *EtcdServer) CutPeer(id types.ID) {}

// MendPeer recovers the message dropping behavior of the given peer.
func (s *EtcdServer) MendPeer(id types.ID) {}

func (s *EtcdServer) PauseSending() {}

func (s *EtcdServer) ResumeSending() {}

func (s *EtcdServer) ClusterVersion() *semver.Version {}

// monitorVersions checks the member's version every monitorVersionInterval.
// It updates the cluster version if all members agrees on a higher one.
// It prints out log if there is a member with a higher version than the
// local version.
// TODO switch to updateClusterVersionV3 in 3.6
func (s *EtcdServer) monitorVersions() {}

func (s *EtcdServer) monitorKVHash() {}

func (s *EtcdServer) monitorCompactHash() {}

func (s *EtcdServer) updateClusterVersionV2(ver string) {}

func (s *EtcdServer) updateClusterVersionV3(ver string) {}

func (s *EtcdServer) monitorDowngrade() {}

func (s *EtcdServer) parseProposeCtxErr(err error, start time.Time) error {}

func (s *EtcdServer) KV() mvcc.WatchableKV {}

func (s *EtcdServer) Backend() backend.Backend {}

func (s *EtcdServer) AuthStore() auth.AuthStore {}

func (s *EtcdServer) restoreAlarms() error {}

// GoAttach creates a goroutine on a given function and tracks it using
// the etcdserver waitgroup.
// The passed function should interrupt on s.StoppingNotify().
func (s *EtcdServer) GoAttach(f func()) {}

func (s *EtcdServer) Alarms() []*pb.AlarmMember {}

// IsLearner returns if the local member is raft learner
func (s *EtcdServer) IsLearner() bool {}

// IsMemberExist returns if the member with the given id exists in cluster.
func (s *EtcdServer) IsMemberExist(id types.ID) bool {}

// raftStatus returns the raft status of this etcd node.
func (s *EtcdServer) raftStatus() raft.Status {}

func (s *EtcdServer) getTxPostLockInsideApplyHook() func() {}

func maybeDefragBackend(cfg config.ServerConfig, be backend.Backend) error {}

func (s *EtcdServer) CorruptionChecker() CorruptionChecker {}