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:
Muxa1L 2024-02-05 15:46:57 +03:00 committed by GitHub
parent 67d166f181
commit 88f0d1572e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)