[SERVER-38369] Only surface a "request doesn't allow collection to be created implicitly" error if no shard has the collection Created: 03/Dec/18  Updated: 29/Oct/23  Resolved: 13/May/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.12

Type: Improvement Priority: Major - P3
Reporter: Alyson Cabral (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Fixed Votes: 1
Labels: ShardingRoughEdges, high-value
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2019-02-11, Sharding 2019-02-25, Sharding 2019-05-06, Sharding 2019-05-20
Participants:
Case:

 Description   

Even though a collection exists on some shards and not on others, it's confusing to get "request doesn't allow collection to be created implicitly" error.

mongos> db.bar.createIndex( { _id: 1, x: 1, c: 1}, { unique: true });
{
	"raw" : {
		"shardA/Kays-MacBook-Pro-2.local:27018,Kays-MacBook-Pro-2.local:27019,Kays-MacBook-Pro-2.local:27020" : {
			"createdCollectionAutomatically" : false,
			"numIndexesBefore" : 4,
			"numIndexesAfter" : 5,
			"ok" : 1
		},
		"shardB/Kays-MacBook-Pro-2.local:27021,Kays-MacBook-Pro-2.local:27022,Kays-MacBook-Pro-2.local:27023" : {
			"ok" : 0,
			"errmsg" : "request doesn't allow collection to be created implicitly",
			"code" : 227,
			"codeName" : "CannotImplicitlyCreateCollection",
			"ns" : "test.bar"
		}
	},
	"ok" : 1,
	"operationTime" : Timestamp(1543854685, 3),
	"$clusterTime" : {
		"clusterTime" : Timestamp(1543854685, 5),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
} 



 Comments   
Comment by Githook User [ 13/May/19 ]

Author:

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

Message: Revert "SERVER-40996 abortTransaction in cleanup_txns.js does not handle different errors from different shards"

This reverts commit ba844b4e81c3914b8a7017bd2a8c5ac4231c72ff.

SERVER-40757 Fix snapshot_read_kill_operations.js to handle read-only transactions that are aborted

The commit for SERVER-38369 made commands that return raw shard responses return the first non-ignorable error as the top-level error, even if different non-ignorable errors occurred.
Branch: master
https://github.com/mongodb/mongo/commit/9a77424deeae44452042eed2c50747bd127b1b48

Comment by Githook User [ 12/May/19 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-38369 fix windows compile
Branch: master
https://github.com/mongodb/mongo/commit/451c675f4bdcae94c7562ff0bef2090f79a807f7

Comment by Githook User [ 10/May/19 ]

Author:

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

Message: SERVER-38369 Only surface a 'request doesn't allow collection to be created implicitly' error if no shard has the collection
Branch: master
https://github.com/mongodb/mongo/commit/87c32b0ee8f862b330908fb1653f851aee2a6fa4

Comment by Alyson Cabral (Inactive) [ 01/Feb/19 ]

Yes, returning CannotImplicitlyCreateCollection exposes an implementation detail that ultimately confuses users. I'd prefer a more descriptive response saying that no data for the collection lives on the shard. Or ideally I'd even go as far as suggesting we swallow responses from shards that don't contain chunks.

Comment by Esha Maharishi (Inactive) [ 28/Jan/19 ]

alyson.cabral, the command returned success in this case (ok: 1) - is this ticket asking to not even show the CannotImplicitlyCreateCollection error from "shardB" in the raw responses?

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