mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vminsert/netstorage: update storageNode.lastRerouteTime before the rerouting
This is needed for reliable detection of storage nodes with recent rerouting
This commit is contained in:
parent
0d067eb112
commit
2c6b917749
1 changed files with 1 additions and 1 deletions
|
@ -470,6 +470,7 @@ func rerouteRowsMayBlock(snSource *storageNode, mayUseSNSource bool, buf []byte,
|
|||
logger.Panicf("BUG: re-routing can work only if at least 2 storage nodes are configured; got %d nodes", len(storageNodes))
|
||||
}
|
||||
reroutesTotal.Inc()
|
||||
atomic.StoreUint64(&snSource.lastRerouteTime, fasttime.UnixTimestamp())
|
||||
sns := getStorageNodesMapForRerouting(snSource, mayUseSNSource)
|
||||
if areStorageNodesEqual(sns) {
|
||||
// Fast path - all the storage nodes are the same - send the buf to them.
|
||||
|
@ -483,7 +484,6 @@ func rerouteRowsMayBlock(snSource *storageNode, mayUseSNSource bool, buf []byte,
|
|||
}
|
||||
return nil
|
||||
}
|
||||
atomic.StoreUint64(&snSource.lastRerouteTime, fasttime.UnixTimestamp())
|
||||
src := buf
|
||||
var mr storage.MetricRow
|
||||
for len(src) > 0 {
|
||||
|
|
Loading…
Reference in a new issue