[COMPASS-7145] Investigate changes in NODE-5546: Fix Decimal128 rounding issue Created: 24/Aug/23  Updated: 29/Aug/23  Resolved: 29/Aug/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Investigation Priority: Major - P3
Reporter: PM Bot Assignee: Unassigned
Resolution: Done Votes: 0
Labels: node-driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on NODE-5546 Fix Decimal128 rounding issue Closed
Documented
Epic Link: MONGOSH-1319
Documentation Changes: Not Needed

 Description   

Use Case

As a... driver engineer
I want... Decimal128 rounding to be correct
So that... users do not corrupt their data

User Impact

  • Users storing values on the edges of the representable range of Decimal128 will have correctly rounded numbers when opting into using fromStringRounded
  • Users whose applications were silently losing precision will now see an uncaught exception.

Dependencies

  • Possible shell impacts?

Unknowns

  • How does this impact shell?
    • Shouldn't have any shell impact since they already gracefully catch bson errors
  • Do we want a global static option to control rounding?
    • No
  • Does this need a DOCSP ticket?
    • Yes

Acceptance Criteria

Implementation Requirements

  • update fromString to throw on inexact rounding
    • in the rounding section of the code, if there are less significant digits encoded than exist in total, then we check for the digit to be rounded. If it is not zero then we should throw

Testing Requirements

  • Unskip parse error spec tests and ensure that they are passing.
  • Pull in new Decimal128 spec tests from DRIVERS-2651

Documentation Requirements

  • Release notes

Follow Up Requirements

  • File ticket to add fromStringRounded static method
  • File ticket to absorb change into 5.x driver
  • File ticket to absorb change into 6.x driver


 Comments   
Comment by Anna Henningsen [ 29/Aug/23 ]

Documented by DOCSP-32205, nothing else to do here for us.

Generated at Wed Feb 07 22:45:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.