mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
Update serf to pick up fixes for fsyncing snapshots and panic when coordinates are disabled
This commit is contained in:
parent
ee2cc7aaca
commit
c9d5e17410
2
vendor/github.com/hashicorp/serf/serf/keymanager.go
generated
vendored
2
vendor/github.com/hashicorp/serf/serf/keymanager.go
generated
vendored
@ -189,4 +189,4 @@ func (k *KeyManager) ListKeysWithOptions(opts *KeyRequestOptions) (*KeyResponse,
|
|||||||
defer k.l.RUnlock()
|
defer k.l.RUnlock()
|
||||||
|
|
||||||
return k.handleKeyRequest("", listKeysQuery, opts)
|
return k.handleKeyRequest("", listKeysQuery, opts)
|
||||||
}
|
}
|
||||||
|
26
vendor/github.com/hashicorp/serf/serf/serf.go
generated
vendored
26
vendor/github.com/hashicorp/serf/serf/serf.go
generated
vendored
@ -1655,18 +1655,20 @@ func (s *Serf) Stats() map[string]string {
|
|||||||
return strconv.FormatUint(v, 10)
|
return strconv.FormatUint(v, 10)
|
||||||
}
|
}
|
||||||
stats := map[string]string{
|
stats := map[string]string{
|
||||||
"members": toString(uint64(len(s.members))),
|
"members": toString(uint64(len(s.members))),
|
||||||
"failed": toString(uint64(len(s.failedMembers))),
|
"failed": toString(uint64(len(s.failedMembers))),
|
||||||
"left": toString(uint64(len(s.leftMembers))),
|
"left": toString(uint64(len(s.leftMembers))),
|
||||||
"health_score": toString(uint64(s.memberlist.GetHealthScore())),
|
"health_score": toString(uint64(s.memberlist.GetHealthScore())),
|
||||||
"member_time": toString(uint64(s.clock.Time())),
|
"member_time": toString(uint64(s.clock.Time())),
|
||||||
"event_time": toString(uint64(s.eventClock.Time())),
|
"event_time": toString(uint64(s.eventClock.Time())),
|
||||||
"query_time": toString(uint64(s.queryClock.Time())),
|
"query_time": toString(uint64(s.queryClock.Time())),
|
||||||
"intent_queue": toString(uint64(s.broadcasts.NumQueued())),
|
"intent_queue": toString(uint64(s.broadcasts.NumQueued())),
|
||||||
"event_queue": toString(uint64(s.eventBroadcasts.NumQueued())),
|
"event_queue": toString(uint64(s.eventBroadcasts.NumQueued())),
|
||||||
"query_queue": toString(uint64(s.queryBroadcasts.NumQueued())),
|
"query_queue": toString(uint64(s.queryBroadcasts.NumQueued())),
|
||||||
"encrypted": fmt.Sprintf("%v", s.EncryptionEnabled()),
|
"encrypted": fmt.Sprintf("%v", s.EncryptionEnabled()),
|
||||||
"coordinate_resets": toString(uint64(s.coordClient.Stats().Resets)),
|
}
|
||||||
|
if !s.config.DisableCoordinates {
|
||||||
|
stats["coordinate_resets"] = toString(uint64(s.coordClient.Stats().Resets))
|
||||||
}
|
}
|
||||||
return stats
|
return stats
|
||||||
}
|
}
|
||||||
|
53
vendor/github.com/hashicorp/serf/serf/snapshot.go
generated
vendored
53
vendor/github.com/hashicorp/serf/serf/snapshot.go
generated
vendored
@ -36,27 +36,27 @@ const snapshotErrorRecoveryInterval = 30 * time.Second
|
|||||||
// Snapshotter is responsible for ingesting events and persisting
|
// Snapshotter is responsible for ingesting events and persisting
|
||||||
// them to disk, and providing a recovery mechanism at start time.
|
// them to disk, and providing a recovery mechanism at start time.
|
||||||
type Snapshotter struct {
|
type Snapshotter struct {
|
||||||
aliveNodes map[string]string
|
aliveNodes map[string]string
|
||||||
clock *LamportClock
|
clock *LamportClock
|
||||||
coordClient *coordinate.Client
|
coordClient *coordinate.Client
|
||||||
fh *os.File
|
fh *os.File
|
||||||
buffered *bufio.Writer
|
buffered *bufio.Writer
|
||||||
inCh <-chan Event
|
inCh <-chan Event
|
||||||
lastFlush time.Time
|
lastFlush time.Time
|
||||||
lastClock LamportTime
|
lastClock LamportTime
|
||||||
lastEventClock LamportTime
|
lastEventClock LamportTime
|
||||||
lastQueryClock LamportTime
|
lastQueryClock LamportTime
|
||||||
leaveCh chan struct{}
|
leaveCh chan struct{}
|
||||||
leaving bool
|
leaving bool
|
||||||
logger *log.Logger
|
logger *log.Logger
|
||||||
maxSize int64
|
maxSize int64
|
||||||
path string
|
path string
|
||||||
offset int64
|
offset int64
|
||||||
outCh chan<- Event
|
outCh chan<- Event
|
||||||
rejoinAfterLeave bool
|
rejoinAfterLeave bool
|
||||||
shutdownCh <-chan struct{}
|
shutdownCh <-chan struct{}
|
||||||
waitCh chan struct{}
|
waitCh chan struct{}
|
||||||
lastAttemptedCompaction time.Time
|
lastAttemptedCompaction time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
// PreviousNode is used to represent the previously known alive nodes
|
// PreviousNode is used to represent the previously known alive nodes
|
||||||
@ -423,11 +423,20 @@ func (s *Snapshotter) compact() error {
|
|||||||
|
|
||||||
// Flush the new snapshot
|
// Flush the new snapshot
|
||||||
err = buf.Flush()
|
err = buf.Flush()
|
||||||
fh.Close()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to flush new snapshot: %v", err)
|
return fmt.Errorf("failed to flush new snapshot: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = fh.Sync()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fh.Close()
|
||||||
|
return fmt.Errorf("failed to fsync new snapshot: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fh.Close()
|
||||||
|
|
||||||
// We now need to swap the old snapshot file with the new snapshot.
|
// We now need to swap the old snapshot file with the new snapshot.
|
||||||
// Turns out, Windows won't let us rename the files if we have
|
// Turns out, Windows won't let us rename the files if we have
|
||||||
// open handles to them or if the destination already exists. This
|
// open handles to them or if the destination already exists. This
|
||||||
|
2
vendor/vendor.json
vendored
2
vendor/vendor.json
vendored
@ -60,7 +60,7 @@
|
|||||||
{"checksumSHA1":"5GHIYEtOr1rsHOZUac6RA/82d3I=","path":"github.com/hashicorp/raft","revision":"0a6e1b039ba3d8057e9f16c919d2afb813884f74","revisionTime":"2017-08-04T15:11:58Z","version":"library-v2-stage-one","versionExact":"library-v2-stage-one"},
|
{"checksumSHA1":"5GHIYEtOr1rsHOZUac6RA/82d3I=","path":"github.com/hashicorp/raft","revision":"0a6e1b039ba3d8057e9f16c919d2afb813884f74","revisionTime":"2017-08-04T15:11:58Z","version":"library-v2-stage-one","versionExact":"library-v2-stage-one"},
|
||||||
{"checksumSHA1":"QAxukkv54/iIvLfsUP6IK4R0m/A=","path":"github.com/hashicorp/raft-boltdb","revision":"d1e82c1ec3f15ee991f7cc7ffd5b67ff6f5bbaee","revisionTime":"2015-02-01T20:08:39Z"},
|
{"checksumSHA1":"QAxukkv54/iIvLfsUP6IK4R0m/A=","path":"github.com/hashicorp/raft-boltdb","revision":"d1e82c1ec3f15ee991f7cc7ffd5b67ff6f5bbaee","revisionTime":"2015-02-01T20:08:39Z"},
|
||||||
{"checksumSHA1":"/oss17GO4hXGM7QnUdI3VzcAHzA=","comment":"v0.7.0-66-g6c4672d","path":"github.com/hashicorp/serf/coordinate","revision":"c2e4be24cdc9031eb0ad869c5d160775efdf7d7a","revisionTime":"2017-05-25T23:15:04Z"},
|
{"checksumSHA1":"/oss17GO4hXGM7QnUdI3VzcAHzA=","comment":"v0.7.0-66-g6c4672d","path":"github.com/hashicorp/serf/coordinate","revision":"c2e4be24cdc9031eb0ad869c5d160775efdf7d7a","revisionTime":"2017-05-25T23:15:04Z"},
|
||||||
{"checksumSHA1":"o1VR3OEjCXQW/vT1wpUBOYfGrPQ=","comment":"v0.7.0-66-g6c4672d","path":"github.com/hashicorp/serf/serf","revision":"6669b5d30985da6dd423ecf65f033cee400203fe","revisionTime":"2017-07-07T06:54:45Z"},
|
{"checksumSHA1":"3WPnGSL9ZK6EmkAE6tEW5SCxrd8=","comment":"v0.7.0-66-g6c4672d","path":"github.com/hashicorp/serf/serf","revision":"b84a66cc5575994cb672940d244a2404141688c0","revisionTime":"2017-08-17T21:22:02Z"},
|
||||||
{"checksumSHA1":"ZhK6IO2XN81Y+3RAjTcVm1Ic7oU=","path":"github.com/hashicorp/yamux","revision":"d1caa6c97c9fc1cc9e83bbe34d0603f9ff0ce8bd","revisionTime":"2016-07-20T23:31:40Z"},
|
{"checksumSHA1":"ZhK6IO2XN81Y+3RAjTcVm1Ic7oU=","path":"github.com/hashicorp/yamux","revision":"d1caa6c97c9fc1cc9e83bbe34d0603f9ff0ce8bd","revisionTime":"2016-07-20T23:31:40Z"},
|
||||||
{"checksumSHA1":"xZuhljnmBysJPta/lMyYmJdujCg=","path":"github.com/mattn/go-isatty","revision":"66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8","revisionTime":"2016-08-06T12:27:52Z"},
|
{"checksumSHA1":"xZuhljnmBysJPta/lMyYmJdujCg=","path":"github.com/mattn/go-isatty","revision":"66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8","revisionTime":"2016-08-06T12:27:52Z"},
|
||||||
{"checksumSHA1":"OUZ1FFXyKs+Cfg9M9rmXqqweQck=","path":"github.com/miekg/dns","revision":"db96a2b759cdef4f11a34506a42eb8d1290c598e","revisionTime":"2016-07-26T03:20:27Z"},
|
{"checksumSHA1":"OUZ1FFXyKs+Cfg9M9rmXqqweQck=","path":"github.com/miekg/dns","revision":"db96a2b759cdef4f11a34506a42eb8d1290c598e","revisionTime":"2016-07-26T03:20:27Z"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user