lease: grant consistent lease IDs
When raft broadcasts a Grant to all nodes, all nodes must agree on the same lease ID. Otherwise, attaching a key to a lease will fail since the lease ID is node-dependent.
This commit is contained in:
@ -361,7 +361,7 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
|
||||
|
||||
if cfg.V3demo {
|
||||
srv.be = backend.NewDefaultBackend(path.Join(cfg.SnapDir(), databaseFilename))
|
||||
srv.lessor = lease.NewLessor(uint8(id), srv.be)
|
||||
srv.lessor = lease.NewLessor(srv.be)
|
||||
srv.kv = dstorage.New(srv.be, srv.lessor, &srv.consistIndex)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user