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) #58567

Open
wants to merge 1 commit into
base: release-6.5
Choose a base branch
from

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #58465

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 added 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. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Dec 27, 2024
Copy link

ti-chi-bot bot commented Dec 27, 2024

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be approved by the approvers firstly.
  2. AFTER it has been approved by approvers, please wait for the cherry-pick merging approval from triage owners.

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.

Copy link

ti-chi-bot bot commented Dec 27, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jackysp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Please upload report for BASE (release-6.5@e83dbdd). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-6.5     #58567   +/-   ##
================================================
  Coverage               ?   73.6211%           
================================================
  Files                  ?       1097           
  Lines                  ?     353036           
  Branches               ?          0           
================================================
  Hits                   ?     259909           
  Misses                 ?      76404           
  Partials               ?      16723           

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/cherry-pick-not-approved 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. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants