-
Notifications
You must be signed in to change notification settings - Fork 724
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
api: add initialized flag in cluster status #1555
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: disksing <i@disksing.com>
rleungx
reviewed
May 31, 2019
gregwebs
reviewed
May 31, 2019
Signed-off-by: disksing <i@disksing.com>
nolouch
approved these changes
Jun 3, 2019
rleungx
reviewed
Jun 3, 2019
rleungx
approved these changes
Jun 3, 2019
disksing
added a commit
to oh-my-tidb/pd
that referenced
this pull request
Jun 13, 2019
* api: add initialized flag in cluster status Signed-off-by: disksing <i@disksing.com> * make loadBootstrapTime() better Signed-off-by: disksing <i@disksing.com>
nolouch
pushed a commit
that referenced
this pull request
Jun 14, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: disksing i@disksing.com
What problem does this PR solve?
When initializing the cluster, PD needs to spend some time to add replica to the first region. If tidb-server is started before finish adding replica, the data may be written to single replica.
What is changed and how it works?
PD adds an flag of whether the region is initialized or not. Later
tidb-ansible
need to check whether it needs to wait for a while before starting tidb.Check List
Tests
start a cluster then check the output of
curl http://127.0.0.1:2379/pd/api/v1/cluster/status
Code changes
Side effects
max-replicas=3
and only start 1 tikv-server. It will be required to setmax-replicas=1
to start the cluster.Related changes
tidb-ansible
repository:ansible
need to check the status before starting tidb-server