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

infosync: omit the 404 error when /config/placement-rule is not existed #21247

Merged
merged 5 commits into from
Nov 26, 2020

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Nov 24, 2020

What problem does this PR solve?

Issue Number: close pingcap/br#609

Problem Summary: BR cannot backup when PD doesn't have /config/placement-rule API

What is changed and how it works?

What's Changed:

This PR checks the response of /config/placement-rule, if the status code of the response is 404, return nil directly.

Check List

Tests

  • Manual test

Start a cluster and create a table and then use br to backup.

Before:

Detail BR log in /tmp/br.log.2020-11-24T14.46.00+0800
Error: 404 page not found

After:

Detail BR log in /tmp/br.log.2020-11-24T15.28.18+0800
Full backup <---------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
Checksum <------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2020/11/24 15:28:18.290 +08:00] [INFO] [collector.go:60] ["Full backup Success summary: total backup ranges: 1, total success: 1, total failed: 0, total take(Full backup time): 13.225799ms, total take(real time): 137.764607ms, total kv: 1, total size(Byte): 29, avg speed(Byte/s): 2192.68"] ["backup checksum"=3.554101ms] ["backup fast checksum"=152.977µs] ["backup total regions"=1] [Size=2761] [BackupTS=421056452550197250]

Release note

  • No release note

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@sre-bot
Copy link
Contributor

sre-bot commented Nov 24, 2020

@sre-bot
Copy link
Contributor

sre-bot commented Nov 24, 2020

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what's changed

Or if the count of mainly changed packages are more than 3, use

  • *: what's changed

@rleungx rleungx changed the title omit the 404 error when /config/placement-rule is not existed infosync: omit the 404 error when /config/placement-rule is not existed Nov 24, 2020
@overvenus
Copy link
Member

Could you add a unit test? Rest LGTM, thanks!

domain/infosync/info.go Outdated Show resolved Hide resolved
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@kennytm
Copy link
Contributor

kennytm commented Nov 25, 2020

LGTM after adding test #21247 (comment)

@rleungx
Copy link
Member Author

rleungx commented Nov 25, 2020

/label type/bug-fix

@ti-srebot ti-srebot added the type/bugfix This PR fixes a bug. label Nov 25, 2020
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Nov 25, 2020
@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 25, 2020
@kennytm
Copy link
Contributor

kennytm commented Nov 25, 2020

/cc @overvenus

@overvenus
Copy link
Member

LGTM

@ti-srebot
Copy link
Contributor

@overvenus, Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments. See the corresponding SIG page for more information. Related SIG: ddl(slack).

Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Nov 26, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Nov 26, 2020
@rleungx
Copy link
Member Author

rleungx commented Nov 26, 2020

/merge

@ti-srebot
Copy link
Contributor

@rleungx Oops! auto merge is restricted to Committers of the SIG.See the corresponding SIG page for more information. Related SIG: ddl(slack).

@jebter
Copy link

jebter commented Nov 26, 2020

/merge

@ti-srebot
Copy link
Contributor

@jebter Oops! auto merge is restricted to Committers of the SIG.See the corresponding SIG page for more information. Related SIG: ddl(slack).

@bb7133
Copy link
Member

bb7133 commented Nov 26, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 26, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit f7f48e3 into pingcap:master Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backup fails with "404 page not found"
8 participants