-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init peer #138
init peer #138
Conversation
tikv/raftstore/peer.go
Outdated
readyCnt int | ||
} | ||
|
||
func NewReadIndexQueue() *ReadIndexQueue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this function, &ReadIndexQueue{}
or new(ReadIndexQueue)
will do.
tikv/raftstore/peer.go
Outdated
queue []*ProposalMeta | ||
} | ||
|
||
func newProposalQueue() *ProposalQueue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can be removed too.
tikv/raftstore/peer.go
Outdated
} | ||
} | ||
|
||
func (q *ProposalQueue) Pop(term uint64) *ProposalMeta { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Pop/PopFront
tikv/raftstore/peer.go
Outdated
WrittenKeys uint64 | ||
} | ||
|
||
func NewPeerStat() *PeerStat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
tikv/raftstore/peer.go
Outdated
PendingMergeApplyResult *WaitApplyResultStat | ||
PeerStat *PeerStat | ||
|
||
applyRouter router |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is not present in TikV.
tikv/raftstore/peer.go
Outdated
} | ||
|
||
type Peer struct { | ||
Cfg *Config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TiKV doesn't have this field.
tikv/raftstore/peer.go
Outdated
Applied: appliedIndex, | ||
CheckQuorum: true, | ||
PreVote: cfg.Prevote, | ||
Storage: ps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing skip_bcast_commit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add it later, not this pr.
tikv/raftstore/peer.go
Outdated
PeerHeartbeats: make(map[uint64]time.Time), | ||
PeersStartPendingTime: make(map[uint64]time.Time), | ||
RecentAddedPeer: NewRecentAddedPeer(uint64(cfg.RaftRejectTransferLeaderDuration.Seconds())), | ||
SizeDiffHint: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove those zero value fields.
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
Signed-off-by: zhangjinpeng1987 <zhangjinpeng@pingcap.com>
LGTM |
Signed-off-by: zhangjinpeng1987 zhangjinpeng@pingcap.com