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

feat: Add support for MongoDB databaseOptions keys minPoolSize, connectTimeoutMS, socketTimeoutMS, autoSelectFamily, autoSelectFamilyAttemptTimeout #9577

Open
wants to merge 2 commits into
base: release-7.x.x
Choose a base branch
from

Conversation

pocketcolin
Copy link
Contributor

Pull Request

Issue

NOTE: This is a clone of #9522 so that the update can go out in 7.x.x in addition to 8.

9523

Closes: 9523

Approach

As discussed in #9211, the decision was made to maintain a list of valid database options for the Parse config that can be passed to MongoDB. There are many options (46 in total) and this PR adds 3 more that I was using. This approach just follows the same approach used in #9213

Tasks

  • Add tests

Copy link

Thanks for opening this pull request!

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.50%. Comparing base (74dfc4e) to head (404e218).

Additional details and impacted files
@@              Coverage Diff               @@
##           release-7.x.x    #9577   +/-   ##
==============================================
  Coverage          93.50%   93.50%           
==============================================
  Files                186      186           
  Lines              14804    14804           
==============================================
  Hits               13842    13842           
  Misses               962      962           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pocketcolin pocketcolin changed the title feat: Add support for MongoDB databaseOptions keys minPoolSize, connectTimeoutMS, socketTimeoutMS feat: Add support for MongoDB databaseOptions keys minPoolSize, connectTimeoutMS, socketTimeoutMS, autoSelectFamily, autoSelectFamilyAttemptTimeout Jan 29, 2025
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

It seems that this PR is not a clone of the Parse Server 8 PR, as there are more options in this PR, is that correct, and if yes, why?

@pocketcolin
Copy link
Contributor Author

pocketcolin commented Jan 29, 2025

@mtrezza because since the Parse Server 8 PR, I found 2 more Mongo settings that are important. Ideally, I think 8 wouldn't validate databaseOptions because there are just too many to maintain, but I'm happy to go back and create another PR for 8 that adds the 2 new ones.

These 2 new fields are really interesting and will help people migrate to Parse 7 as well. The tldr; is that the Node Mongo driver package released a breaking change in a minor release (v6.9) that switched the autoSelectFamily default value to true while it was previously false. Parse 7 updated the Mongo version from 4 to 6.12 so people upgrading to Parse 7 are going to be impacted by this change and without the databaseOption they'll be stuck with a new configuration.

There's a discussion about this here: https://www.mongodb.com/community/forums/t/i-keep-getting-error-when-i-try-connecting-node-to-mongodb/243422/22?page=2

@mtrezza
Copy link
Member

mtrezza commented Jan 29, 2025

It would be great if you could add another PR for Parse Server 8 before we can merge this. The reason is that we aim to back-port identical code, to mitigate divergence in the branches, which would make them more difficult to maintain.

@pocketcolin
Copy link
Contributor Author

Here you are: https://github.com/parse-community/parse-server/pull/9579/files

@mtrezza
Copy link
Member

mtrezza commented Jan 30, 2025

Looks good!

@mtrezza
Copy link
Member

mtrezza commented Jan 30, 2025

We'll merge this after Parse Server 8 release, so that it triggers a new Parse Server 7 release.

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.

2 participants