mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 14:24:39 +00:00
Merge pull request #3236 from hashicorp/serf_update
Update serf to pull in disk space failure recovery changes
This commit is contained in:
commit
dabd94c73d
13
vendor/github.com/hashicorp/serf/serf/snapshot.go
generated
vendored
13
vendor/github.com/hashicorp/serf/serf/snapshot.go
generated
vendored
@ -31,6 +31,7 @@ const flushInterval = 500 * time.Millisecond
|
|||||||
const clockUpdateInterval = 500 * time.Millisecond
|
const clockUpdateInterval = 500 * time.Millisecond
|
||||||
const coordinateUpdateInterval = 60 * time.Second
|
const coordinateUpdateInterval = 60 * time.Second
|
||||||
const tmpExt = ".compact"
|
const tmpExt = ".compact"
|
||||||
|
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.
|
||||||
@ -55,6 +56,7 @@ type Snapshotter struct {
|
|||||||
rejoinAfterLeave bool
|
rejoinAfterLeave bool
|
||||||
shutdownCh <-chan struct{}
|
shutdownCh <-chan struct{}
|
||||||
waitCh chan struct{}
|
waitCh chan struct{}
|
||||||
|
lastAttemptedCompaction time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
// PreviousNode is used to represent the previously known alive nodes
|
// PreviousNode is used to represent the previously known alive nodes
|
||||||
@ -311,6 +313,17 @@ func (s *Snapshotter) processQuery(q *Query) {
|
|||||||
func (s *Snapshotter) tryAppend(l string) {
|
func (s *Snapshotter) tryAppend(l string) {
|
||||||
if err := s.appendLine(l); err != nil {
|
if err := s.appendLine(l); err != nil {
|
||||||
s.logger.Printf("[ERR] serf: Failed to update snapshot: %v", err)
|
s.logger.Printf("[ERR] serf: Failed to update snapshot: %v", err)
|
||||||
|
now := time.Now()
|
||||||
|
if now.Sub(s.lastAttemptedCompaction) > snapshotErrorRecoveryInterval {
|
||||||
|
s.lastAttemptedCompaction = now
|
||||||
|
s.logger.Printf("[INFO] serf: Attempting compaction to recover from error...")
|
||||||
|
err = s.compact()
|
||||||
|
if err != nil {
|
||||||
|
s.logger.Printf("[ERR] serf: Compaction failed, will reattempt after %v: %v", snapshotErrorRecoveryInterval, err)
|
||||||
|
} else {
|
||||||
|
s.logger.Printf("[INFO] serf: Finished compaction, successfully recovered from error state")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
vendor/vendor.json
vendored
6
vendor/vendor.json
vendored
@ -681,11 +681,11 @@
|
|||||||
"revisionTime": "2017-05-25T23:15:04Z"
|
"revisionTime": "2017-05-25T23:15:04Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "3LFg00GII0KbMRpqi38MRkMhoyM=",
|
"checksumSHA1": "ZWsQL8XzWMjRc5rgyJ1QT5kTEr4=",
|
||||||
"comment": "v0.7.0-66-g6c4672d",
|
"comment": "v0.7.0-66-g6c4672d",
|
||||||
"path": "github.com/hashicorp/serf/serf",
|
"path": "github.com/hashicorp/serf/serf",
|
||||||
"revision": "91fd53b1d3e624389ed9a295a3fa380e5c7b9dfc",
|
"revision": "ed7ee1a9945337d2ed629967c9a62bea8b508a34",
|
||||||
"revisionTime": "2017-06-14T22:59:51Z"
|
"revisionTime": "2017-07-06T13:52:27Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "ZhK6IO2XN81Y+3RAjTcVm1Ic7oU=",
|
"checksumSHA1": "ZhK6IO2XN81Y+3RAjTcVm1Ic7oU=",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user