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

status: add new http status API for get meta regions. #4597

Merged
merged 9 commits into from
Oct 10, 2017

Conversation

hicqu
Copy link
Contributor

@hicqu hicqu commented Sep 21, 2017

Add a new API( /regions/meta ) for get meta regions.
The return JSON is:

[
    {
        "leader": {
            "id": 3,
            "store_id": 1
        },
        "peers": [
            {
                "id": 3,
                "store_id": 1
            }
        ],
        "region_epoch": {
            "conf_ver": 1,
            "version": 1
        },
        "region_id": 2
    }
]

Meta means those TiKV keys which start with m.

@siddontang , PTAL, thanks.

@hicqu hicqu requested a review from AndreMouche September 21, 2017 08:31
@coocood
Copy link
Member

coocood commented Sep 21, 2017

@hicqu
Please add test.

resp, err := http.Get("http://127.0.0.1:10090/regions/meta")
c.Assert(err, IsNil)
defer resp.Body.Close()
c.Assert(resp.StatusCode, Equals, http.StatusOK)
Copy link
Member

Choose a reason for hiding this comment

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

Why not verify the body?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we do verify whether the body is a valid json array or not.

Copy link
Member

Choose a reason for hiding this comment

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

Why not verify if it is region meta?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. PTAL, thanks!

@shenli
Copy link
Member

shenli commented Sep 26, 2017

@hicqu Please address the comment.

@hicqu
Copy link
Contributor Author

hicqu commented Sep 29, 2017

/run-all-test

@coocood
Copy link
Member

coocood commented Sep 30, 2017

LGTM

@hicqu
Copy link
Contributor Author

hicqu commented Sep 30, 2017

@disksing @shenli , PTAL, thanks.

@coocood coocood added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 9, 2017
@disksing
Copy link
Contributor

LGTM.

@disksing disksing added the status/LGT2 Indicates that a PR has LGTM 2. label Oct 10, 2017
@winoros winoros removed the status/LGT1 Indicates that a PR has LGTM 1. label Oct 10, 2017
@winoros winoros merged commit e9ffb58 into master Oct 10, 2017
@winoros winoros deleted the qupeng/meta-region branch October 10, 2017 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants