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

Drop experimental reuse fragments optimization from RS QP #6354

Merged
merged 18 commits into from
Dec 5, 2024

Conversation

dariuszkuc
Copy link
Member

@dariuszkuc dariuszkuc commented Nov 27, 2024

Drop support for the experimental reuse fragment query optimization from Rust QP. This implementation was not only very slow but also very buggy due to its complexity. experimental_reuse_query_fragments option can be applied for the JS QP only.

Auto generation of fragments is a much simpler (and faster) algorithm that in most cases produces better results. Fragment auto generation is the default optimization since v1.58 release.


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

Note any exceptions here

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.

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Nov 27, 2024

✅ Docs Preview Ready

No new or changed pages found.

@router-perf
Copy link

router-perf bot commented Nov 27, 2024

CI performance tests

  • connectors-const - Connectors stress test that runs with a constant number of users
  • const - Basic stress test that runs with a constant number of users
  • demand-control-instrumented - A copy of the step test, but with demand control monitoring and metrics enabled
  • demand-control-uninstrumented - A copy of the step test, but with demand control monitoring enabled
  • enhanced-signature - Enhanced signature enabled
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • 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_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
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • extended-reference-mode - Extended reference mode enabled
  • large-request - Stress test with a 1 MB request payload
  • no-tracing - Basic stress test, no tracing
  • reload - Reload test over a long period of time at a constant rate of users
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • step-local-metrics - Field stats that are generated from the router rather than FTV1
  • step-with-prometheus - A copy of the step test with the Prometheus metrics exporter enabled
  • step - Basic stress test that steps up the number of users over time
  • xlarge-request - Stress test with 10 MB request payload
  • xxlarge-request - Stress test with 100 MB request payload

@dariuszkuc
Copy link
Member Author

@goto-bus-stop
Copy link
Member

We should also make sure that people aren't opting back into the old algorithm en masse in 1.58.0. But this is a very exciting diff 😁

Copy link
Member

@lrlna lrlna left a comment

Choose a reason for hiding this comment

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

This PR also needs to update docs for fragment generation and reuse.

Otherwise really exciting to get rid of all the dead code!!

@lrlna lrlna changed the title [federation] drop experimental reuse fragments optimization Drop experimental reuse fragments optimization Dec 2, 2024
@dariuszkuc dariuszkuc changed the title Drop experimental reuse fragments optimization [federation] Drop experimental reuse fragments optimization Dec 2, 2024
@dariuszkuc dariuszkuc force-pushed the dk/drop_reuse_fragments branch from 410e6fe to cab4987 Compare December 2, 2024 20:38
@dariuszkuc dariuszkuc changed the title [federation] Drop experimental reuse fragments optimization [federation] drop experimental reuse fragments optimization from RS QP Dec 2, 2024
@dariuszkuc dariuszkuc changed the title [federation] drop experimental reuse fragments optimization from RS QP Drop experimental reuse fragments optimization from RS QP Dec 2, 2024
@dariuszkuc dariuszkuc force-pushed the dk/drop_reuse_fragments branch from 5e7a2a3 to 946998e Compare December 4, 2024 15:56
Copy link
Member

@lrlna lrlna left a comment

Choose a reason for hiding this comment

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

I am so sorry, I read a tracing::warn message you wrote and realised this is going to need a config migration. For the time being it can be a log, and for the next release we can do a delete.

docs/source/reference/router/configuration.mdx Outdated Show resolved Hide resolved
apollo-router/src/configuration/mod.rs Outdated Show resolved Hide resolved
Comment on lines 419 to 426
if self
.supergraph
.reuse_query_fragments
.is_some_and(|flag| flag)
{
// warn the user that reuse query fragments is unsupported for RS QP
tracing::warn!("'experimental_reuse_query_fragments' is not supported by the Rust QP and this configuration option will be removed in the next release. Use 'generate_query_fragments' instead.");
}
Copy link
Member

Choose a reason for hiding this comment

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

Hm, we are going to need a migration for this config going away, I just realised. At this point it can be a log rather than a delete, but it should go through our regular "migration" process rather than adhoc, I think.

dariuszkuc and others added 2 commits December 4, 2024 11:09
Co-authored-by: Iryna Shestak <shestak.irina@gmail.com>
Copy link
Member

@lrlna lrlna left a comment

Choose a reason for hiding this comment

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

Thank you!

@lrlna lrlna merged commit ce37c70 into dev Dec 5, 2024
13 checks passed
@lrlna lrlna deleted the dk/drop_reuse_fragments branch December 5, 2024 10:43
This was referenced Dec 16, 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.

4 participants