digitalbazaar / bedrock-mongodb

Bedrock mongodb module
Apache License 2.0
2 stars 3 forks source link

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

Closed aljones15 closed 3 years ago

aljones15 commented 3 years ago

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

aljones15 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

Errors can be seen on CI: https://github.com/digitalbazaar/bedrock-edv-storage/runs/1856141883?check_suite_focus=true

aljones15 commented 3 years ago

Errors can be seen on CI: https://github.com/digitalbazaar/bedrock-edv-storage/runs/1856141883?check_suite_focus=true

thank you.

aljones15 commented 3 years ago

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 commented 3 years ago

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.