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

api: add initialized flag in cluster status #1555

Merged
merged 3 commits into from
Jun 3, 2019

Conversation

disksing
Copy link
Contributor

@disksing disksing commented May 31, 2019

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

  • Unit test
  • Manual test (add detailed scripts or steps below)
    start a cluster then check the output of curl http://127.0.0.1:2379/pd/api/v1/cluster/status

Code changes

  • Has HTTP API interfaces change

Side effects

  • Breaking backward compatibility: Before this, we allow to config max-replicas=3 and only start 1 tikv-server. It will be required to set max-replicas=1 to start the cluster.

Related changes

  • Need to cherry-pick to the release branch: cherry-pick to release-3.0
  • Need to update the tidb-ansible repository: ansible need to check the status before starting tidb-server
  • Need to be included in the release notes

Signed-off-by: disksing <i@disksing.com>
server/cluster.go Outdated Show resolved Hide resolved
server/cluster.go Outdated Show resolved Hide resolved
Signed-off-by: disksing <i@disksing.com>
@disksing
Copy link
Contributor Author

disksing commented Jun 3, 2019

@gregwebs @rleungx comments addressed.

@disksing disksing merged commit 4a451d2 into tikv:master Jun 3, 2019
@disksing disksing deleted the initialized branch June 3, 2019 08:49
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
* api: add initialized flag in cluster status

Signed-off-by: disksing <i@disksing.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants