rptest: do not expect cached segment readers at the end of the test #23509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This assertion fails from time to time. It seems perfectly fine there not to be any cached readers available.
If there aren't any running queries using readers and we are under memory pressure the next query will likely evict all segment readers to free up resources. Reader eviction (and memory accounting) is asynchronous but the metric/probe update is synchronous.
If we get metrics in-between last query acquiring memory resources (or slightly after) and before the actual physical eviction happened then we expect the metric to be 0.
It is possible for the last query to be aborted altogether in-between requesting resources and actually creating a reader which would also lead to metric being 0.
I consider this acceptable behavior so removing the assert.
Backports Required
Release Notes