-
Notifications
You must be signed in to change notification settings - Fork 188
syncer: add metrics for sharding merge #96
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1574,6 +1574,8 @@ func (s *Syncer) Run(ctx context.Context) (err error) { | |
if err != nil { | ||
return errors.Trace(err) | ||
} | ||
target, _ := GenTableID(ddlInfo.tableNames[1][0].Schema, ddlInfo.tableNames[1][0].Name) | ||
unsyncedTableGauge.WithLabelValues(s.cfg.Name, target).Set(float64(remain)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not put it into L1582 scope? and I'm afraid two many table in this metric There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this scope can be reached only in sharding mode, see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in order to handle There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, and we also have non-shard table in shard mode |
||
log.Infof("[syncer] try to sync table %s to shard group (%v)", source, needShardingHandle) | ||
} | ||
|
||
|
@@ -1628,8 +1630,10 @@ func (s *Syncer) Run(ctx context.Context) (err error) { | |
s.ddlInfoCh <- ddlInfo1 // save DDLInfo, and dm-worker will fetch it | ||
|
||
// block and wait DDL lock to be synced | ||
shardLockResolving.WithLabelValues(s.cfg.Name).Set(1) | ||
var ok bool | ||
ddlExecItem, ok = <-s.ddlExecInfo.Chan(needHandleDDLs) | ||
shardLockResolving.WithLabelValues(s.cfg.Name).Set(0) | ||
if !ok { | ||
// chan closed | ||
log.Info("[syncer] cancel to add DDL to job because of canceled from external") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shard or sharding?