Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdc, pkg: replace table ID with table name in metrics #695

Merged
merged 5 commits into from Jun 29, 2020

Conversation

overvenus
Copy link
Member

What problem does this PR solve?

Replace table ID with table name in metrics.

Cc #677

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has persistent data change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch

Release note

  • No release note

Signed-off-by: Neil Shen <overvenus@gmail.com>
@overvenus
Copy link
Member Author

/run-integration-tests

Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
@overvenus
Copy link
Member Author

/run-integration-tests

@codecov-commenter
Copy link

codecov-commenter commented Jun 28, 2020

Codecov Report

Merging #695 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master       #695   +/-   ##
===========================================
  Coverage   32.2594%   32.2594%           
===========================================
  Files            90         90           
  Lines          9653       9653           
===========================================
  Hits           3114       3114           
  Misses         6285       6285           
  Partials        254        254           

cdc/processor.go Outdated
@@ -163,7 +163,7 @@ func newProcessor(
// so we set `needEncode` to false.
log.Info("start processor with startts", zap.Uint64("startts", checkpointTs))
ddlPuller := puller.NewPuller(pdCli, kvStorage, checkpointTs, []regionspan.Span{regionspan.GetDDLSpan(), regionspan.GetAddIndexDDLSpan()}, false, limitter)
ctx = util.PutTableIDInCtx(ctx, 0)
ctx = util.PutTableInfoInCtx(ctx, 0, "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed now

cdc/processor.go Outdated
@@ -214,7 +214,7 @@ func newProcessor(
func (p *processor) Run(ctx context.Context) {
wg, cctx := errgroup.WithContext(ctx)
p.wg = wg
ddlPullerCtx, ddlPullerCancel := context.WithCancel(util.PutTableIDInCtx(cctx, 0))
ddlPullerCtx, ddlPullerCancel := context.WithCancel(util.PutTableInfoInCtx(cctx, 0, ""))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about assigning a mock table name, such as ticdc-processor-ddl, ditto for the context used in the onwer's ddl puller.

for tableID, op := range operation {
var orphanMarkTableID model.TableID
tableName, found := schemaSnapshot.GetTableNameByID(tableID)
if !found {
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to add a warning log here

Signed-off-by: Neil Shen <overvenus@gmail.com>
@overvenus
Copy link
Member Author

/run-integration-tests

1 similar comment
@overvenus
Copy link
Member Author

/run-integration-tests

Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amyangfei amyangfei added the LGT1 label Jun 29, 2020
Copy link
Contributor

@zier-one zier-one left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zier-one zier-one added LGT2 and removed LGT1 labels Jun 29, 2020
@zier-one
Copy link
Contributor

/run-integration-tests

@overvenus overvenus merged commit 8276511 into pingcap:master Jun 29, 2020
@overvenus overvenus deleted the metrics branch June 29, 2020 09:47
@overvenus
Copy link
Member Author

Base on prometheus spec, label name must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*. We need to sanitize table names.

5kbpers pushed a commit to 5kbpers/ticdc that referenced this pull request Aug 24, 2020
* cdc, pkg: replace table ID with table name in metrics
* cherry-pick pingcap#692 bugfix

Signed-off-by: Neil Shen <overvenus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants