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

Eagerly initialize SubgraphOperation::parsed field #5088

Merged
merged 2 commits into from
May 23, 2024

Conversation

SimonSapin
Copy link
Contributor

@SimonSapin SimonSapin commented May 6, 2024

Follow-up to #5075.

As a result, SubgraphOperation::as_parsed() no longer requires passing the subgraph schema as a parameter. However, because schemas are not available from inside Deserialize impls, an Option is still used to create SubgraphOperation without a parsed schema at first. as_parsed() may still return an error if the new init_parsed() method was never called, which would indicate a Router bug: init_parsed() is called immediately after query planning and after getting a Redis cache hit.

In the call today we discussed another design with separate query plan types: with and without pared subgraph operations. This would statically prevent failure to initialize, but would require a much larger refactor. For example, the generic dual-storage cache that would need to be modified to have a different cached value type for in-memory cache v.s. external Redis cache.

As a result, `SubgraphOperation::as_parsed()` no longer requires passing
the subgrph schema as a parameter. It may still return an error if
`init_parsed` was never called, which would indicate a Router bug.
Copy link
Contributor

github-actions bot commented May 6, 2024

@SimonSapin, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@router-perf
Copy link

router-perf bot commented May 6, 2024

CI performance tests

  • step - Basic stress test that steps up the number of users over time
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • large-request - Stress test with a 1 MB request payload
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • xxlarge-request - Stress test with 100 MB request payload
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • xlarge-request - Stress test with 10 MB request payload
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • no-graphos - Basic stress test, no GraphOS.
  • reload - Reload test over a long period of time at a constant rate of users
  • 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_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • const - Basic stress test that runs with a constant number of users

@SimonSapin SimonSapin merged commit b503aae into dev May 23, 2024
13 of 14 checks passed
@SimonSapin SimonSapin deleted the simon/parsed-subgraph-operation-explicit-init branch May 23, 2024 15:23
SimonSapin added a commit that referenced this pull request May 23, 2024
PR #5088 changed the signature of a method.
It had a green CI run and git succedded at squashing/rebasing it,
but the target `dev` branch gained a new call to that method in the mean time
so the resulting merge has a compile error.

This would have been prevented if we ran CI on exactly what was about to
be pushed to `dev`, instead of only on PR branch.
The Rust project calls this [the "not rocket science" rule
of software engineering](https://graydon.livejournal.com/186550.html).
SimonSapin added a commit that referenced this pull request May 23, 2024
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.

None yet

2 participants