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

query: distributed engine - allow querying overlapping intervals #7985

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

abelsimonn
Copy link

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

When distributed query mode is enabled, we query endpoints based on the highest MinT they share. If you mix endpoints, e.g storage gateways and receivers and your SGW has a lower MinT than your receivers, only shared intervals will be returned.

image

This introduces a hidden flag query.distributed-with-overlapping-interval that joins them into the largest overlap instead of shared intervals.

Provides a temporary fix for: #7757

Verification

The change is behind a feature flag and is disabled by default. There is also a test reproducing failure scenario.

@@ -340,7 +340,11 @@ test-e2e: docker-e2e $(GOTESPLIT)
# NOTE(GiedriusS):
# * If you want to limit CPU time available in e2e tests then pass E2E_DOCKER_CPUS environment variable. For example, E2E_DOCKER_CPUS=0.05 limits CPU time available
# to spawned Docker containers to 0.05 cores.
@$(GOTESPLIT) -total ${GH_PARALLEL} -index ${GH_INDEX} ./test/e2e/... -- ${GOTEST_OPTS}
@if [ -n "$(SINGLE_E2E_TEST)" ]; then \
$(GOTESPLIT) -total ${GH_PARALLEL} -index ${GH_INDEX} ./test/e2e -- -run $(SINGLE_E2E_TEST) ${GOTEST_OPTS}; \
Copy link
Contributor

Choose a reason for hiding this comment

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

is make really needed for that? i just run them with "go test"

Copy link
Author

Choose a reason for hiding this comment

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

not necessarily. Though I had all sorts of issues with my go-env, this was the fastest solution that worked.

I left it in because it could help others new to go as well.

I can ofc remove if you think I'm an outlier:)

@@ -2376,93 +2376,3 @@ func TestDistributedEngineWithExtendedFunctions(t *testing.T) {
}, time.Now, promclient.QueryOptions{}, 1)
testutil.Equals(t, model.SampleValue(0), result[0].Value)
}

func TestDistributedEngineWithDisjointTSDBs(t *testing.T) {
t.Skip("skipping test as this replicates a bug")
Copy link
Contributor

Choose a reason for hiding this comment

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

This got converted to a passing test right? Perhaps we could have one case where the test passes and another where it fails?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it got converted.

Perhaps we could have one case where the test passes and another where it fails?

Sure, let me do that

Copy link
Author

Choose a reason for hiding this comment

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

@fpetkovski added a failing test, which is flaky.

Happy flow with flag enabled is successful in ~10 seconds.

Unhappy flow with the disabled flag can be successful in around 40~ seconds. I haven't validated it yet, but I suspect its because an endpoint is not taken into account and we don't converge on high MinT

Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

Thanks, I think this is fine for now since it is a hidden flag. It would be great to keep iterating and remove the need to have the flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants