Skip to content

DRIVERS-3082 add prose tests for $lookup #1757

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

Merged
merged 15 commits into from
Feb 26, 2025
Merged

Conversation

kevinAlbs
Copy link
Contributor

@kevinAlbs kevinAlbs commented Feb 18, 2025

Summary

Add prose test for $lookup support in QE/CSFLE.

Tests were run in the C driver in this patch. Note: latest tasks were updated to use latest-build to use unreleased 8.1 builds (see slack for background).

Testing requires a unreleased version of libmongocrypt to include changes from MONGOCRYPT-723. Binaries are available on this patch build or by building from source at mongodb/libmongocrypt@33fdf65.

The failed Markdown Link Check on the GitHub action appears unrelated (and is failing on master).

libmongocrypt protocol change

libmongocrypt's protocol previously assumed auto encrypting a command only required at most one schema. With $lookup there can be multiple schemas on an aggregate command. As a result, a small driver change is needed: feed all listCollections results to libmongocrypt in the MONGOCRYPT_CTX_NEED_MONGO_COLLINFO(_WITH_DB) states. The previous protocol only required returning the first. Call mongocrypt_setopt_enable_multiple_collinfo to indicate the new behavior is implemented (otherwise libmongocrypt returns an error if a command requires multiple schemas).

The libmongocrypt documentation includes a change to the protocol in integrating.md.

See the small protocol change implemented in the C driver here.

Please complete the following before merging:

  • [ ] Update changelog. Test changes only
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).

@kevinAlbs kevinAlbs marked this pull request as ready for review February 18, 2025 13:48
@kevinAlbs kevinAlbs requested a review from a team as a code owner February 18, 2025 13:48
@kevinAlbs kevinAlbs requested review from katcharov and mdb-ad and removed request for a team February 18, 2025 13:48
Appears to error in `mkdocs`. Link is not very useful regardless.
@kevinAlbs kevinAlbs requested a review from nbbeeken February 20, 2025 16:45
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM, passing in node, fairly straightforward implementation

Copy link
Contributor

@katcharov katcharov left a comment

Choose a reason for hiding this comment

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

Some minor comments

@kevinAlbs kevinAlbs requested a review from katcharov February 24, 2025 20:18
Testing with crypt_shared/mongocryptd 8.1+ and pre-8.1 server results in
not matching QE fields in sub-pipelines. This is a known server limitation.
kevinAlbs and others added 2 commits February 25, 2025 12:49
@kevinAlbs kevinAlbs requested a review from katcharov February 25, 2025 17:53
Copy link
Contributor

@katcharov katcharov left a comment

Choose a reason for hiding this comment

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

LGTM, though note above comment.

All relevant tests are now passing in the Java implementation mongodb/mongo-java-driver#1638

@kevinAlbs kevinAlbs removed the request for review from mdb-ad February 26, 2025 19:55
@kevinAlbs kevinAlbs merged commit 527e22d into mongodb:master Feb 26, 2025
3 of 4 checks passed
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