Select appropriate time spine node for metric_time
queries without metrics
#1407
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.
There are very few cases where multiple source nodes can satisfy the same linkable spec, but one instance in which that is the case is when
metric_time
is queried without metrics. In that case, we will use a time spine node to satisfymetric_time
. Previously, we were choosing the time spine nodes that could support the selected grain, and then narrowing down to the one with the fewest satisfiable linkable specs. This logic was working because, before custom granularities, the time spine with the fewest satisfiable linkable specs was always the time spine with the largest compatible base granularity. With the addition of custom granularities, though, the time spine with the largest compatible base granularity might have any number of satisfiable linkable specs. This changes updates the source node selection logic to choose the time spine with the largest compatible base granularity, regardless of the number of satisfiable linkable specs.