Skip to content
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

panic: keep lease panic #7562

Closed
bufferflies opened this issue Dec 18, 2023 · 1 comment · Fixed by #7566
Closed

panic: keep lease panic #7562

bufferflies opened this issue Dec 18, 2023 · 1 comment · Fixed by #7566
Assignees
Labels
severity/critical type/bug The issue is confirmed as a bug.

Comments

@bufferflies
Copy link
Contributor

bufferflies commented Dec 18, 2023

Bug Report

CampaignLeader maybe pass if the retry time has reached campaignLeaderFrequencyTimes, but the lease maybe not success ,so the lease time is zero .

pd/server/server.go

Lines 1645 to 1655 in cf718a7

if err := s.member.CampaignLeader(s.ctx, s.cfg.LeaderLease); err != nil {
if err.Error() == errs.ErrEtcdTxnConflict.Error() {
log.Info(fmt.Sprintf("campaign %s leader meets error due to txn conflict, another PD/API server may campaign successfully", s.mode),
zap.String("campaign-leader-name", s.Name()))
} else {
log.Error(fmt.Sprintf("campaign %s leader meets error due to etcd error", s.mode),
zap.String("campaign-leader-name", s.Name()),
errs.ZapError(err))
}
return
}

What did you do?

What did you expect to see?

normal

What did you see instead?

"[log.go:87] [panic] [recover=\"\\\"non-positive interval for NewTicker\\\"\"] [stack=\"[github.com/tikv/pd/pkg/utils/logutil.LogPanic\\n\\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/pd/pkg/utils/logutil/log.go:87\\nruntime.gopanic\\n\\t/usr/local/go/src/runtime/panic.go:914\\ntime.NewTicker\\n\\t/usr/local/go/src/time/tick.go:22\\ngithub.com/tikv/pd/pkg/election.(*lease).keepAliveWorker.func1\\n\\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/pd/pkg/election/lease.go:152](http://github.com/tikv/pd/pkg/utils/logutil.LogPanic//n//t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/pd/pkg/utils/logutil/log.go:87//nruntime.gopanic//n//t/usr/local/go/src/runtime/panic.go:914//ntime.NewTicker//n//t/usr/local/go/src/time/tick.go:22//ngithub.com/tikv/pd/pkg/election.(*lease).keepAliveWorker.func1//n//t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/pd/pkg/election/lease.go:152)\"]"

What version of PD are you using (pd-server -V)?

8196d84

@CabinfeverB
Copy link
Member

ti-chi-bot bot added a commit that referenced this issue Dec 20, 2023
close #7562

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/critical type/bug The issue is confirmed as a bug.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants