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

Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead. #64

Closed
aljones15 opened this issue Feb 5, 2021 · 7 comments
Assignees

Comments

@aljones15
Copy link
Contributor

aljones15 commented Feb 5, 2021

This a non-fatal error that occurred in a project using this library.
We need to look into why these are options are being passed in provided this is definitely a mongodb error.

Error occurred on a mac powerbook and platform could be a factor.

Mongodb docs for write options

fsync
writeConcern (includes w, j, & wtimeout

this came in with node native mongodb 3.6.4
* Deprecate top-level write concern option keys (#2624) ([0516d93](mongodb/node-mongodb-native@0516d93f74de4b58a99 e8455e59678d4b09cd4a7))

@aljones15 aljones15 self-assigned this Feb 5, 2021
@aljones15
Copy link
Contributor Author

aljones15 commented Feb 8, 2021

if anyone needs to replicate this, just running this test suite generates the warning:

Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.

over and over again.

EDIT: the test project of this library itself also produces this error.

@mattcollier
Copy link
Contributor

@aljones15 thanks for writing this up. I just saw this for the first time myself on that bedrock-edv-storage test suite you referenced. This would mean it's not platform specific.

@aljones15
Copy link
Contributor Author

@aljones15 thanks for writing this up. I just saw this for the first time myself on that bedrock-edv-storage test suite you referenced. This would mean it's not platform specific.

can you specify the platform and perhaps mongodb server version? I've only seen it on mac.

@mattcollier
Copy link
Contributor

@aljones15
Copy link
Contributor Author

@aljones15
Copy link
Contributor Author

as of mongodb 3.6.4 many of the node driver's write operations have defaults that do not use writeConcern. The following is from mongodb's own test suite (not ours):

  Write Concern
     should respect writeConcern from uri (85ms)
    spec tests
      default-write-concern-2.6 - replicaset,sharded,single
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         DeleteOne omits default write concern
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         DeleteMany omits default write concern
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         BulkWrite with all models omits default write concern (48ms)
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         InsertOne and InsertMany omit default write concern
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         UpdateOne, UpdateMany, and ReplaceOne omit default write concern (40ms)
      default-write-concern-3.2 - replicaset,sharded,single
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         findAndModify operations omit default write concern (63ms)
      default-write-concern-3.4 - replicaset,sharded,single
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         Aggregate with $out omits default write concern (65ms)
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         RunCommand with a write command omits default write concern (runCommand should never inherit write concern) (40ms)
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         CreateIndex and dropIndex omits default write concern (80ms)
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         MapReduce omits default write concern (98ms)
      default-write-concern-4.2 - replicaset,sharded,single
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
         Aggregate with $merge omits default write concern (51ms)
    test journal connection string option
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
       should set write concern with j: true client option (46ms)
       should set write concern with journal=true connection string option (52ms)

@aljones15
Copy link
Contributor Author

closing as fix for this has been merged into master. There are still ways of triggering this deprecation notice, but those are not our fault as we are passing in writeConcern now.

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

No branches or pull requests

2 participants