Repository: etcd-io/etcd
File: server/features/etcd_features.go (Go)

Code before:
	InitialCorruptCheck featuregate.Feature = "InitialCorruptCheck"
	// CompactHashCheck enables leader to periodically check followers compaction hashes.
	// owner: @serathius
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/14120
	CompactHashCheck featuregate.Feature = "CompactHashCheck"
	// LeaseCheckpoint enables leader to send regular checkpoints to other members to prevent reset of remaining TTL on leader change.
	// owner: @serathius
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/13508
	LeaseCheckpoint featuregate.Feature = "LeaseCheckpoint"
	// LeaseCheckpointPersist enables persisting remainingTTL to prevent indefinite auto-renewal of long lived leases. Always enabled in v3.6. Should be used to ensure smooth upgrade from v3.5 clusters with this feature enabled.
	// Requires EnableLeaseCheckpoint featuragate to be enabled.
	// TODO: Delete in v3.7
	// owner: @serathius
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/13508
	// Deprecated: Enabled by default in v3.6, to be removed in v3.7.
	LeaseCheckpointPersist featuregate.Feature = "LeaseCheckpointPersist"
	// SetMemberLocalAddr enables using the first specified and non-loopback local address from initial-advertise-peer-urls as the local address when communicating with a peer.
	// Requires SetMemberLocalAddr featuragate to be enabled.
	// owner: @flawedmatrix
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/17661
	SetMemberLocalAddr featuregate.Feature = "SetMemberLocalAddr"
	// FastLeaseKeepAlive enables skipping wait applied index when renewing an existed lease.
	// owner: @aaronjzhang
	// alpha: v3.7
	// main PR: https://github.com/etcd-io/etcd/pull/20589
	FastLeaseKeepAlive featuregate.Feature = "FastLeaseKeepAlive"
)

var DefaultEtcdServerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
	StopGRPCServiceOnDefrag:      {Default: false, PreRelease: featuregate.Alpha},
	InitialCorruptCheck:          {Default: false, PreRelease: featuregate.Alpha},
	CompactHashCheck:             {Default: false, PreRelease: featuregate.Alpha},
	TxnModeWriteWithSharedBuffer: {Default: true, PreRelease: featuregate.Beta},
	LeaseCheckpoint:              {Default: false, PreRelease: featuregate.Alpha},
	LeaseCheckpointPersist:       {Default: false, PreRelease: featuregate.Alpha},
	SetMemberLocalAddr:           {Default: false, PreRelease: featuregate.Alpha},
	FastLeaseKeepAlive:           {Default: false, PreRelease: featuregate.Alpha},
}

func NewDefaultServerFeatureGate(name string, lg *zap.Logger) featuregate.FeatureGate {
	fg := featuregate.New(fmt.Sprintf("%sServerFeatureGate", name), lg)
	if err := fg.Add(DefaultEtcdServerFeatureGates); err != nil {
		panic(err)
	}
	return fg
}


Review comment (suggestion):
```suggestion
	// FastLeaseKeepAlive enables lease renewal to skip waiting for the applied index.
```

Code after:
	InitialCorruptCheck featuregate.Feature = "InitialCorruptCheck"
	// CompactHashCheck enables leader to periodically check followers compaction hashes.
	// owner: @serathius
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/14120
	CompactHashCheck featuregate.Feature = "CompactHashCheck"
	// LeaseCheckpoint enables leader to send regular checkpoints to other members to prevent reset of remaining TTL on leader change.
	// owner: @serathius
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/13508
	LeaseCheckpoint featuregate.Feature = "LeaseCheckpoint"
	// LeaseCheckpointPersist enables persisting remainingTTL to prevent indefinite auto-renewal of long lived leases. Always enabled in v3.6. Should be used to ensure smooth upgrade from v3.5 clusters with this feature enabled.
	// Requires EnableLeaseCheckpoint featuragate to be enabled.
	// TODO: Delete in v3.7
	// owner: @serathius
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/13508
	// Deprecated: Enabled by default in v3.6, to be removed in v3.7.
	LeaseCheckpointPersist featuregate.Feature = "LeaseCheckpointPersist"
	// SetMemberLocalAddr enables using the first specified and non-loopback local address from initial-advertise-peer-urls as the local address when communicating with a peer.
	// Requires SetMemberLocalAddr featuragate to be enabled.
	// owner: @flawedmatrix
	// alpha: v3.6
	// main PR: https://github.com/etcd-io/etcd/pull/17661
	SetMemberLocalAddr featuregate.Feature = "SetMemberLocalAddr"
	// FastLeaseKeepAlive enables lease renewal to skip waiting for the applied index.
	// owner: @aaronjzhang
	// beta: v3.7
	// main PR: https://github.com/etcd-io/etcd/pull/20589
	FastLeaseKeepAlive featuregate.Feature = "FastLeaseKeepAlive"
)

var DefaultEtcdServerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
	StopGRPCServiceOnDefrag:      {Default: false, PreRelease: featuregate.Alpha},
	InitialCorruptCheck:          {Default: false, PreRelease: featuregate.Alpha},
	CompactHashCheck:             {Default: false, PreRelease: featuregate.Alpha},
	TxnModeWriteWithSharedBuffer: {Default: true, PreRelease: featuregate.Beta},
	LeaseCheckpoint:              {Default: false, PreRelease: featuregate.Alpha},
	LeaseCheckpointPersist:       {Default: false, PreRelease: featuregate.Alpha},
	SetMemberLocalAddr:           {Default: false, PreRelease: featuregate.Alpha},
	FastLeaseKeepAlive:           {Default: true, PreRelease: featuregate.Beta},
}

func NewDefaultServerFeatureGate(name string, lg *zap.Logger) featuregate.FeatureGate {
	fg := featuregate.New(fmt.Sprintf("%sServerFeatureGate", name), lg)
	if err := fg.Add(DefaultEtcdServerFeatureGates); err != nil {
		panic(err)
	}
	return fg
}