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

br: add status field for log status with json #58465

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

Leavrth
Copy link
Contributor

@Leavrth Leavrth commented Dec 23, 2024

What problem does this PR solve?

Issue Number: close #57959

Problem Summary:
log task status is not reported in the json format output

What changed and how does it work?

report log task status in the json format output

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
$ ./br log status --task-name pitr -u 127.0.0.1:2379
● Total 1 Tasks.
> #1 <
              name: pitr
            status: ● NORMAL
             start: 2024-12-23 14:30:34.62 +0800
               end: 2090-11-18 22:07:45.624 +0800
           storage: local:///root/backups/test9/log
       speed(est.): 0.00 ops/s
checkpoint[global]: 2024-12-23 14:30:34.62 +0800; gap=22s

$ ./br log status --task-name pitr -u 127.0.0.1:2379 --json
[{"name":"pitr","start_ts":454802914573025282,"end_ts":999999999999999999,"status":"NORMAL","table_filter":["*.*"],"progress":[],"storage":"local:///root/backups/test9/log","checkpoint":454802914573025282,"estimate_qps":0,"last_errors":[]}]
$ ./br log status --task-name pitr -u 127.0.0.1:2379
● Total 1 Tasks.
> #1 <
              name: pitr
            status: ● PAUSE
             start: 2024-12-23 14:30:34.62 +0800
               end: 2090-11-18 22:07:45.624 +0800
           storage: local:///root/backups/test9/log
       speed(est.): 0.00 ops/s
checkpoint[global]: 2024-12-23 14:33:02.07 +0800; gap=3m10s

$ ./br log status --task-name pitr -u 127.0.0.1:2379 --json
[{"name":"pitr","start_ts":454802914573025282,"end_ts":999999999999999999,"status":"PAUSE","table_filter":["*.*"],"progress":[],"storage":"local:///root/backups/test9/log","checkpoint":454802953226158082,"estimate_qps":0,"last_errors":[]}]
$ ./br log status --task-name pitr -u 127.0.0.1:2379
● Total 1 Tasks.
> #1 <
                    name: pitr
                  status: ○ ERROR
                   start: 2024-12-23 14:30:34.62 +0800
                     end: 2090-11-18 22:07:45.624 +0800
                 storage: local:///root/backups/test9/log
             speed(est.): 0.00 ops/s
      checkpoint[global]: 2024-12-23 14:33:02.07 +0800; gap=14m37s
          error[store=1]: KV:LogBackup:Io
error-happen-at[store=1]: 2024-12-23 14:46:22.055 +0800; gap=1m17s
  error-message[store=1]: I/O Error: No such file or directory (os error 2)
          error[store=2]: KV:LogBackup:Io
error-happen-at[store=2]: 2024-12-23 14:46:22.056 +0800; gap=1m17s
  error-message[store=2]: I/O Error: No such file or directory (os error 2)
          error[store=3]: KV:LogBackup:Io
error-happen-at[store=3]: 2024-12-23 14:46:22.057 +0800; gap=1m17s
  error-message[store=3]: I/O Error: No such file or directory (os error 2)

$ ./br log status --task-name pitr -u 127.0.0.1:2379 --json
[{"name":"pitr","start_ts":454802914573025282,"end_ts":999999999999999999,"status":"ERROR","table_filter":["*.*"],"progress":[],"storage":"local:///root/backups/test9/log","checkpoint":454802953226158082,"estimate_qps":0,"last_errors":[{"store_id":1,"last_error":{"happen_at":1734936382055,"error_code":"KV:LogBackup:Io","error_message":"I/O Error: No such file or directory (os error 2)","store_id":1}},{"store_id":2,"last_error":{"happen_at":1734936382056,"error_code":"KV:LogBackup:Io","error_message":"I/O Error: No such file or directory (os error 2)","store_id":2}},{"store_id":3,"last_error":{"happen_at":1734936382057,"error_code":"KV:LogBackup:Io","error_message":"I/O Error: No such file or directory (os error 2)","store_id":3}}]}]
  • 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 do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Dec 23, 2024
Copy link

tiprow bot commented Dec 23, 2024

Hi @Leavrth. 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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 23, 2024
Copy link

ti-chi-bot bot commented Dec 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, YuJuncen

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:

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 Dec 23, 2024
Copy link

ti-chi-bot bot commented Dec 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-23 06:56:33.101448043 +0000 UTC m=+1458383.190250581: ☑️ agreed by YuJuncen.
  • 2024-12-23 07:01:16.502710282 +0000 UTC m=+1458666.591512862: ☑️ agreed by 3pointer.

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 74.6219%. Comparing base (1fa2955) to head (7f02494).
Report is 29 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58465        +/-   ##
================================================
+ Coverage   73.1670%   74.6219%   +1.4549%     
================================================
  Files          1680       1696        +16     
  Lines        463042     467353      +4311     
================================================
+ Hits         338794     348748      +9954     
+ Misses       103444      97017      -6427     
- Partials      20804      21588       +784     
Flag Coverage Δ
integration 46.3692% <40.0000%> (?)
unit 72.3093% <0.0000%> (+0.0087%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 60.7421% <40.0000%> (+14.7223%) ⬆️

@Leavrth
Copy link
Contributor Author

Leavrth commented Dec 23, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Dec 23, 2024
Copy link

tiprow bot commented Dec 23, 2024

@Leavrth: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 7f02494 link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit ef7ade7 into pingcap:master Dec 23, 2024
15 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

br: log status json report missing status
3 participants