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

experimental support for query batching #3837

Merged
merged 84 commits into from
Sep 27, 2023
Merged

Conversation

garypen
Copy link
Contributor

@garypen garypen commented Sep 15, 2023

Things needing attention

  • Configuration to match the design
  • Decide if cloning parts is acceptable (in review) It isn't, so not cloned but re-built.
  • Decide if cloning context for each SupergraphRequest is acceptable (in review)
  • Should we do special handling if @defer or subscription detected in batch?
  • Metrics
  • Find someone happy to test from an appropriately configured Apollo Client and verify it works
  • Modify Apollo telemetry to create separate root traces for each batch entry

Fixes #126


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Manual testing was performed with curl and apollo client

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

lacks a lot of polish, but does run the happy path correctly. Things
needing deeper consideration:
 - configuration
 - cloning parts
 - error handling
 - array processing
@garypen garypen requested a review from a team September 15, 2023 15:07
@garypen garypen self-assigned this Sep 15, 2023
@github-actions

This comment has been minimized.

@router-perf
Copy link

router-perf bot commented Sep 15, 2023

CI performance tests

  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • large-request - Stress test with a 1 MB request payload
  • step - Basic stress test that steps up the number of users over time
  • xlarge-request - Stress test with 10 MB request payload
  • reload - Reload test over a long period of time at a constant rate of users
  • no-graphos - Basic stress test, no GraphOS.
  • xxlarge-request - Stress test with 100 MB request payload
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • const - Basic stress test that runs with a constant number of users

@garypen garypen requested a review from Geal September 15, 2023 15:10
Not returning the correct errors (as per design doc) when batching not
enabled, but basically working.
also:
 - add code to make extension_code configurable from translate_request

cargo fmt has given up on this file, so the next change will be a
re-factoring to try and tidy up the source code.
also: break up some of the mega-functions into smaller functions. Not
strictly part of this issue, but it needed to be done.
It's pretty rough, so will need some good reviewing from docs to bring
to life.
@garypen garypen changed the title query batching prototype experimental support for query batching Sep 19, 2023
@BrynCooke
Copy link
Contributor

There are a couple of things that need to be verified:

  1. What to traces look like in studio?
  2. Are we OK with the metrics being generated and sent to Apollo e.g. op counts?

garypen and others added 16 commits September 26, 2023 12:46
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
Co-authored-by: Maria Elisabeth Schreiber <maria.schreiber@apollographql.com>
shorgi and others added 2 commits September 26, 2023 09:06
It's really hard to test report generation for metrics. Traces at least
are aggregated within a span, so no special handling is required. The
existing metrics tests only send in 1 request, so they work by accident.

The batch metric test generates two requests (batch of 2) and so this
makes the existing testing mechanisms very sad. I've decided on a
compromise for batch testing. Just check that the number of requests
sums to 2 across all of the metrics reports which are generated.

Not ideal, but something we could try to improve in the future.
@garypen garypen merged commit aeb5ffe into dev Sep 27, 2023
11 of 12 checks passed
@garypen garypen deleted the garypen/126-query-batching branch September 27, 2023 12:31
@Geal Geal mentioned this pull request Oct 4, 2023
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.

query batching
7 participants