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

search logs: update sysutil to support search logs include invalid lines #18579

Merged

Conversation

baurine
Copy link
Contributor

@baurine baurine commented Jul 15, 2020

Signed-off-by: baurine 2008.hbl@gmail.com

What problem does this PR solve?

Related issues and PRs:

Problem Summary:

  • If the log files include invalid lines in the beginning or end, it will be skipped.
  • If the log files include invalid lines in the middle, the lines will be ignored.

What is changed and how it works?

What's Changed:

  • Check at most 10 lines in the beginning or end to find the first valid line
  • Treat the invalid line in the middle as a normal log with pre valid log time and level

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Release note

  • Support search the log file even it includes some invalid lines

@CLAassistant
Copy link

CLAassistant commented Jul 15, 2020

CLA assistant check
All committers have signed the CLA.

@baurine
Copy link
Contributor Author

baurine commented Jul 15, 2020

@breeswish @crazycs520 PTAL, thanks!

@baurine baurine marked this pull request as draft July 15, 2020 07:56
@baurine baurine marked this pull request as ready for review July 15, 2020 09:30
@breezewish
Copy link
Member

/run-unit-test

breezewish
breezewish previously approved these changes Jul 15, 2020
Copy link
Member

@breezewish breezewish left a comment

Choose a reason for hiding this comment

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

Maybe you need to run go mod tidy. The rest LGTM, thanks!

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 15, 2020
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #18579 into master will decrease coverage by 0.0034%.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             master     #18579        +/-   ##
================================================
- Coverage   79.4761%   79.4727%   -0.0035%     
================================================
  Files           540        540                
  Lines        145655     145572        -83     
================================================
- Hits         115761     115690        -71     
+ Misses        20561      20558         -3     
+ Partials       9333       9324         -9     

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 15, 2020
@crazycs520
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 15, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@baurine merge failed.

@crazycs520
Copy link
Contributor

/run-check_dev_2

@crazycs520 crazycs520 merged commit b72e47e into pingcap:master Jul 15, 2020
@baurine baurine deleted the support-search-logs-include-invalid-lines branch July 15, 2020 13:23
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jul 15, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #18610

jebter added a commit that referenced this pull request Aug 6, 2020
…nes (#18579) (#18610)

* cherry pick #18579 to release-4.0

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

* resolve conflicts

Signed-off-by: baurine <2008.hbl@gmail.com>

Co-authored-by: Sparkle <1284531+baurine@users.noreply.github.com>
Co-authored-by: baurine <2008.hbl@gmail.com>
Co-authored-by: crazycs <crazycs520@gmail.com>
Co-authored-by: jebter <jebter@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants