Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Fix backwards compatibility with block version 1 #802

Merged

Conversation

simonswine
Copy link
Collaborator

@simonswine simonswine commented Jun 27, 2023

#767 broke compatibility with version 1 blocks, this fixes the two issues and also adds sample blocks and tests to ensure compatibility.

This also adds a Test for block version compatibility.
@simonswine simonswine marked this pull request as ready for review June 27, 2023 15:36
@cyriltovena
Copy link
Collaborator

Did you figure why it broke ?

joinIters []query.Iterator
)

if b.meta.Version >= 2 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I want to include total sample in v2 WDYT ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really throw around with versions and make that version+1, also the sorted should be a version+1

Copy link
Collaborator

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +87 to +88
case uint32:
return int64(i)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem #2, panic with uint32s

)

if b.meta.Version >= 2 {
joinIters = []query.Iterator{
b.profiles.columnIter(ctx, "SeriesIndex", newMapPredicate(lblsPerRef), "SeriesIndex"),
b.profiles.columnIter(ctx, "TimeNanos", query.NewIntBetweenPredicate(model.Time(params.Start).UnixNano(), model.Time(params.End).UnixNano()), "TimeNanos"),
b.profiles.columnIter(ctx, "StacktracePartition", nil, "StacktracePartition"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem #1: This requires the column to be there, maybe should have a orNull predicate or something.

@simonswine simonswine merged commit ab467dc into grafana:main Jun 28, 2023
17 checks passed
simonswine added a commit to simonswine/pyroscope that referenced this pull request Jun 30, 2023
This also adds a Test for block version compatibility.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants