Bryan Boreham e86b9812f4 [BUGFIX] Scraping: bump cache iteration after error
Backport of #16174 to LTS release-2.53 branch.

We use the cache iteration number to detect when the same metric has
occurred twice in a scrape. We need to bump this number at the end of
every scrape, not just successful scrapes.

The `iter` number is also used:
* After a successful scrape, to delete older metrics and metadata.
* To detect when metadata changed in this scrape.

None of those additional cases is broken by incrementing the number
on error.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-03-17 18:09:01 +00:00
..