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

ticdc/log: suppress duplicated log to avoid flooding #3641

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zhaoxinyu
Copy link
Contributor

@zhaoxinyu zhaoxinyu commented Nov 26, 2021

What problem does this PR solve?

#3524 and #4006

What is changed and how it works?

Add log sampling config items into cdc server config. We use zap.SamplingConfig to efficiently determine whether to drop or write a log.
For example, we set the configs as follows:

server_configs:
  cdc:
    log.sampling.initial: 100
    log.sampling.thereafter: 100

And if the server wants to write 200 same messages into log, only 101 messages (indexed by [0~99, 199]) could be written to log, the remaining 99 messages are supposed to be dropped.

Check List

Tests

  • Unit test
  • Integration test

Release note

None

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 26, 2021
@liuzix
Copy link
Contributor

liuzix commented Nov 26, 2021

Can this sampling be scoped? I.e., can it only filter logs from some packages, but not others? Using sampling on some mission critical modules might cause difficulty debugging.

@zhaoxinyu
Copy link
Contributor Author

zhaoxinyu commented Nov 29, 2021

Can this sampling be scoped? I.e., can it only filter logs from some packages, but not others? Using sampling on some mission critical modules might cause difficulty debugging.

@liuzix No, at present, zap only supports global sampling configuration, it cannot filter logs based on package name.

@ben1009
Copy link
Contributor

ben1009 commented Nov 29, 2021

Can this sampling be scoped? I.e., can it only filter logs from some packages, but not others? Using sampling on some mission critical modules might cause difficulty debugging.

+1, btw

[2021-11-26T12:27:32.822Z] --- FAIL: TestServerConfigMarshal (0.01s)

[2021-11-26T12:27:32.822Z]     server_config_test.go:32: 

[2021-11-26T12:27:32.822Z]         	Error Trace:	server_config_test.go:32

[2021-11-26T12:27:32.822Z]         	Error:      	Not equal: ```

@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2021

Codecov Report

Merging #3641 (8796269) into master (24030f8) will increase coverage by 1.5517%.
Report is 2809 commits behind head on master.
The diff coverage is 53.3333%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master      #3641        +/-   ##
================================================
+ Coverage   56.5356%   58.0874%   +1.5517%     
================================================
  Files           211        241        +30     
  Lines         22798      24501      +1703     
================================================
+ Hits          12889      14232      +1343     
- Misses         8598       8845       +247     
- Partials       1311       1424       +113     

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 25, 2021
@ti-chi-bot
Copy link
Member

@zhaoxinyu: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

@zhaoxinyu Do you have time to advance it?

@pingcap pingcap deleted a comment from hi-rustin Apr 15, 2022
@zhaoxinyu
Copy link
Contributor Author

@zhaoxinyu Do you have time to advance it?

This PR is preempted by other high-priority things. I will keep advancing it after completing things in this sprint.

@zhaoxinyu
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants