From b2185d96af9a45c7efa384b1f57138700c95bce5 Mon Sep 17 00:00:00 2001 From: Daniel Kerbel Date: Tue, 26 Dec 2023 18:44:39 +0200 Subject: [PATCH] Consider storage.ErrTooOldSample as non-retryable Signed-off-by: Daniel Kerbel --- storage/remote/write_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/remote/write_handler.go b/storage/remote/write_handler.go index 9891c6aae7..971f7b457e 100644 --- a/storage/remote/write_handler.go +++ b/storage/remote/write_handler.go @@ -68,7 +68,7 @@ func (h *writeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { err = h.write(r.Context(), req) switch { case err == nil: - case errors.Is(err, storage.ErrOutOfOrderSample), errors.Is(err, storage.ErrOutOfBounds), errors.Is(err, storage.ErrDuplicateSampleForTimestamp): + case errors.Is(err, storage.ErrOutOfOrderSample), errors.Is(err, storage.ErrOutOfBounds), errors.Is(err, storage.ErrDuplicateSampleForTimestamp), errors.Is(err, storage.ErrTooOldSample): // Indicated an out of order sample is a bad request to prevent retries. http.Error(w, err.Error(), http.StatusBadRequest) return