-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add ChunksIterator method to Series interface. #5882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f460245
to
1999ce8
Compare
tsdb/querier.go
Outdated
// Err returns the current error. | ||
Err() error | ||
func (s *chunkSeries) ChunkIterator() ChunkIterator { | ||
// TODO(bwplotka): This is wrong. We probably have to be strict in terms of min/maxt and tombstones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO/TO decide:
When we want to apply tombstones in ChunkIterator
? :/
TBH it might be the most efficient to pass intervals upstream e.g in streamed remote read protocol as well (???)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two options:
A) Naive: Rewrite chunk on the fly applying mint,maxt
and dranges
. It is must have for Select
interface which assumes things are scoped to given time range and tombstones are tolerated.
B) Ignore mint,maxt level. Maybe allow ChunkIterator to return deleted
intervals as well. This probably means extending the remote read chunked protocol here for passing tombstones intervals as well -> let client side to apply intervals.. However, we leak "deleted" metrics. If they were deleted because of GDPR or something, this is kind of wrong (:
I think overall we need to do A here. Thoughts @brian-brazil @tomwilkie @codesome ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely A, for general data security we don't want to be returning deleted data. It'd also push that complexity onto all readers, and they'd probably forget it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd also push that complexity onto all readers, and they'd probably forget it.
You would NOT put it to readers you mean?
Makes sense to me.. Let's do it then here.
Addressed all comments from the previous PR: prometheus-junkyard/tsdb#665 PTAL @brian-brazil @krasi-georgiev |
tsdb/head.go
Outdated
@@ -1617,6 +1617,8 @@ func newMemSeries(lset labels.Labels, id uint64, chunkRange int64) *memSeries { | |||
ref: id, | |||
chunkRange: chunkRange, | |||
nextAt: math.MinInt64, | |||
// This is to make sure iterator.At without advancing returns default values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not valid to call At without advancing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe calling At before Next or Seek should cause iterator.Error
In memSafeIterator add a var initialized and when false memSafeIterator.At returns default values and causes memSafeIterator.Err.
Either way the logic should be in the iterator itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so many iterators now, might run out of names soon 😄
tsdb/CHANGELOG.md
Outdated
@@ -1,5 +1,8 @@ | |||
## master / unreleased | |||
|
|||
- [CHANGE] `chunks.MergeOverlappingChunks` moved to `tsdb.MergeOverlappingChunks` | |||
- [CHANGE] `Series` interface allows return chunk iterator that allows iterating over encoded chunks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it is worth it to still keep track of these?
Is it helpful to you or the cortex team?
cc @tomwilkie
I mean do we still need a CHANGELOG file at all? How would it be useful?
tsdb/querier.go
Outdated
@@ -1175,6 +1358,19 @@ func (it *deletedIterator) At() (int64, float64) { | |||
return it.it.At() | |||
} | |||
|
|||
func (it *deletedIterator) Seek(t int64) bool { | |||
if atT, _ := it.At(); t >= atT { | |||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seek should return true when t==atT
If possible you can add the TestDeletedIterator
to TestSeriesIterators
and delete the TestDeletedIterator
test or add a seek test to TestDeletedIterator
tsdb/querier.go
Outdated
// ChunkIterator iterates over the chunk of a time series. | ||
type ChunkIterator interface { | ||
// Seek advances the iterator forward to the given timestamp. | ||
// It advances to the chunk with min time at t or first chunk with min time after t. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a behavior description similar to the chunk.Iterator
?
I mean what hapens in the different scenarios when requested time is the same or smaller than the current At.
var r []tsdbutil.Sample | ||
if tc.seek != 0 { | ||
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) | ||
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) // Next one should be noop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) // Next one should be noop. | |
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) // Next one should be noop. | |
testutil.Equals(t, false, it.Seek(tc.seek-1)) // Seek in the past should be noop and return false. | |
var r []chunks.Meta | ||
if tc.seek != 0 { | ||
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) | ||
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) // Next one should be noop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) // Next one should be noop. | |
testutil.Equals(t, tc.seekSuccess, it.Seek(tc.seek)) // Next one should be noop. | |
testutil.Equals(t, false, it.Seek(tc.seek-1)) // Seek in the past should be noop and return false. |
} | ||
} | ||
|
||
func (it *verticalMergeSeriesIterator) Seek(t int64) bool { | ||
if it.initialized && it.curT >= t { | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm this doesn't look right. This would return true when it.curT
is 150 and the requested time is 100
I thought we want the following behaviour:
Iterator with minT:100
, maxT:200
, curT:150
Seek(150) - returns true and the Seek is noop, doesn't advance.
Seek(100) - returns false and is noop.
Seek(160) - returns true and advances the iterator to 160 or the next available timestamp.
Seek(210) - returns false and exhausts the iterator.
When it.Err is not nil return false in all cases.
Maybe putting an example like this in the iterator description would make things a bir more clear for what is expected in the different scenarios.
if t > it.maxt { | ||
// Exhaust iterator. | ||
it.i = len(it.chunks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it is just my style, but I would think it will be easier to follow with an explicit var it.exhausted = true
. Can leave as is if you prefer.
return false | ||
} | ||
return true | ||
return t <= it.maxt | ||
} | ||
if err := it.cur.Err(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err := it.cur.Err(); err != nil { | |
if it.cur.Err() != nil { |
tsdb/querier.go
Outdated
@@ -940,7 +957,7 @@ func (it *chainedSeriesIterator) Next() bool { | |||
if it.cur.Next() { | |||
return true | |||
} | |||
if err := it.cur.Err(); err != nil { | |||
if it.cur.Err() != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely forgot we can do that 🥇 nice reminder, thanks!
@@ -1053,8 +1304,9 @@ func TestChunkSeriesIterator_DoubleSeek(t *testing.T) { | |||
} | |||
|
|||
res := newChunkSeriesIterator(chkMetas, nil, 2, 8) | |||
testutil.Assert(t, res.Seek(1) == true, "") | |||
testutil.Assert(t, res.Seek(2) == true, "") | |||
testutil.Assert(t, res.Seek(1), "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we even need this test anymore as we can cover it in TestSeriesIterators
Need to get back to this soon (: |
dbe23b0
to
17c05f2
Compare
Getting back to this, expect changes soon: WIP. @brian-brazil @codesome do you know why we have two places with storage interfaces? Since we merged TSDB with Prometheus, do you think it makes sense to unify those together? |
It's historical, but we probably want to think about the impact on the remote storage code too. |
17c05f2
to
ad7d8e4
Compare
We can literally remove and deduplicate lot's of iterators.. expect big PR 😢 Should be ready for review EOW |
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. ## Changes * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of #5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
In heavy progress. |
ad7d8e4
to
ad0106b
Compare
…terface. * Added Seek to chunks.Iterator interface for iterating over chunks. * Mock, NewTestSeries, SampleSeriesIterator and ChunkSeriesIterator are now available from storage package and reuses instead of being recreated in many places. NewConcreteSeries was created to replace concreteSeries. * Added simple `verticalMergeChunkIterator` implementation - no tests so far. Reusing same vertical merging strategy in both compact and querier. * Refactored TestSeriesIterator. * Simplified; merged seek and non seek cases together. Added explicit min/max only for chunk series iterator, where it is relevant. * Adjusted all seek implementation to match edge case requirement (double seek, failed seek + next). Added more tests for old iterators; pulled Free's changes from the PR #329 Fixed series iterator tests. Signed-off-by: Bartek Plotka <bwplotka@gmail.com> Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
ad0106b
to
c530b4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is ok,
The Labeled
interface name is strange, but I also can't think of a better one
for isNext { | ||
chk := iter.At() | ||
|
||
if chk.Chunk == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this I would expect that iter.Next()
would return false and the error would be in iter.Err()
return s.(SeriesSet), w, err | ||
} | ||
func (q *querierAdapter) SelectSorted(params *SelectParams, matchers ...*labels.Matcher) (SeriesSet, Warnings, error) { | ||
s, w, err := q.SelectSorted(params, matchers...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recursion by mistake? the same below
s, w, err := q.SelectSorted(params, matchers...) | |
s, w, err := q.genericQuerier.SelectSorted(params, matchers...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, lol
// LabelValues returns all potential values for a label name. | ||
// It is not safe to use the strings beyond the lifefime of the querier. | ||
LabelValues(name string) ([]string, Warnings, error) | ||
// ChunkedQuerier provides querying access over time series' chunks of a fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not ChunksQuerier?
// ChunkedQuerier provides querying access over time series' chunks of a fixed | |
// ChunksQuerier provides querying access over time series' chunks of a fixed |
for context I would also like to see a small comment on where it can be used - in this case for remote read chunks streaming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do (:
//// It advances to the chunk with min time at t or first chunk with min time after t. | ||
//Seek(t int64) bool | ||
// At returns the current meta. | ||
// It depends on implementation if the chunk is populated or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that? Why not just return non empty chunks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you know what I mean here. Populated is if you have only Ref
or if you have actually Bytes
of chunk there (:
ChunkIteratorFn func() chunks.Iterator | ||
} | ||
|
||
func NewTestSeries(lset labels.Labels, samples ...[]tsdbutil.Sample) Series { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only for testing right? so why not put in a test package or a test file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we want to reuse this across all unit test, even those not in this package.
|
||
type genericSeriesSet interface { | ||
Next() bool | ||
At() Labeled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At() Labeled | |
At() Series |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, we need Labelled, but also because it's actually genericSeries
;p
I like |
This is part of prometheus#5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This is part of prometheus#5882 that can be done to simplify things. All todos I added will be fixed in follow up PRs. * querier.Querier, querier.Appender, querier.SeriesSet, and querier.Series interfaces merged with storage interface.go. All imports that. * querier.SeriesIterator replaced by chunkenc.Iterator * Added chunkenc.Iterator.Seek method and tests for xor implementation (?) * Since we properly handle SelectParams for Select methods I adjusted min max based on that. This should help in terms of performance for queries with functions like offset. * added Seek to deletedIterator and test. * storage/tsdb was removed as it was only a unnecessary glue with incompatible structs. No logic was changed, only different source of abstractions, so no need for benchmarks. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com> Signed-off-by: blalov <boiskila@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
…uirement for remote read to sort response. This is technically BREAKING CHANGE, but it was like this from the beginning: I just notice that we rely in Prometheus on remote read being sorted. This is because we use selected data from remote reads in MergeSeriesSet which rely on sorting. I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
…uirement for remote read to sort response. This is technically BREAKING CHANGE, but it was like this from the beginning: I just notice that we rely in Prometheus on remote read being sorted. This is because we use selected data from remote reads in MergeSeriesSet which rely on sorting. I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
…uirement for remote read to sort response. This is technically BREAKING CHANGE, but it was like this from the beginning: I just notice that we rely in Prometheus on remote read being sorted. This is because we use selected data from remote reads in MergeSeriesSet which rely on sorting. I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
…uirement for remote read to sort response. This is technically BREAKING CHANGE, but it was like this from the beginning: I just notice that we rely in Prometheus on remote read being sorted. This is because we use selected data from remote reads in MergeSeriesSet which rely on sorting. I found during work on #5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
OK, let's close this in favor of clean version of same thing: #6990 |
…uirement for remote read to sort response. This is technically BREAKING CHANGE, but it was like this from the beginning: I just notice that we rely in Prometheus on remote read being sorted. This is because we use selected data from remote reads in MergeSeriesSet which rely on sorting. I found during work on prometheus#5882 that we do so many repetitions because of this, for not good reason. I think I found a good balance between convenience and readability with just one method. Smaller the interface = better. Also I don't know what TestSelectSorted was testing, but now it's testing sorting. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Continuation from: prometheus-junkyard/tsdb#665
Changes:
Fixes: #5871