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

Duplicate attributes in BR json log for pitr #53645

Closed
dveeden opened this issue May 29, 2024 · 0 comments · Fixed by #53649
Closed

Duplicate attributes in BR json log for pitr #53645

dveeden opened this issue May 29, 2024 · 0 comments · Fixed by #53649
Labels
component/br This issue is related to BR of TiDB. severity/minor type/bug The issue is confirmed as a bug.

Comments

@dveeden
Copy link
Contributor

dveeden commented May 29, 2024

Bug Report

The "restore log success summary" looks like this in the output of br:

[2024/05/29 08:40:10.537 +02:00] [INFO] [collector.go:77] ["restore log success summary"] [total-take=3.607614879s] [restore-from=450091587356590086] [restore-to=450091627315200000] [restore-from="2024-05-29 08:12:27.57 +0200"] [restore-to="2024-05-29 08:15:00 +0200"] [total-kv-count=2] [skipped-kv-count-by-checkpoint=0] [total-size=191B] [skipped-size-by-checkpoint=0B] [average-speed=52.94B/s]

And when using --log-format json this looks like this:

{"level":"INFO","time":"2024/05/29 08:43:01.784 +02:00","caller":"collector.go:78","message":"restore log success summary","total-take":"3.595453335s","restore-from":450091587356590086,"restore-to":450091627315200000,"restore-from":"2024-05-29 08:12:27.57 +0200","restore-to":"2024-05-29 08:15:00 +0200","total-kv-count":2,"skipped-kv-count-by-checkpoint":0,"total-size":"191B","skipped-size-by-checkpoint":"0B","average-speed":"53.12B/s"}

When using jq to do display/filtering/etc it looks like this:

{
  "level": "INFO",
  "time": "2024/05/29 08:43:01.784 +02:00",
  "caller": "collector.go:78",
  "message": "restore log success summary",
  "total-take": "3.595453335s",
  "restore-from": "2024-05-29 08:12:27.57 +0200",
  "restore-to": "2024-05-29 08:15:00 +0200",
  "total-kv-count": 2,
  "skipped-kv-count-by-checkpoint": 0,
  "total-size": "191B",
  "skipped-size-by-checkpoint": "0B",
  "average-speed": "53.12B/s"
}

The problem here is that there are duplicate keys in this output for restore-to and restore-from. Once with the TS and once with the human readable timestamp.

Suggestion:
Rename one of these for each group to avoid duplicate attributes.

@dveeden dveeden added type/bug The issue is confirmed as a bug. component/br This issue is related to BR of TiDB. labels May 29, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 35e09a2 May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant