Skip to content

Commit e33ff6c

Browse files
authored
cdc(logging): remove some verbose and useless logs (pingcap#12604)
close pingcap#11948
1 parent 7e0d4db commit e33ff6c

File tree

13 files changed

+12
-64
lines changed

13 files changed

+12
-64
lines changed

cdc/capture/capture.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (c *captureImpl) reset(ctx context.Context) (*vars.GlobalVars, error) {
224224
if err != nil {
225225
return nil, errors.Trace(err)
226226
}
227-
log.Info("reset session successfully", zap.Any("session", sess))
227+
log.Info("reset session successfully", zap.Int64("leaseID", int64(lease.ID)))
228228

229229
c.captureMu.Lock()
230230
defer c.captureMu.Unlock()
@@ -291,7 +291,11 @@ func (c *captureImpl) reset(ctx context.Context) (*vars.GlobalVars, error) {
291291
c.processorManager = c.newProcessorManager(
292292
c.info, c.upstreamManager, &c.liveness, c.config.Debug.Scheduler, globalVars)
293293

294-
log.Info("capture initialized", zap.Any("capture", c.info))
294+
log.Info("capture initialized",
295+
zap.String("captureID", c.info.ID),
296+
zap.String("advertiseAddr", c.info.AdvertiseAddr),
297+
zap.String("version", c.info.Version),
298+
zap.String("gitHash", c.info.GitHash))
295299
return globalVars, nil
296300
}
297301

cdc/kv/shared_client.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,18 +824,14 @@ func (s *SharedClient) handleResolveLockTasks(ctx context.Context) error {
824824
}
825825

826826
func (s *SharedClient) logSlowRegions(ctx context.Context) error {
827-
ticker := time.NewTicker(30 * time.Second)
827+
ticker := time.NewTicker(5 * time.Minute)
828828
defer ticker.Stop()
829829
for {
830830
select {
831831
case <-ctx.Done():
832832
return ctx.Err()
833833
case <-ticker.C:
834834
}
835-
log.Info("event feed starts to check locked regions",
836-
zap.String("namespace", s.changefeed.Namespace),
837-
zap.String("changefeed", s.changefeed.ID))
838-
839835
currTime := s.pdClock.CurrentTime()
840836
s.totalSpans.RLock()
841837
var slowInitializeRegionCount int

cdc/model/changefeed.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ func (info *ChangeFeedInfo) NeedBlockGC() bool {
218218

219219
func (info *ChangeFeedInfo) isFailedByGC() bool {
220220
if info.Error == nil {
221-
log.Panic("changefeed info is not consistent",
222-
zap.Any("state", info.State), zap.Any("error", info.Error))
221+
log.Panic("changefeed info is not consistent", zap.Any("state", info.State))
223222
}
224223
return cerror.IsChangefeedGCFastFailErrorCode(errors.RFCErrorCode(info.Error.Code))
225224
}
@@ -381,9 +380,6 @@ func (info *ChangeFeedInfo) RmUnusedFields() {
381380
}
382381

383382
func (info *ChangeFeedInfo) rmMQOnlyFields() {
384-
log.Info("since the downstream is not a MQ, remove MQ only fields",
385-
zap.String("namespace", info.Namespace),
386-
zap.String("changefeed", info.ID))
387383
info.Config.Sink.DispatchRules = nil
388384
info.Config.Sink.SchemaRegistry = nil
389385
info.Config.Sink.EncoderConcurrency = nil

cdc/model/sink.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ func trySplitAndSortUpdateEvent(
11931193
split := false
11941194
for _, e := range events {
11951195
if e == nil {
1196-
log.Warn("skip emit nil event", zap.Any("event", e))
1196+
log.Warn("skip emit nil event")
11971197
continue
11981198
}
11991199

cdc/scheduler/internal/v3/transport/transport.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,6 @@ func (t *p2pTransport) Send(
159159
return errors.Trace(err)
160160
}
161161
}
162-
163-
if len(msgs) != 0 {
164-
log.Debug("schedulerv3: all messages sent",
165-
zap.String("namespace", t.changefeed.Namespace),
166-
zap.String("changefeed", t.changefeed.ID),
167-
zap.Int("len", len(msgs)))
168-
}
169162
return nil
170163
}
171164

cdc/sink/dmlsink/cloudstorage/encoding_worker.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ import (
1717
"sync/atomic"
1818

1919
"github.com/pingcap/errors"
20-
"github.com/pingcap/log"
2120
"github.com/pingcap/tiflow/cdc/model"
2221
"github.com/pingcap/tiflow/pkg/sink/codec"
23-
"go.uber.org/zap"
2422
"golang.org/x/sync/errgroup"
2523
)
2624

@@ -52,10 +50,6 @@ func newEncodingWorker(
5250
}
5351

5452
func (w *encodingWorker) run(ctx context.Context) error {
55-
log.Debug("encoding worker started", zap.Int("workerID", w.id),
56-
zap.String("namespace", w.changeFeedID.Namespace),
57-
zap.String("changefeed", w.changeFeedID.ID))
58-
5953
eg, ctx := errgroup.WithContext(ctx)
6054
eg.Go(func() error {
6155
for {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ require (
439439
sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67 // indirect
440440
)
441441

442-
replace github.com/IBM/sarama v1.41.2 => github.com/pingcap/sarama v1.41.2-pingcap-20250415
442+
replace github.com/IBM/sarama v1.41.2 => github.com/pingcap/sarama v1.41.2-pingcap-20251202-x
443443

444444
// Fix https://github.com/pingcap/tiflow/issues/4961
445445
replace github.com/benbjohnson/clock v1.3.5 => github.com/benbjohnson/clock v1.1.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,8 @@ github.com/pingcap/log v1.1.1-0.20250917021125-19901e015dc9 h1:qG9BSvlWFEE5otQGa
888888
github.com/pingcap/log v1.1.1-0.20250917021125-19901e015dc9/go.mod h1:ORfBOFp1eteu2odzsyaxI+b8TzJwgjwyQcGhI+9SfEA=
889889
github.com/pingcap/metering_sdk v0.0.0-20251110022152-dac449ac5389 h1:bqbE3bwFSrUDSiN5M4EG+IXmm5eWLJnGRy/caXnxuHA=
890890
github.com/pingcap/metering_sdk v0.0.0-20251110022152-dac449ac5389/go.mod h1:zie1N5PRttgtqkZmRtpIDM7CuyWtvlX9LTxRd3fVSc4=
891-
github.com/pingcap/sarama v1.41.2-pingcap-20250415 h1:jc/31lgAuSWLh8zr3y5bL0atpBFHAjch5H1Nnlb04J0=
892-
github.com/pingcap/sarama v1.41.2-pingcap-20250415/go.mod h1:Kwi9CT6CuDYad3KS7HqjsbmD2DWkIKI7qI6a8PKlGb4=
891+
github.com/pingcap/sarama v1.41.2-pingcap-20251202-x h1:9Vi3qqyDNZxG6fnXQhpeTsnwzSBWNpMeb8o02JkL9JM=
892+
github.com/pingcap/sarama v1.41.2-pingcap-20251202-x/go.mod h1:xdpu7sd6OE1uxNdjYTSKUfY8FaKkJES9/+EyjSgiGQk=
893893
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5 h1:T4pXRhBflzDeAhmOQHNPRRogMYxP13V7BkYw3ZsoSfE=
894894
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5/go.mod h1:rlimy0GcTvjiJqvD5mXTRr8O2eNZPBrcUgiWVYp9530=
895895
github.com/pingcap/tidb v1.1.0-beta.0.20260325043212-0c4df2e19ecc h1:2Ateg1PUQqozi+TtbL+Bx62qn4IpQ48VTOpqCh2d3AI=

pkg/config/sink.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ func (s *SinkConfig) ShouldSendAllBootstrapAtStart() bool {
238238
return false
239239
}
240240
should := s.ShouldSendBootstrapMsg() && util.GetOrZero(s.SendAllBootstrapAtStart)
241-
log.Info("should send all bootstrap at start", zap.Bool("should", should))
242241
return should
243242
}
244243

@@ -845,10 +844,6 @@ func (s *SinkConfig) validateAndAdjustSinkURI(sinkURI *url.URL) error {
845844
return err
846845
}
847846

848-
log.Info("succeed to parse parameter from sink uri",
849-
zap.String("protocol", util.GetOrZero(s.Protocol)),
850-
zap.String("txnAtomicity", string(util.GetOrZero(s.TxnAtomicity))))
851-
852847
// Check that protocol config is compatible with the scheme.
853848
if sink.IsMySQLCompatibleScheme(sinkURI.Scheme) && s.Protocol != nil {
854849
return cerror.ErrSinkURIInvalid.GenWithStackByArgs(fmt.Sprintf("protocol %s "+

pkg/migrate/migrate.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,7 @@ func (m *migrator) migrate(ctx context.Context, etcdNoMetaVersion bool, oldVersi
279279
log.Error("update meta version failed, etcd meta data migration failed", zap.Error(err))
280280
return cerror.WrapError(cerror.ErrEtcdMigrateFailed, err)
281281
}
282-
log.Info("etcd data migration successful")
283282
cleanOldData(ctx, m.cli.GetEtcdClient())
284-
log.Info("clean old etcd data successful")
285283
return nil
286284
}
287285

0 commit comments

Comments
 (0)