server: use same initialcluster config to restart joined member#1279
Merged
Conversation
disksing
reviewed
Oct 19, 2018
| } | ||
|
|
||
| // Cases with data directory. | ||
| filePath := cfg.DataDir + "/join" |
Contributor
There was a problem hiding this comment.
Suggested change
| filePath := cfg.DataDir + "/join" | |
| filePath := filepath.Join(cfg.DataDir, "join") |
disksing
approved these changes
Oct 22, 2018
disksing
approved these changes
Oct 22, 2018
disksing
approved these changes
Oct 22, 2018
disksing
approved these changes
Oct 22, 2018
rleungx
reviewed
Oct 23, 2018
| cfg.InitialCluster = initialCluster | ||
| cfg.InitialClusterState = embed.ClusterStateFlagExisting | ||
| return nil | ||
| err = os.Mkdir(cfg.DataDir, privateDirMode) |
Member
There was a problem hiding this comment.
Do we need to use MkdirAll here?
Contributor
Author
|
PTAL |
disksing
reviewed
Oct 23, 2018
| existed := false | ||
| for _, m := range listResp.Members { | ||
| if len(m.Name) == 0 { | ||
| return errors.New("exsist a member that the join is not completed") |
Contributor
There was a problem hiding this comment.
How about there is a member that has not been joined successfully?
PTAL @CaitinChen
There was a problem hiding this comment.
@disksing there is a member that has not joined successfully
disksing
reviewed
Oct 23, 2018
| return nil | ||
| err = os.MkdirAll(cfg.DataDir, privateDirMode) | ||
| if err != nil && !os.IsExist(err) { | ||
| return err |
| return err | ||
| } | ||
|
|
||
| for i := 0; i < retryTimes; i++ { |
Contributor
There was a problem hiding this comment.
Maybe we don't need to retry. It's ok to exit directly.
| } | ||
| break | ||
| } | ||
| return err |
disksing
approved these changes
Oct 23, 2018
rleungx
reviewed
Oct 24, 2018
rleungx
approved these changes
Oct 24, 2018
Contributor
|
@disksing are there any plans to put this into the next RC (assuming there is one)? This issue shows up frequently in our DinD setup, so we could also use this to produce a docker image specifically for that setup. |
Contributor
|
I think we can include it in RC5. /cc @nolouch |
nolouch
added a commit
to nolouch/pd
that referenced
this pull request
Nov 12, 2018
nolouch
added a commit
that referenced
this pull request
Nov 12, 2018
Merged
disksing
pushed a commit
to oh-my-tidb/pd
that referenced
this pull request
Nov 14, 2018
disksing
added a commit
that referenced
this pull request
Nov 14, 2018
* server, client: fix hanging problem when etcd failed to start (#1267) * server: use same initialcluster config to restart joined member (#1279) * fix server build * pdctl: cherry pick bugfixes (#1298, #1299, #1308) * server/api: fix the issue about `regions/check` API (#1311) * fix join build * fix pdctl build * fix region test * fix warnings
This file contains hidden or 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
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.
What problem does this PR solve?
detail in: pingcap/tidb-operator#126
because some problem in etcd when joining a member. it may prepare to join failed. and we dynamically generate the join config for join member. and that's may cause the problem:
What is changed and how it works?
use the same join config after join success.
Check List
Tests