Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
Signed-off-by: Haizhi Geng <[email protected]>
  • Loading branch information
JmPotato committed Aug 17, 2020
1 parent 03667b2 commit e81abf1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions server/tso/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const (

// TimestampOracle is used to maintain the logic of tso.
type TimestampOracle struct {
// leadership is used to check the current PD server's leadership
// to determine whether a tso request could be processed and
// it's stored as *election.Leadership
leadership atomic.Value
// For tso, set after pd becomes leader.
ts unsafe.Pointer
Expand Down
3 changes: 2 additions & 1 deletion tests/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ func (s *TestServer) BootstrapCluster() error {
return nil
}

// WaitLeadership is used to get leader lease.
// WaitLeadership is used to get instant leadership in order to
// make a test know the PD leader has been elected as soon as possible.
// If it exceeds the maximum number of loops, it will return nil.
func (s *TestServer) WaitLeadership() bool {
for i := 0; i < 100; i++ {
Expand Down

0 comments on commit e81abf1

Please sign in to comment.