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

Upgrade to MongoDB 5.0 #39989

Conversation

christophstrobl
Copy link
Member

The MongoDB 5.0 Java Driver ships with previously deprecated API now removed (mongodb/mongo-java-driver#1268). To allow users to downgrade if needed, calls to those parts of the driver need to be done reflectively.

Related to: spring-projects/spring-data-mongodb#4663

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 18, 2024
@wilkinsona
Copy link
Member

Thanks, @christophstrobl. Do you anticipate a strong need to downgrade to the 4.x driver? If at all possible, we'd prefer not to support two different major versions at the same time.

@christophstrobl
Copy link
Member Author

There's a few more places with removed API around indexing options, etc. and as far as I know the 5.0 release is one of the more aggressive ones in terms of breaking changes done by the MongoDB team so far. For data we intend to support both 5.0 and 4.11 for the 2024.0 train and remove backwards compatibility with 2024.1.

@christophstrobl
Copy link
Member Author

Given the change in boot is quite limited I guess it would also work to just upgrade and remove the code path for the StreamFactoryFactory. People would still be able to downgrade using TransportSettings which is the preferred one anyways.

@wilkinsona
Copy link
Member

wilkinsona commented Mar 18, 2024

That sounds good to me. We can always restore Mongo Driver 4.x compatibility if we get enough feedback in that direction.

@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 20, 2024
@wilkinsona wilkinsona added this to the 3.3.x milestone Mar 20, 2024
@wilkinsona
Copy link
Member

To be merged after M3 and once we're back on Data snapshots again.

@wilkinsona wilkinsona added the status: on-hold We can't start working on this issue yet label Mar 20, 2024
Adapt code to no longer available MongoClientSettings#getStreamFactoryFactory method.
@mauhiz
Copy link

mauhiz commented Apr 2, 2024

MongoDB driver v5 adds a coroutine-based driver ( https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/ )
Would it make sense to select this one over the reactivestreams based one when the corresponding libraries (kotlinx.coroutine?) are available?

@christophstrobl
Copy link
Member Author

@mauhiz IIRC the com.mongodb.kotlin.client.coroutine.MongoClient is a wrapper around the com.mongodb.reactivestreams.client.MongoClient.
For data-mongodb the Kotlin variants cannot be used directly along with the DatabaseFactory implementations. There's an open PR#4402 in the data project for that, but it would require to access mongodb driver internals reflectively.

@wilkinsona wilkinsona added type: dependency-upgrade A dependency upgrade and removed status: on-hold We can't start working on this issue yet type: enhancement A general enhancement labels Apr 9, 2024
@wilkinsona wilkinsona changed the title Upgrade to MongoDB Java Driver 5.0 Upgrade to MongoDB 5.0 Apr 9, 2024
@wilkinsona wilkinsona modified the milestones: 3.3.x, 3.3.0-RC1 Apr 9, 2024
wilkinsona pushed a commit that referenced this pull request Apr 9, 2024
wilkinsona added a commit that referenced this pull request Apr 9, 2024
@wilkinsona wilkinsona closed this in ab0a7c9 Apr 9, 2024
@wilkinsona
Copy link
Member

Superseded by #40259.

@wilkinsona wilkinsona added type: task A general task status: superseded An issue that has been superseded by another and removed type: dependency-upgrade A dependency upgrade labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants