1
0
Fork 0

Merge pull request #925 from rqlite/ignore-disco-state

Ignore disco ID if there is preexisting state
master
Philip O'Toole 3 years ago committed by GitHub
commit a2db5d200d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,7 @@
## 6.8.1 (unreleased)
### 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).
## 6.8.0 (November 9th 2021)
### New features

@ -249,7 +249,7 @@ func main() {
// Determine join addresses
var joins []string
joins, err = determineJoinAddresses()
joins, err = determineJoinAddresses(isNew)
if err != nil {
log.Fatalf("unable to determine join addresses: %s", err.Error())
}
@ -350,7 +350,7 @@ func main() {
log.Println("rqlite server stopped")
}
func determineJoinAddresses() ([]string, error) {
func determineJoinAddresses(isNew bool) ([]string, error) {
apiAdv := httpAddr
if httpAdv != "" {
apiAdv = httpAdv
@ -363,6 +363,9 @@ func determineJoinAddresses() ([]string, error) {
}
if discoID != "" {
if !isNew {
log.Printf("node has preexisting state, ignoring Discovery ID %s", discoID)
} else {
log.Printf("registering with Discovery Service at %s with ID %s", discoURL, discoID)
c := disco.New(discoURL)
r, err := c.Register(discoID, apiAdv)
@ -377,6 +380,7 @@ func determineJoinAddresses() ([]string, error) {
}
}
}
}
return addrs, nil
}

Loading…
Cancel
Save