[SERVER-29832] _configsvrShardCollection should return error codes so that it can be retried by mongos Created: 23/Jun/17  Updated: 30/Oct/23  Resolved: 26/Jun/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.5.9
Fix Version/s: 3.5.10

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2017-07-10
Participants:
Linked BF Score: 0

 Description   

From the linked BF, getting this error:

[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 2017-06-21T19:33:50.628+0000 E QUERY    [thread1] Error: command failed: {
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 	"code" : 8,
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 	"ok" : 0,
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 	"errmsg" : "ensureIndex failed to create index on primary shard: operation was interrupted",
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 	"$logicalTime" : {
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 		"clusterTime" : Timestamp(1498073630, 21),
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 		"signature" : {
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 			"hash" : BinData(0,"VsxnCqW3qBtWUvl2gB08eikOs5k="),
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 			"keyId" : NumberLong("6434177213490266132")
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 		}
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 	},
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 	"operationTime" : Timestamp(1498073630, 21)
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 } : undefined :
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 _getErrorWithCode@src/mongo/shell/utils.js:25:13
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 doassert@src/mongo/shell/assert.js:16:14
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 assert.commandWorked@src/mongo/shell/assert.js:403:5
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 @jstests/sharding/jumbo1.js:8:1
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 @jstests/sharding/jumbo1.js:1:2
[js_test:jumbo1] 2017-06-21T19:33:50.646+0000 failed to load: jstests/sharding/jumbo1.js

The command is failing here: https://github.com/mongodb/mongo/blob/7f0caad1b2e62bd8a1533f865fab220c8e853464/src/mongo/db/s/config/configsvr_shard_collection_command.cpp#L511-L516

An appropriate error code should be appended to the result returned to the mongos so that it can act appropriately. In general, shardCollection probably needs to append errors when it returns early.

This is needed so that our testing doesn't fail, because our JS tests always assert that shardCollection works and the stepdown suite can interrupt shardCollection at any point – so all the tests run in the stepdown suite are liable to fail non-deterministically.



 Comments   
Comment by Githook User [ 26/Jun/17 ]

Author:

{u'username': u'EshaMaharishi', u'name': u'Esha Maharishi', u'email': u'esha.maharishi@mongodb.com'}

Message: SERVER-29832 _configsvrShardCollection should return error codes so that it can be retried by mongos
Branch: master
https://github.com/mongodb/mongo/commit/13d540f45bc84aaf925197eb3d4803262bc0a51c

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