From f52521a1927b0f125a70d7da4782b32f89e48297 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Wed, 20 Nov 2024 21:02:10 +0800 Subject: [PATCH 1/3] owner: fix unlimited log print "meet lease not found error, refresh session" --- pkg/owner/manager.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/owner/manager.go b/pkg/owner/manager.go index 88aaccbae9a64..d71538f0df0ba 100644 --- a/pkg/owner/manager.go +++ b/pkg/owner/manager.go @@ -404,6 +404,7 @@ func (m *ownerManager) campaignLoop(campaignContext context.Context) { // In this time if we do the campaign operation, the etcd server will return ErrLeaseNotFound. if terror.ErrorEqual(err, rpctypes.ErrLeaseNotFound) { close(leaseNotFoundCh) + err = nil continue } From d7728c9a285756d312b1be8e2a5e016e1492d6cd Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Wed, 20 Nov 2024 21:17:39 +0800 Subject: [PATCH 2/3] change --- pkg/owner/manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/owner/manager.go b/pkg/owner/manager.go index d71538f0df0ba..2c3389b39b449 100644 --- a/pkg/owner/manager.go +++ b/pkg/owner/manager.go @@ -381,6 +381,7 @@ func (m *ownerManager) campaignLoop(campaignContext context.Context) { logutil.Logger(logCtx).Info("break campaign loop, refresh session failed", zap.Error(err2)) return } + err = nil case <-leaseNotFoundCh: logutil.Logger(logCtx).Info("meet lease not found error, refresh session") if err2 := m.refreshSession(util2.NewSessionRetryUnlimited, ManagerSessionTTL); err2 != nil { @@ -388,6 +389,7 @@ func (m *ownerManager) campaignLoop(campaignContext context.Context) { return } leaseNotFoundCh = make(chan struct{}) + err = nil case <-campaignContext.Done(): failpoint.Inject("MockDelOwnerKey", func(v failpoint.Value) { if v.(string) == "delOwnerKeyAndNotOwner" { @@ -404,7 +406,6 @@ func (m *ownerManager) campaignLoop(campaignContext context.Context) { // In this time if we do the campaign operation, the etcd server will return ErrLeaseNotFound. if terror.ErrorEqual(err, rpctypes.ErrLeaseNotFound) { close(leaseNotFoundCh) - err = nil continue } From c84e3426e51f22797af5efd3d253ba645a368dfb Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Wed, 20 Nov 2024 21:23:59 +0800 Subject: [PATCH 3/3] Revert "change" This reverts commit d85334a31e468af3d60b226f44ea9908ed8953af. --- pkg/owner/manager.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/owner/manager.go b/pkg/owner/manager.go index 2c3389b39b449..d71538f0df0ba 100644 --- a/pkg/owner/manager.go +++ b/pkg/owner/manager.go @@ -381,7 +381,6 @@ func (m *ownerManager) campaignLoop(campaignContext context.Context) { logutil.Logger(logCtx).Info("break campaign loop, refresh session failed", zap.Error(err2)) return } - err = nil case <-leaseNotFoundCh: logutil.Logger(logCtx).Info("meet lease not found error, refresh session") if err2 := m.refreshSession(util2.NewSessionRetryUnlimited, ManagerSessionTTL); err2 != nil { @@ -389,7 +388,6 @@ func (m *ownerManager) campaignLoop(campaignContext context.Context) { return } leaseNotFoundCh = make(chan struct{}) - err = nil case <-campaignContext.Done(): failpoint.Inject("MockDelOwnerKey", func(v failpoint.Value) { if v.(string) == "delOwnerKeyAndNotOwner" { @@ -406,6 +404,7 @@ func (m *ownerManager) campaignLoop(campaignContext context.Context) { // In this time if we do the campaign operation, the etcd server will return ErrLeaseNotFound. if terror.ErrorEqual(err, rpctypes.ErrLeaseNotFound) { close(leaseNotFoundCh) + err = nil continue }