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

MONGOCRYPT-661 enable "range" by default #861

Merged
merged 12 commits into from
Jul 16, 2024
Merged

Conversation

kevinAlbs
Copy link
Contributor

Summary

This PR partially resolves MONGOCRYPT-661:

  • Enable "range" protocol by default.
  • Deprecate mongocrypt_setopt_use_range_v2 as it is no longer necessary.

Background & Motivation

Patch build: https://spruce.mongodb.com/version/66912f5f6df6a60007ec877e

As implemented, libmongocrypt does not currently support both "range" and "rangePreview" simultaneously. Instead, mongocrypt_setopt_use_range_v2 controls whether "range" is supported. Server 8.0 drops the experimental "rangePreview". Drivers are expected to drop "rangePreview" as well.

I expect removing "rangePreview" in a minor release is OK. "rangePreview" was documented as unstable in libmongocrypt and in drivers as "experimental only". For historical precedent: the unstable QEv1 protocol was updated to the incompatible QEv2 protocol in minor libmongocrypt release for DRIVERS-2435.

Documentation noting "range" as unstable is expected to be short-lived. Once remaining "range" protocol changes are completed, a subseqent PR is planned to document "range" as stable.

This PR includes updates to language bindings to fix tests and update documentation. Notably, Python's enable_range_v2 is not modified. It may be OK to deprecate or remove as it is no-longer-needed (rangeV2 is always enabled).

unconditionally set `use_range_v2` to true
Document "rangePreview" and "RangePreview" as removed. Using either results in an error.

Keep documentation of "range" as unstable. Protocol changes are in progress. "range" is expected to be stable for the upcoming 1.11.0 release.
expect error when "rangePreview" is used
expect an error when "rangePreview" is used
This check may be unnecessary. libmongocrypt validates options. However, the check is kept and updated to use "Range" to avoid changing the thrown exception.
@ShaneHarvey
Copy link
Member

This PR includes updates to language bindings to fix tests and update documentation. Notably, Python's enable_range_v2 is not modified. It may be OK to deprecate or remove as it is no-longer-needed (rangeV2 is always enabled).

I added that so existing apps that use rangePreview on MongoDB <=7.0 wouldn't break when upgrading to the latest version of pymongocrypt. If the plan is to break "rangePreview" across the board then that you can go ahead and remove the enable_range_v2 argument and property. Users will just need to pin to an older version of pymongocrypt or upgrade to "range".

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Python changes LGTM.

@vbabanin vbabanin requested a review from rozza July 16, 2024 05:08
Copy link
Member

@vbabanin vbabanin left a comment

Choose a reason for hiding this comment

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

Java changes LGTM!

Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

Java code - LGTM

@kevinAlbs kevinAlbs merged commit 239aae0 into mongodb:master Jul 16, 2024
33 of 35 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.

5 participants