*: ensure grant/revoke won't be applied repeatedly after restarting etcd

This commit is contained in:
tangcong
2020-05-22 12:15:14 +08:00
parent a4ada8cb1f
commit e9ae8eb5a1
6 changed files with 41 additions and 28 deletions

View File

@@ -523,7 +523,9 @@ func NewServer(cfg ServerConfig) (srv *EtcdServer, err error) {
MinLeaseTTL: int64(math.Ceil(minTTL.Seconds())),
CheckpointInterval: cfg.LeaseCheckpointInterval,
ExpiredLeasesRetryInterval: srv.Cfg.ReqTimeout(),
})
},
srv.consistIndex,
)
tp, err := auth.NewTokenProvider(cfg.Logger, cfg.AuthToken,
func(index uint64) <-chan struct{} {