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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.9.0
    • Storage
    • None
    • Fully Compatible
    • ALL
    • Sharding 2020-11-30

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: