[DOCS-10842] Docs for SERVER-30344: prevent shards from implicitly creating a collection on createIndexes Created: 27/Sep/17 Updated: 15/Oct/19 Resolved: 23/Oct/17 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Kay Kim (Inactive) | Assignee: | Kevin Albertson |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Days since reply: | 6 years, 16 weeks, 2 days ago | ||||||||
| Epic Link: | DOCS: 3.6 Server | ||||||||
| Description |
Documentation Request Summary:This ticket makes createIndexes, reIndex, dropIndex, and collMod only actually execute on shards that currently know about the namespace. (A shard may not currently own any chunks for the namespace, but have previously owned chunks). For unsharded collections, these commands only target the primary shard. For sharded collections, these commands are broadcast to all shards, but shards that do not know about the namespace return NamespaceNotFound (reIndex, dropIndex, collMod) or CannotImplicitlyCreateCollection (createIndexes). Mongos treats these errors as success (the overall command will report success if shards return a mix of ok:1 and these errors), but these error codes are shown in the raw responses from shards in the 'raw' field of the response object. Engineering Ticket Description:createIndexes on mongos is currently broadcast to all shards rather than only targeting shards which own data for the collection, since listIndexes expects the primary shard to have all the indexes for the collection (and the primary shard might not own any chunks for the collection at some particular time) ( However, this means the collection is implicitly created on shards which don't own chunks for the collection AND don't have an entry for the collection in their storage engine (e.g., any shard that has never owned chunks for the collection). The collection is implicitly created on these shards without the collection options, including the collection's UUID. To prevent this, 1) mongods running as --shardsvr should fail createIndexes with NamespaceNotFound rather than implicitly create the collection with the wrong options |
| Comments |
| Comment by Kevin Albertson [ 23/Oct/17 ] | ||||||||||||||||||||||||
|
Discussed with Esha. Since we don't mention the "raw" field in the command responses we don't need to make any documentation changes. | ||||||||||||||||||||||||
| Comment by Kevin Albertson [ 16/Oct/17 ] | ||||||||||||||||||||||||
|
I'm not sure what is the best way to document this change. We don't currently discuss the raw part of a response from a command issued to a sharded cluster. I could add a snippet to the createIndex page like so:
But then again, the behavior should be pretty transparent to the user. If they create an index, it won't be created on shards unaware of that collection until chunks are moved to it. OTOH, the errors from the raw error document may be confusing. E.g.
|