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

log(ticdc): output the zap internal errors to stderr #3778

Merged
merged 18 commits into from
Dec 23, 2021

Conversation

zhaoxinyu
Copy link
Contributor

@zhaoxinyu zhaoxinyu commented Dec 8, 2021

What problem does this PR solve?

#3362

What is changed and how it works?

Use a new field ErrorOutputPath in log.Config to output the internal errors of zap (eg. no space left on device). See pingcap/log#24 for more detail.

Previously, the log lib used in cdc outputs the log internal errors to the same log file designated in log.FileLogConfig.Filename. So if the underlying disk is full, those errors are silently discarded, which makes users hard to do troubleshooting.

Check List

Tests

  • Unit test
  • Integration test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 8, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hi-rustin
  • overvenus

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 8, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2021

Codecov Report

Merging #3778 (1178513) into master (3873d39) will decrease coverage by 1.8645%.
The diff coverage is 66.4799%.

Flag Coverage Δ
cdc 58.7083% <66.4799%> (+0.4718%) ⬆️
dm 52.2460% <ø> (-3.7886%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             master      #3778        +/-   ##
================================================
- Coverage   57.0741%   55.2096%   -1.8646%     
================================================
  Files           478        486         +8     
  Lines         56551      60033      +3482     
================================================
+ Hits          32276      33144       +868     
- Misses        20978      23527      +2549     
- Partials       3297       3362        +65     

@overvenus
Copy link
Member

overvenus commented Dec 8, 2021

Does it output all error-level log to "stderr"? If so, I think it's a bit verbose.

@zhaoxinyu
Copy link
Contributor Author

zhaoxinyu commented Dec 9, 2021

Does it output all error-level log to "stderr"? If so, I think it's a bit verbose.

@overvenus No, all messages logged by cdc is written to log file as before. This PR only affects the output of internal errors of zap. For example, the following message will be sent to stderr:

2021-12-09 10:42:49.452647412 +0800 CST m=+0.299023123 write error: write /home/xinyuzhao/tidb-deploy/cdc-9300/log/cdc.log: no space left on device

Reference: https://github.com/uber-go/zap/blob/master/zapcore/entry.go#L222-L225

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 13, 2021
Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Do we have a way to test it, please?

@ti-chi-bot ti-chi-bot removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 13, 2021
@zhaoxinyu
Copy link
Contributor Author

Do we have a way to test it, please?

I will take a look at how zap lib test for this scenario.

@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 18, 2021
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 20, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 21, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 21, 2021
Co-authored-by: Neil Shen <overvenus@gmail.com>
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 21, 2021
@Rustin170506
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 9b45545

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 21, 2021
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Dec 23, 2021
@zhaoxinyu
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@zhaoxinyu: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

In response to this:

/merge

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 ti-community-infra/tichi repository.

@zhaoxinyu
Copy link
Contributor Author

/assign @hi-rustin

@zhaoxinyu
Copy link
Contributor Author

/run-dm-integration-test

@Rustin170506
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 78b170a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 23, 2021
@Rustin170506 Rustin170506 changed the title ticdc/log: output the zap internal errors to stderr log(ticdc): output the zap internal errors to stderr Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants