Skip to content
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

fix: backport improvements to ReadTags pushdowns from 2.x #23302

Closed
wants to merge 3 commits into from

Conversation

serenibyss
Copy link

@serenibyss serenibyss commented Apr 26, 2022

Continuation of #21160, which was a backport of #19856 and #19894.

The backport of #19856 updates the tagKeys and tagValues methods of the Store interface to return the answers that Flux is used to, by properly filtering on _field when such a predicate is present. These methods are frequently used by the UI query builder to describe the shape of the users data. This primarily fixed #19794 for 2.x, which contains good examples of the issue, but also fixed #19806, a related issue

The backport of #19894 returns nil instead of an empty iterator, and callers expect a non-nil result set for any non-error return, which fixed influxdata/flux#3300 for 2.x

This work was originally shelved due to complications regarding Enterprise compatibility. As it stands now, this work is identical to where #21160 was left off, though I expect that this will have to be adjusted significantly to make work for what we need. Some aspects of the wire-format has changed, so we may want to undo those portions of it, or be prepared to handle it carefully

@serenibyss serenibyss marked this pull request as ready for review April 26, 2022 18:14
Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

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

I do not have enough expertise or context to adequately review this.

return true
}
return false
return y == nil
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this refactor...

@@ -311,6 +355,16 @@ func (s *Store) TagKeys(ctx context.Context, req *datatypes.TagKeysRequest) (cur
if found := reads.HasFieldValueKey(expr); found {
return nil, errors.New("field values unsupported")
}
if found := reads.ExprHasKey(expr, fieldKey); found {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be extremely expensive to compute, right? Previously we could always consult the series index for this call, but now we have to go to TSM for every series key/field key combination to find out if data exists for that key.

Do we expect the UI features that require this to be usable for large databases?

@jeffreyssmith2nd jeffreyssmith2nd force-pushed the ds-flux-tag-values-backport branch from ac720bb to dcd88d6 Compare December 12, 2022 15:50
@davidby-influx
Copy link
Contributor

@jeffreyssmith2nd - what's the status on this one?

@jeffreyssmith2nd
Copy link
Contributor

This passes all the existing tests. It was, however, not the solution to the problem that we originally thought it was. Given its potential to impact performance, I am uncertain of if we want to merge it without a good use requiring it.

@davidby-influx
Copy link
Contributor

Closing this PR per comments above

@jacobmarble jacobmarble deleted the ds-flux-tag-values-backport branch January 2, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flux schema.tagValues gives incorrect result with multicondition predicate
5 participants