rename LockWithoutHook to LockOutsideApply and add LockInsideApply

This commit is contained in:
ahrtr
2022-04-06 05:07:07 +08:00
parent 47038593e9
commit e155e50886
25 changed files with 106 additions and 71 deletions

View File

@ -405,7 +405,7 @@ func NewServer(cfg config.ServerConfig) (srv *EtcdServer, err error) {
// Set the hook after EtcdServer finishes the initialization to avoid
// the hook being called during the initialization process.
srv.be.SetTxPostLockHook(srv.getTxPostLockHook())
srv.be.SetTxPostLockInsideApplyHook(srv.getTxPostLockHook())
// TODO: move transport initialization near the definition of remote
tr := &rafthttp.Transport{
@ -984,7 +984,7 @@ func (s *EtcdServer) applySnapshot(ep *etcdProgress, apply *apply) {
}
s.consistIndex.SetBackend(newbe)
newbe.SetTxPostLockHook(s.getTxPostLockHook())
newbe.SetTxPostLockInsideApplyHook(s.getTxPostLockHook())
lg.Info("restored mvcc store", zap.Uint64("consistent-index", s.consistIndex.ConsistentIndex()))