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

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           

@ti-chi-bot ti-chi-bot bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Jan 21, 2025
Copy link

ti-chi-bot bot commented Jan 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Leavrth

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 approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 24, 2025
Copy link

ti-chi-bot bot commented Jan 24, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-24 08:17:24.515715087 +0000 UTC m=+427971.846634488: ☑️ agreed by Leavrth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. needs-1-more-lgtm Indicates a PR needs 1 more 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. 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