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

qe: fix mongo logging for updateMany #3321

Merged
merged 4 commits into from Oct 25, 2022
Merged

qe: fix mongo logging for updateMany #3321

merged 4 commits into from Oct 25, 2022

Conversation

miguelff
Copy link
Collaborator

Fixes prisma/prisma#15467

The patch includes a regression test reproducing the exact user concern and a following comment fixing the code.

cc @prisma/client-team-rust

@miguelff miguelff added this to the 4.6.0 milestone Oct 24, 2022
@miguelff miguelff self-assigned this Oct 24, 2022
@miguelff
Copy link
Collaborator Author

miguelff commented Oct 24, 2022

Looking into why buildkite reports a failure. The test keeps passing locally with mongo 4.4, and 4.2. Apparently, logs are not being received in the test. I will keep digging.

[2022-10-24T14:12:16Z] ---- new::regressions::prisma_15467::mongodb::update_many_log_output stdout ----
--
  | [2022-10-24T14:12:16Z] [query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_15467.rs:33] object_id = String("63569baceea9a971bba41958")
  | [2022-10-24T14:12:16Z] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_15467.rs:49:41

And the code in that offending line: https://github.com/prisma/prisma-engines/pull/3321/files#diff-09e5f77622188cb35ae340b9facc20b10a4cd9e707a7aa9a1d13d3d5fdde7fdeR49

@miguelff miguelff marked this pull request as draft October 24, 2022 15:21
@miguelff miguelff changed the title qe: fix mongo logging for updateMany WIP: qe: fix mongo logging for updateMany Oct 24, 2022
@miguelff miguelff marked this pull request as ready for review October 24, 2022 18:41
@miguelff miguelff changed the title WIP: qe: fix mongo logging for updateMany qe: fix mongo logging for updateMany Oct 24, 2022
@miguelff miguelff requested review from Weakky and garrensmith and removed request for Weakky October 24, 2022 18:42
Copy link
Contributor

@garrensmith garrensmith left a comment

Choose a reason for hiding this comment

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

Nice work. Good fix and a nice test to go with it.

@@ -53,7 +53,7 @@ fn create_env_filter(log_queries: bool, qe_log_level: &str) -> EnvFilter {
.add_directive(format!("query_core={}", &qe_log_level).parse().unwrap())
.add_directive(format!("query_connector={}", &qe_log_level).parse().unwrap())
.add_directive(format!("sql_query_connector={}", &qe_log_level).parse().unwrap())
.add_directive(format!("mongodb_query_connector={}", &qe_log_level).parse().unwrap());
.add_directive("mongodb_query_connector=debug".parse().unwrap());
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch

@miguelff miguelff merged commit 83b2037 into main Oct 25, 2022
@miguelff miguelff deleted the miguelff/mongo-logs branch October 25, 2022 08:06
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.

[MongoDb] Query logger produces incorrect output
2 participants