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(NODE-4877): Add support for useBigInt64 #3519

Merged
merged 33 commits into from Feb 23, 2023

Conversation

W-A-James
Copy link
Contributor

@W-A-James W-A-James commented Jan 11, 2023

Description

Add support for BSON's useBigInt64 flag to the driver

What is changing?

  • useBigInt64 flag is now a part of the BSONSerializationOptions interface
  • useBigInt64 flag is now therefore part of all implementers of this interface
Is there new documentation needed for these changes?

No

What is the motivation for this change?

  • Integrating the BigInt64 support in the BSON library into the driver

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket
    • NODE-5072 Change pattern for setting BSON options
    • NODE-5073 Remove unused applyCommonQueryOptions function

@W-A-James W-A-James force-pushed the NODE-4877/add-support-for-BSON-useBigInt64-flag branch from 7f8f32d to 0125330 Compare January 17, 2023 19:32
@W-A-James
Copy link
Contributor Author

Link to evergreen patch with useBigInt64=true by default to
see what, if anything, breaks. https://spruce.mongodb.com/version/63c7199232f4171734d3a529/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

@nbbeeken
Copy link
Contributor

I think the option isn't actually making it to the BSON layer, we "sanitize" the options at the wire protocol layer to make sure that arbitrary options don't reach the bson deserializer, take a look at #2840

@W-A-James W-A-James marked this pull request as ready for review January 24, 2023 21:10
@dariakp dariakp added the Blocked Blocked on other work label Jan 24, 2023
@W-A-James W-A-James added Blocked Blocked on other work and removed Blocked Blocked on other work labels Jan 24, 2023
@dariakp
Copy link
Contributor

dariakp commented Jan 24, 2023

This PR cannot merge until we do the 5.0 release.

@nbbeeken
Copy link
Contributor

nbbeeken commented Jan 24, 2023

Can you post an updated link to an evg patch where useBigInt64 is set to true anywhere we call BSON.deserialize in the driver (should be four places in commands.ts). We want to see if the errors from that are salient to what can occur when the option is enabled

some errors might just be assertions no longer being equal, that would be expected

@W-A-James
Copy link
Contributor Author

@nbbeeken
Copy link
Contributor

Lot's of red, unfortunately enough to make it so we can't see the output, atlas connectivity failing though might be a good place to start as that "shouldn't" have been impacted at all.

// TODO(NODE-2674): Preserve int64 sent from MongoDB

You'll want to look for this comment, likely every spot needs an extra condition to accept bigint

@W-A-James W-A-James marked this pull request as draft January 25, 2023 21:41
@W-A-James W-A-James force-pushed the NODE-4877/add-support-for-BSON-useBigInt64-flag branch from d330f3f to d54383d Compare February 8, 2023 20:42
@W-A-James

This comment was marked as outdated.

@W-A-James W-A-James marked this pull request as ready for review February 8, 2023 21:00
@nbbeeken nbbeeken removed the Blocked Blocked on other work label Feb 8, 2023
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Feb 10, 2023
src/sdam/monitor.ts Outdated Show resolved Hide resolved
src/sdam/server_description.ts Outdated Show resolved Hide resolved
src/sessions.ts Outdated Show resolved Hide resolved
test: function (done) {
var configuration = this.configuration;
var client = configuration.newClient(configuration.writeConcernMax(), {
test: async function () {
Copy link
Member

Choose a reason for hiding this comment

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

Note for other reviewers these tests are unrelated to the work in the PR and are just changing from callbacks to async/await.

test/integration/crud/insert.test.js Outdated Show resolved Hide resolved
@W-A-James W-A-James added the Blocked Blocked on other work label Feb 13, 2023
@durran durran removed the Blocked Blocked on other work label Feb 16, 2023
src/connection_string.ts Outdated Show resolved Hide resolved
src/connection_string.ts Outdated Show resolved Hide resolved
nbbeeken
nbbeeken previously approved these changes Feb 21, 2023
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 can't wait to use the biggest of ints!! 🎉

src/connection_string.ts Outdated Show resolved Hide resolved
test/integration/change-streams/change_stream.test.ts Outdated Show resolved Hide resolved
src/cursor/abstract_cursor.ts Show resolved Hide resolved
@@ -0,0 +1,234 @@
import { expect } from 'chai';
Copy link
Contributor

Choose a reason for hiding this comment

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

this file should use snake case (use_bigint_64.test.ts) or something similar to follow our existing filenaming convention.

test/tools/unified-spec-runner/match.ts Show resolved Hide resolved
@durran durran merged commit 917668c into main Feb 23, 2023
@durran durran deleted the NODE-4877/add-support-for-BSON-useBigInt64-flag branch February 23, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
5 participants