Skip to content

Commit

Permalink
log span
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Shen <overvenus@gmail.com>
  • Loading branch information
overvenus committed Mar 16, 2023
1 parent 2037c85 commit 93f3626
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cdc/scheduler/internal/v3/keyspan/splitter_region_count.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ func (m *regionCountSplitter) split(
log.Warn("schedulerv3: list regions failed, skip split span",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Error(err))
return []tablepb.Span{span}
}
if len(regions) <= config.RegionThreshold || totalCaptures == 0 {
log.Info("schedulerv3: skip split span by region count",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Int("totalCaptures", totalCaptures),
zap.Int("regionCount", len(regions)),
zap.Int("regionThreshold", config.RegionThreshold))
Expand All @@ -76,6 +78,7 @@ func (m *regionCountSplitter) split(
log.Warn("schedulerv3: get regions failed, skip split span",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Error(err))
return []tablepb.Span{span}
}
Expand All @@ -84,6 +87,7 @@ func (m *regionCountSplitter) split(
log.Warn("schedulerv3: get regions failed, skip split span",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Error(err))
return []tablepb.Span{span}
}
Expand All @@ -92,6 +96,7 @@ func (m *regionCountSplitter) split(
log.Warn("schedulerv3: list region out of order detected",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Stringer("lastSpan", &spans[len(spans)-1]),
zap.Stringer("region", startRegion))
return []tablepb.Span{span}
Expand Down Expand Up @@ -119,6 +124,7 @@ func (m *regionCountSplitter) split(
log.Info("schedulerv3: split span by region count",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Int("spans", len(spans)),
zap.Int("totalCaptures", totalCaptures),
zap.Int("regionCount", len(regions)),
Expand Down
3 changes: 3 additions & 0 deletions cdc/scheduler/internal/v3/keyspan/splitter_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,23 @@ func (m *writeSplitter) split(
log.Warn("schedulerv3: scan regions failed, skip split span",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Error(err))
return nil
}
if totalCaptures <= 1 {
log.Warn("schedulerv3: only one capture, skip split span",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Error(err))
return []tablepb.Span{span}
}
info := splitRegionsByWrittenKeys(span.TableID, regions, config.WriteKeyThreshold, totalCaptures)
log.Info("schedulerv3: split span by written keys",
zap.String("namespace", m.changefeedID.Namespace),
zap.String("changefeed", m.changefeedID.ID),
zap.String("span", span.String()),
zap.Ints("counts", info.Counts),
zap.Ints("weights", info.Weights),
zap.Int("spans", len(info.Spans)),
Expand Down

0 comments on commit 93f3626

Please sign in to comment.