Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

err_msg: clarify some ambiguous error message (#1076) #1132

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #1076

What problem does this PR solve?

Keeping improve BR errors and logs #1055

Some error message in BR is ambiguous and misleading.
i.e.

  • If tikv has no permission to read from & write to backup storage, error message cannot clarify whether error occur on br side or tikv side. Users may think why I got "permission denied"? I'm running BR as root!
  • If user want to restore tables or databases that have not been backup, error should occur.

Clarify the summary info including:

  • data-size => total kv size
  • size => backup data size(after compressed)

What is changed and how it works?

  1. Adjust the backup and restore summary:
  • the data-size field has been changed to total-kv-size
  • the size field in backup summary has been changed to backup data size(after compressed)
  • the size field in restore summary has been changed to restore data size(after decompressed)
  1. Some error messages are changed, and will clarify what is going on when error occur.
  • Original error message is as following
[2021/05/18 16:37:28.517 +08:00] [ERROR] [push.go:147] ["backup occur unknown error"] [error="Io(Os { code: 13, kind: PermissionDenied...})"] [stack="github.com/pingcap/br/pkg/backup.(*pushDown).pushBackup\n\t/home/zwj/log_improve/br/pkg/backup/push.go:147\ngithub.jparrowsec.cn/pingcap/br/pkg/backup.(*Client).BackupRange\n\t/home/zwj/log_improve/br/pkg/backup/client.go:540\ngithub.jparrowsec.cn/pingcap/br/pkg/backup.(*Client).BackupRanges.func2.1\n\t/home/zwj/log_improve/br/pkg/backup/client.go:476\ngithub.jparrowsec.cn/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1\n\t/home/zwj/log_improve/br/pkg/utils/worker.go:63\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/root/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57"]
  • For now, the error message output is as following:
[2021/05/19 15:43:43.305 +08:00] [ERROR] [push.go:175] [error="[BR:KV:ErrKVStorage]tikv storage occur I/O error: I/O permission denied error occurs on TiKV Node(store id: 1; Address: 127.0.0.1:20162)"] ["work around"="please ensure tikv has permission to read from & write to the storage."] [stack="github.com/pingcap/br/pkg/backup.(*pushDown).pushBackup\n\t/home/zwj/log_improve/br/pkg/backup/push.go:175\ngithub.jparrowsec.cn/pingcap/br/pkg/backup.(*Client).BackupRange\n\t/home/zwj/log_improve/br/pkg/backup/client.go:540\ngithub.jparrowsec.cn/pingcap/br/pkg/backup.(*Client).BackupRanges.func2.1\n\t/home/zwj/log_improve/br/pkg/backup/client.go:476\ngithub.jparrowsec.cn/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1\n\t/home/zwj/log_improve/br/pkg/utils/worker.go:63\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/root/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57"]
  1. When user want to restore tables or databases that have not been backup, error should occur.

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  1. If user want to restore a table or database that has not been backup, an error should occur to notice the user
    image
    image
  2. If user restore a empty table, the summary should notice the user there is nothing to restore.
    image
  3. Summary message have improve, data-size => total-kv-size and size => backup data size(after compressed)
    image
  • Integration test

Code changes

  • Has exported variable/fields change

Release Note

  • No realease note

@ti-chi-bot ti-chi-bot force-pushed the cherry-pick-1076-to-release-5.0 branch from 45badad to 7460321 Compare May 21, 2021 02:10
@ZipFast ZipFast self-assigned this May 21, 2021
@@ -203,7 +234,17 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf
if err != nil {
return errors.Trace(err)
}
<<<<<<< HEAD
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is a conflict.

@ZipFast
Copy link
Contributor

ZipFast commented May 21, 2021

/run-all-tests

@YuJuncen
Copy link
Collaborator

/lgtm

@3pointer
Copy link
Collaborator

/lgtm

@ti-chi-bot
Copy link
Member Author

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • YuJuncen

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels May 24, 2021
@ZipFast
Copy link
Contributor

ZipFast commented May 24, 2021

/merge

@ti-chi-bot
Copy link
Member Author

@Zwj-coder: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

In response to this:

/merge

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 ti-community-infra/tichi repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants