From 5bd8c8c561ecc8bf3dd37b80eb111eba64baa659 Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Mon, 9 Oct 2023 16:15:06 +0200 Subject: [PATCH] Clarify Postings.At() contract (#12921) It's implicit, but should be explicit. It is invalid to call At() after a failed call to Next() or Seek(). Following up on https://github.com/prometheus/prometheus/pull/12906 Signed-off-by: Oleg Zaytsev --- tsdb/index/postings.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tsdb/index/postings.go b/tsdb/index/postings.go index 5f24dbfe1..2132014ec 100644 --- a/tsdb/index/postings.go +++ b/tsdb/index/postings.go @@ -413,6 +413,7 @@ type Postings interface { Seek(v storage.SeriesRef) bool // At returns the value at the current iterator position. + // At should only be called after a successful call to Next or Seek. At() storage.SeriesRef // Err returns the last error of the iterator.