Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-52978

Ordered bulk insert no longer stops on bson validation errors in 4.9.0-alpha-660-g250d733

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • Sharding 2020-11-30

      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.

            Assignee:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: