[SERVER-23972] NumberDecimal values can be inserted in legacy write mode when featureCompatibilityVersion is 3.2 Created: 28/Apr/16  Updated: 19/Nov/16  Resolved: 06/Sep/16

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 3.3.5
Fix Version/s: 3.3.14

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Tess Avitabile (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2016-09-19
Participants:
Linked BF Score: 0

 Description   

When featureCompatibilityVersion is 3.2, it should be an error to insert documents containing NumberDecimal values in legacy write mode.

Previous description:
Documents that contain NumberDecimal values can be inserted in legacy write mode. The same documents cannot be inserted when using write command mode.

var coll = db.foo;
coll.drop();
 
// The write fails when using write commands:
// "Attempt to use a decimal BSON type when support is not currently enabled."
assert.writeError(coll.insert({a: NumberDecimal(2.0)}));
assert.eq(coll.count(), 0);
 
// The write succeeds when using legacy writes.
db.getMongo().forceWriteMode('legacy');
coll.insert({a: NumberDecimal(2.0)});
 
// This assertion fails because there's a document present.
assert.eq(coll.count(), 0);



 Comments   
Comment by Eric Milkie [ 09/Sep/16 ]

We might want to move this check into the specific handlers for OP_INSERT, OP_UPDATE, OP_DELETE. This will make it easier to override the featureCompatibilityVersion based on replication mode (PRIMARY vs. SECONDARY).

Comment by Githook User [ 06/Sep/16 ]

Author:

{u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

Message: SERVER-23972 Disallow decimal insertion in legacy write mode when featureCompatibilityVersion is 3.2
Branch: master
https://github.com/mongodb/mongo/commit/8f83b3e0937dc0b471c408714108ced515397e01

Comment by Ramon Fernandez Marina [ 23/Jul/16 ]

NumberDecimal is enabled by default since 3.3.8, as decimal values are accepted by default since then. So it is no longer an error that NumberDecimal values can be inserted.

Generated at Thu Feb 08 04:05:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.