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

cmd: add new subcommand for redacting logs #51759

Merged
merged 5 commits into from
Mar 14, 2024
Merged

Conversation

xhebox
Copy link
Contributor

@xhebox xhebox commented Mar 14, 2024

What problem does this PR solve?

Issue Number: close #51758

Problem Summary: add DeRedactXXX. add tidb-server ... collect-logs <input> <output>

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
[xhe@tb14p tidb]$ ./bin/tidb-server --redact collect-logs  c
‹, 3, <nil>, 4096, 10
f, 1, <nil>, 4096, 9
x, 1, <nil>, 4096, 8
c, 1, <nil>, 4096, 7
v, 1, <nil>, 4096, 6
›, 3, <nil>, 4096, 3
g, 1, <nil>, 4096, 2
g, 1, <nil>, 4096, 1
g, 1, <nil>, 4096, 0
?gggggggggggg
?gggggggggggg?gggggggggggg
[xhe@tb14p tidb]$ ./bin/tidb-server  collect-logs  c
‹, 3, <nil>, 4096, 10
f, 1, <nil>, 4096, 9
x, 1, <nil>, 4096, 8
c, 1, <nil>, 4096, 7
v, 1, <nil>, 4096, 6
›, 3, <nil>, 4096, 3
g, 1, <nil>, 4096, 2
g, 1, <nil>, 4096, 1
g, 1, <nil>, 4096, 0
fxcvgggggggggggg
fxcvggggggggggggfxcvgggggggggggg
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot 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 Mar 14, 2024
Copy link

tiprow bot commented Mar 14, 2024

Hi @xhebox. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

@xhebox
Copy link
Contributor Author

xhebox commented Mar 14, 2024

/ok-to-test

if output == "-" {
ofile = os.Stdout
} else {
file, err := os.OpenFile(output, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0644)
Copy link
Contributor

Choose a reason for hiding this comment

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

Better consider about compressed files. Because tidb log will support it after #51249

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider it later

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 14, 2024
xhebox added 3 commits March 14, 2024 12:02
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Merging #51759 (2190d63) into master (1f58dd5) will increase coverage by 2.0663%.
Report is 3 commits behind head on master.
The diff coverage is 55.5555%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51759        +/-   ##
================================================
+ Coverage   70.7164%   72.7827%   +2.0663%     
================================================
  Files          1475       1475                
  Lines        437313     437435       +122     
================================================
+ Hits         309252     318377      +9125     
+ Misses       108693      99031      -9662     
- Partials      19368      20027       +659     
Flag Coverage Δ
integration 48.6186% <0.0000%> (?)
unit 70.4942% <55.5555%> (-0.0333%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.4391% <ø> (+5.5152%) ⬆️

Copy link

ti-chi-bot bot commented Mar 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, hawkingrei

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Defined2014,hawkingrei]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 14, 2024
Copy link

ti-chi-bot bot commented Mar 14, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-14 03:57:35.421084092 +0000 UTC m=+917082.443330491: ☑️ agreed by Defined2014.
  • 2024-03-14 04:58:35.801644223 +0000 UTC m=+920742.823890611: ☑️ agreed by hawkingrei.

@ti-chi-bot ti-chi-bot bot merged commit d6de964 into pingcap:master Mar 14, 2024
23 checks passed
@xhebox xhebox deleted the log_7 branch April 7, 2024 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm 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.

a sub command for handling marker logs
3 participants