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

Paginate redis scan pages properly and don't use Notify anymore for entity caching #5925

Merged
merged 6 commits into from
Sep 3, 2024

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented Aug 30, 2024

Calling https://docs.rs/fred/latest/fred/types/trait.Scanner.html#tymethod.next everytime.


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.

bnjjj added 3 commits August 28, 2024 11:30
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj requested review from a team as code owners August 30, 2024 08:29
Copy link
Contributor

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

let (handle, _b) = notify.create_or_subscribe(InvalidationTopic, false).await?;

let h = handle.clone();
let (tx, rx) = tokio::sync::mpsc::channel(128);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 128?

I think this now acts as an informal concurrency limit on the number of in-flight invalidation requests. That's probably desirable, but we should think carefully about the exact number we want and maybe also consider documenting it.

We should make it a global const and use the const in the tests and give it a really good name that explains what it's doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just wanted to keep the same configuration than in Notify https://github.com/apollographql/router/blob/bnjjj/fix_redis_scan/apollo-router/src/notification.rs#L33:L33 the previous impl we used. But I think it should be 1024 that's the other const I have to take. I'll create a new const for this

bnjjj and others added 3 commits August 30, 2024 12:42
@bnjjj bnjjj merged commit 85bda8f into dev Sep 3, 2024
13 of 14 checks passed
@bnjjj bnjjj deleted the bnjjj/fix_redis_scan branch September 3, 2024 13:54
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.

3 participants