mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
Add flag to vminsert to disable rerouting when some of storage nodes are unavailable (#5713)
* Flag to disable rerouting from unavailable storage nodes * Update netstorage.go * Fix fmt for netstorage.go
This commit is contained in:
parent
67d166f181
commit
88f0d1572e
1 changed files with 9 additions and 0 deletions
|
@ -38,6 +38,10 @@ var (
|
|||
"Lower values speed up re-rerouting recovery when some of vmstorage nodes become unavailable because of networking issues. "+
|
||||
"Read more about TCP_USER_TIMEOUT at https://blog.cloudflare.com/when-tcp-sockets-refuse-to-die/ . "+
|
||||
"See also -vmstorageDialTimeout")
|
||||
disableReroutingOnUnavailable = flag.Bool("disableReroutingOnUnavailable", false, "Whether to disable re-routing when some of vmstorage nodes are unavailable. "+
|
||||
"Disabled re-routing stops ingestion when some storage nodes are unavailable. "+
|
||||
"On the other side, disabled re-routing minimizes the number of active time series in the cluster "+
|
||||
"during rolling restarts and during spikes in series churn rate.")
|
||||
)
|
||||
|
||||
var errStorageReadOnly = errors.New("storage node is read only")
|
||||
|
@ -96,6 +100,11 @@ again:
|
|||
sn.brCond.Wait()
|
||||
goto again
|
||||
}
|
||||
if *disableReroutingOnUnavailable {
|
||||
// We should not send timeseries from currently unavailable storage to alive storage nodes
|
||||
sn.brCond.Wait()
|
||||
goto again
|
||||
}
|
||||
sn.brLock.Unlock()
|
||||
// The vmstorage node isn't ready for data processing. Re-route buf to healthy vmstorage nodes even if disableRerouting is set.
|
||||
rowsProcessed, err := rerouteRowsToReadyStorageNodes(snb, sn, buf)
|
||||
|
|
Loading…
Reference in a new issue