-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(GraphQL): don't update cacheMb if not specified by user (GRAPHQL-888) #7103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an integration test which updates the log request and then checks the cacheMb isn't updated as a result of it? Or do we have one that we can modify?
Reviewed 1 of 1 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @MichaelJCompton)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the config query doesn't return the cacheMb set by the mutation. So, can't add the test now. Will add later when the config query is corrected.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @MichaelJCompton)
CI seems to have proto check issues, merging this PR as it doesn't impact proto files. |
…888) (#7103) Fixes GRAPHQL-888. Previously, if you ran this request: ``` $ curl -H "Content-Type: application/json" http://localhost:8080/admin -d '{"query": "mutation {config(input: {logRequest: false}){response {code message}}}"}' ``` Alpha logs would also print this: ``` I1205 22:22:51.684693 2681396 middlewares.go:178] GraphQL admin mutation. Name = config I1205 22:22:51.684724 2681396 config.go:38] Got config update through GraphQL admin API I1205 22:22:51.684810 2681396 worker.go:138] Updating cacheMb to 0 ``` Indicating that cacheMb was also updated, even it wasn't specified in the request. This PR fixes this issue. (cherry picked from commit c03c327) # Conflicts: # graphql/admin/config.go
…888) (#7103) Fixes GRAPHQL-888. Previously, if you ran this request: ``` $ curl -H "Content-Type: application/json" http://localhost:8080/admin -d '{"query": "mutation {config(input: {logRequest: false}){response {code message}}}"}' ``` Alpha logs would also print this: ``` I1205 22:22:51.684693 2681396 middlewares.go:178] GraphQL admin mutation. Name = config I1205 22:22:51.684724 2681396 config.go:38] Got config update through GraphQL admin API I1205 22:22:51.684810 2681396 worker.go:138] Updating cacheMb to 0 ``` Indicating that cacheMb was also updated, even it wasn't specified in the request. This PR fixes this issue. (cherry picked from commit c03c327) # Conflicts: # graphql/admin/config.go
* Add LogRequest variable to config input (#5197) Fixes: DGRAPH-1123 This PR adds support for logRequest config param. logRequest can have true/false values. True value of logRequest enables logging of all requests coming to alphas. False value of logRequest disables it. Users will be able to dynamically change this param using graphql admin endpoint. Sample query: mutation { config(input: {logRequest: true}){ response { code message } } } Internally we have added one more field in WorkerOptions(WorkerConfig) called as LogRequest of int32 type. Value of this field is checked atomically upon every request arrival. If value of LogRequest is 1, it results in logging of requests. Co-authored-by: Ashish Goswami <[email protected]> (cherry picked from commit 449c06b) * fix(GraphQL): don't update cacheMb if not specified by user (GRAPHQL-888) (#7103) Fixes GRAPHQL-888. Previously, if you ran this request: ``` $ curl -H "Content-Type: application/json" http://localhost:8080/admin -d '{"query": "mutation {config(input: {logRequest: false}){response {code message}}}"}' ``` Alpha logs would also print this: ``` I1205 22:22:51.684693 2681396 middlewares.go:178] GraphQL admin mutation. Name = config I1205 22:22:51.684724 2681396 config.go:38] Got config update through GraphQL admin API I1205 22:22:51.684810 2681396 worker.go:138] Updating cacheMb to 0 ``` Indicating that cacheMb was also updated, even it wasn't specified in the request. This PR fixes this issue. (cherry picked from commit c03c327) # Conflicts: # graphql/admin/config.go Co-authored-by: Animesh Chandra Pathak <[email protected]> Co-authored-by: Abhimanyu Singh Gaur <[email protected]>
…888) (#7103) (#7106) Fixes GRAPHQL-888. Previously, if you ran this request: ``` $ curl -H "Content-Type: application/json" http://localhost:8080/admin -d '{"query": "mutation {config(input: {logRequest: false}){response {code message}}}"}' ``` Alpha logs would also print this: ``` I1205 22:22:51.684693 2681396 middlewares.go:178] GraphQL admin mutation. Name = config I1205 22:22:51.684724 2681396 config.go:38] Got config update through GraphQL admin API I1205 22:22:51.684810 2681396 worker.go:138] Updating cacheMb to 0 ``` Indicating that cacheMb was also updated, even it wasn't specified in the request. This PR fixes this issue. (cherry picked from commit c03c327) # Conflicts: # graphql/admin/config.go
Fixes GRAPHQL-888.
Previously, if you ran this request:
Alpha logs would also print this:
Indicating that cacheMb was also updated, even it wasn't specified in the request.
This PR fixes this issue.
This change is