From 93589ecccf4877e43d7e2e75abd30771095057d6 Mon Sep 17 00:00:00 2001
From: Haleygo <hui.wang@daocloud.io>
Date: Mon, 16 Oct 2023 15:05:37 +0800
Subject: [PATCH] fix ingesting stale point, follow up
 https://github.com/VictoriaMetrics/VictoriaMetrics/commit/fe8cc573d1d839d84e7d71949bca0b7f16f8faf8
 (#5179)

---
 lib/storage/storage.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/storage/storage.go b/lib/storage/storage.go
index 9ed82fb253..31d57d31de 100644
--- a/lib/storage/storage.go
+++ b/lib/storage/storage.go
@@ -1828,7 +1828,7 @@ func (s *Storage) add(rows []rawRow, dstMrs []*MetricRow, mrs []MetricRow, preci
 	for i := range mrs {
 		mr := &mrs[i]
 		if math.IsNaN(mr.Value) {
-			if decimal.IsStaleNaN(mr.Value) {
+			if !decimal.IsStaleNaN(mr.Value) {
 				// Skip NaNs other than Prometheus staleness marker, since the underlying encoding
 				// doesn't know how to work with them.
 				continue