Ordered bulk insert no longer stops on error in 4.9.0-alpha-660-g250d733:
> db.version() 4.9.0-alpha-660-g250d733 > db.runCommand({'insert': 'test', 'ordered': true, 'documents': [{}, {'big': 'x'.repeat(db.isMaster().maxBsonObjectSize)}, {}]}) { "n" : 2, "writeErrors" : [ { "index" : 1, "code" : 2, "errmsg" : "object to insert too large. size in bytes: 16777231, max size: 16777216" } ], "opTime" : { "ts" : Timestamp(1605902265, 4), "t" : NumberLong(1) }, "electionId" : ObjectId("7fffffff0000000000000001"), "ok" : 1 }
And here's the expected behavior using 4.4.0:
> db.version() 4.4.0 > db.runCommand({'insert': 'test', 'ordered': true, 'documents': [{}, {'big': 'x'.repeat(db.isMaster().maxBsonObjectSize)}, {}]}) { "n" : 1, "writeErrors" : [ { "index" : 1, "code" : 2, "errmsg" : "object to insert too large. size in bytes: 16777231, max size: 16777216" } ], "opTime" : { "ts" : Timestamp(1605902241, 2), "t" : NumberLong(1) }, "electionId" : ObjectId("7fffffff0000000000000001"), "ok" : 1 }
Notice "n":2 in the first case and "n":1 in the second.
- causes
-
PYTHON-2436 Test failure - test.test_legacy_api.TestLegacyBulk.test_large_inserts_ordered
- Closed
- is caused by
-
SERVER-52667 write_ops_exec::performInserts with retryable writes can lose writes and return an out of order results array
- Closed