mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
Adds blocks drop (#1151)
* adds blocks drop at 400 BadRequest status code recieved from remote storage, not expected that remote storage will be able to handle it on retry * removes error logging for dropped blocks, its expected error
This commit is contained in:
parent
7d87d42a91
commit
15ff1f3a94
1 changed files with 5 additions and 4 deletions
|
@ -259,13 +259,14 @@ again:
|
|||
return true
|
||||
}
|
||||
metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_remotewrite_requests_total{url=%q, status_code="%d"}`, c.sanitizedURL, statusCode)).Inc()
|
||||
if statusCode == 409 {
|
||||
if statusCode == 409 || statusCode == 400 {
|
||||
// Just drop block on 409 status code like Prometheus does.
|
||||
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/873
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
// drop block on 400 status code,
|
||||
// not expected that remote server will be able to handle it on retry
|
||||
// should fix https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1149
|
||||
_, _ = ioutil.ReadAll(resp.Body)
|
||||
_ = resp.Body.Close()
|
||||
logger.Errorf("unexpected status code received when sending a block with size %d bytes to %q: #%d; dropping the block like Prometheus does; "+
|
||||
"response body=%q", len(block), c.sanitizedURL, statusCode, body)
|
||||
c.packetsDropped.Inc()
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue