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

getlasterror on sharded cluster does not merge writtenTo field to the top level.

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.0-rc1
    • Component/s: Replication, Sharding
    • None
    • ALL

      When doing a multi-write to a sharded cluster through mongos and more than one shard executes the write, GLE's writtenTo field is not populated on the top level of returned document.

      Example:

      {
      	"shards" : [
      		"st1-rs0/asyasmacbook.local:31100,asyasmacbook.local:31101,asyasmacbook.local:31102",
      		"st1-rs1/asyasmacbook.local:31200,asyasmacbook.local:31201,asyasmacbook.local:31202"
      	],
      	"shardRawGLE" : {
      		"st1-rs0/asyasmacbook.local:31100,asyasmacbook.local:31101,asyasmacbook.local:31102" : {
      			"updatedExisting" : true,
      			"n" : 2,
      			"lastOp" : {
      				"t" : 1360786163000,
      				"i" : 3
      			},
      			"connectionId" : 21,
      			"writtenTo" : [
      				{
      					"_id" : 0,
      					"host" : "asyasmacbook.local:31100"
      				},
      				{
      					"_id" : 1,
      					"host" : "asyasmacbook.local:31101"
      				},
      				{
      					"_id" : 2,
      					"host" : "asyasmacbook.local:31102"
      				}
      			],
      			"wtime" : 1,
      			"err" : null,
      			"ok" : 1
      		},
      		"st1-rs1/asyasmacbook.local:31200,asyasmacbook.local:31201,asyasmacbook.local:31202" : {
      			"updatedExisting" : true,
      			"n" : 2,
      			"lastOp" : {
      				"t" : 1360786163000,
      				"i" : 2
      			},
      			"connectionId" : 19,
      			"writtenTo" : [
      				{
      					"_id" : 0,
      					"host" : "asyasmacbook.local:31200"
      				},
      				{
      					"_id" : 1,
      					"host" : "asyasmacbook.local:31201"
      				},
      				{
      					"_id" : 2,
      					"host" : "asyasmacbook.local:31202"
      				}
      			],
      			"wtime" : 0,
      			"err" : null,
      			"ok" : 1
      		}
      	},
      	"n" : 4,
      	"updatedExisting" : true,
      	"err" : null,
      	"ok" : 1
      }
      

      You can see that two updates in each shard merged into "n:4" at the top level, but writtenTo: is not in the top level at all.

            Assignee:
            Unassigned Unassigned
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: