1
0
Fork 0

Merge pull request #926 from rqlite/ignore-own-join-address

Ignore own join address if passed
master
Philip O'Toole 3 years ago committed by GitHub
commit a78bf9bfb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,6 +2,7 @@
### Implementation changes and bug fixes
- [Fix URL](https://github.com/rqlite/rqlite/commit/d8e915e0be589b5cf1d593b80985e8247ba5f3d9) for `.ready` CLI command.
- [PR #925](https://github.com/rqlite/rqlite/pull/925): Ignore disco ID if there is preexisting state. Fixes [issue #347](https://github.com/rqlite/rqlite/issues/347).
- [PR #926](https://github.com/rqlite/rqlite/pull/926): Ignore own join address if passed. Fixes [issue #713](https://github.com/rqlite/rqlite/issues/713).
## 6.8.0 (November 9th 2021)
### New features

@ -373,16 +373,21 @@ func determineJoinAddresses(isNew bool) ([]string, error) {
return nil, err
}
log.Println("Discovery Service responded with nodes:", r.Nodes)
for _, a := range r.Nodes {
if a != apiAdv {
// Only other nodes can be joined.
addrs = append(addrs, a)
}
}
addrs = append(addrs, r.Nodes...)
}
}
// It won't work to attempt a self-join, so remove any such address.
var validAddrs []string
for i := range addrs {
if addrs[i] == apiAdv || addrs[i] == fmt.Sprintf("http://%s", apiAdv) {
log.Printf("ignoring join address %s equal to this node's address", addrs[i])
continue
}
validAddrs = append(validAddrs, addrs[i])
}
return addrs, nil
return validAddrs, nil
}
func waitForConsensus(str *store.Store) error {

Loading…
Cancel
Save