Skip to content

Commit

Permalink
Enable v3 renew only when clusterVersion >= 3.6
Browse files Browse the repository at this point in the history
The v3 renew isn't implemented at all on 3.5, so it can only be
enabled when the cluster version >= 3.6.
  • Loading branch information
ahrtr committed Jun 13, 2022
1 parent 04da84c commit cb249cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/etcdserver/v3_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ func (s *EtcdServer) LeaseRevoke(ctx context.Context, r *pb.LeaseRevokeRequest)
}

func (s *EtcdServer) LeaseRenew(ctx context.Context, r *pb.LeaseKeepAliveRequest) (*pb.LeaseKeepAliveResponse, error) {
if s.Cfg.ExperimentalEnableLeaseV2Renew {
cv := s.ClusterVersion()
// The v3 renew isn't implemented at all on 3.5, so the v3 renew can only
// be used when clusterVersion >= 3.6.
if s.Cfg.ExperimentalEnableLeaseV2Renew || cv == nil || version.LessThan(*cv, version.V3_6) {
resp := &pb.LeaseKeepAliveResponse{ID: r.ID, Header: s.newHeader()}

var err error
Expand Down

0 comments on commit cb249cc

Please sign in to comment.