Skip to content

Commit

Permalink
redo(ticdc): fix redo zero flush interval panic issue (#10102) (#10105)
Browse files Browse the repository at this point in the history
close #10101
  • Loading branch information
ti-chi-bot authored Nov 16, 2023
1 parent c1b5f13 commit 0b7dc20
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cdc/redo/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,18 @@ func (m *logManager) Run(ctx context.Context) error {

func (m *logManager) getFlushDuration() time.Duration {
flushIntervalInMs := m.cfg.FlushIntervalInMs
defaultFlushIntervalInMs := redo.DefaultFlushIntervalInMs
if m.cfg.LogType == redo.RedoDDLLogFileType {
flushIntervalInMs = m.cfg.MetaFlushIntervalInMs
defaultFlushIntervalInMs = redo.DefaultMetaFlushIntervalInMs
}
if flushIntervalInMs < redo.MinFlushIntervalInMs {
log.Warn("redo flush interval is too small, use default value",
zap.Stringer("namespace", m.cfg.ChangeFeedID),
zap.Int("default", defaultFlushIntervalInMs),
zap.String("logType", m.cfg.LogType),
zap.Int64("interval", flushIntervalInMs))
flushIntervalInMs = int64(defaultFlushIntervalInMs)
}
return time.Duration(flushIntervalInMs) * time.Millisecond
}
Expand Down

0 comments on commit 0b7dc20

Please sign in to comment.