mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +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))
|
logger.Panicf("BUG: re-routing can work only if at least 2 storage nodes are configured; got %d nodes", len(storageNodes))
|
||||||
}
|
}
|
||||||
reroutesTotal.Inc()
|
reroutesTotal.Inc()
|
||||||
|
atomic.StoreUint64(&snSource.lastRerouteTime, fasttime.UnixTimestamp())
|
||||||
sns := getStorageNodesMapForRerouting(snSource, mayUseSNSource)
|
sns := getStorageNodesMapForRerouting(snSource, mayUseSNSource)
|
||||||
if areStorageNodesEqual(sns) {
|
if areStorageNodesEqual(sns) {
|
||||||
// Fast path - all the storage nodes are the same - send the buf to them.
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
atomic.StoreUint64(&snSource.lastRerouteTime, fasttime.UnixTimestamp())
|
|
||||||
src := buf
|
src := buf
|
||||||
var mr storage.MetricRow
|
var mr storage.MetricRow
|
||||||
for len(src) > 0 {
|
for len(src) > 0 {
|
||||||
|
|
Loading…
Reference in a new issue