Skip to content

Commit

Permalink
fix: apply review suggestion
Browse files Browse the repository at this point in the history
Signed-off-by: nic-chen <chenjunxu6@gmail.com>
  • Loading branch information
nic-chen committed Oct 27, 2022
1 parent d4fbfb8 commit 191fb30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 9 additions & 0 deletions server/embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,15 @@ func (cfg *Config) Validate() error {
return fmt.Errorf("--experimental-compact-hash-check-time must be >0 (set to %v)", cfg.ExperimentalCompactHashCheckTime)
}

// If `--name` isn't configured, then multiple members may have the same "default" name.
// When adding a new member with the "default" name as well, etcd may regards its peerURL
// as one additional peerURL of the existing member which has the same "default" name,
// because each member can have multiple client or peer URLs.
// Please refer to https://github.com/etcd-io/etcd/issues/13757
if cfg.Name == DefaultName {
cfg.logger.Warn("the server is using default name, which might cause error that failed the startup.")
}

return nil
}

Expand Down
4 changes: 0 additions & 4 deletions server/etcdmain/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ func startEtcdOrProxyV2(args []string) {
lg.Info("failed to detect default host", zap.Error(dhErr))
}

if cfg.ec.Name == embed.DefaultName {
lg.Warn("the server is using default name, which might cause error that failed the startup.")
}

if cfg.ec.Dir == "" {
cfg.ec.Dir = fmt.Sprintf("%v.etcd", cfg.ec.Name)
lg.Warn(
Expand Down

0 comments on commit 191fb30

Please sign in to comment.