[SERVER-68842] Passing in w: NaN for write concern is interpreted as w: 0 Created: 15/Aug/22  Updated: 29/Oct/23  Resolved: 08/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Ali Mir Assignee: John Liu (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-68309 Investigate for unsafe narrowing conv... Closed
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

As part of the NaN conversion audit of replication, we found that passing in w: NaN as an argument for setting write concern, the NaN is evaluated as 0. This is because we use safeNumberLong() to extract the "w" value, and this function evaluates NaN as 0.

This issue exists all the way back to 4.4.



 Comments   
Comment by Githook User [ 08/Mar/23 ]

Author:

{'name': 'John Liu', 'email': 'john.m.liu2@gmail.com', 'username': 'john-m-liu'}

Message: SERVER-68842 fix w:NaN being interpreted as w:0
Branch: master
https://github.com/mongodb/mongo/commit/56b7315dc8bee059b47bbb4db984a3f584da2e48

Comment by Ali Mir [ 15/Aug/22 ]

dave.rolsky@mongodb.com yep, accidentally made it REP but moved the ticket over already. Thanks for the heads up!

Comment by Dave Rolsky [ 15/Aug/22 ]

ali.mir@mongodb.com Did you mean to put this in the SERVER project?

Generated at Thu Feb 08 06:11:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.