[SERVER-16470] db.collection.stats() creates invalid document issued on a MongoS to an un-sharded collection Created: 09/Dec/14  Updated: 06/Dec/22  Resolved: 13/Jun/19

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

Type: Bug Priority: Major - P3
Reporter: David Hows Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Sharding
Operating System: ALL
Steps To Reproduce:

From any mongos issue db.collection.stats() on an unsharded collection.

Eg:

> db.t2.stats()
{
	"sharded" : false,
	"primary" : "shard01",
	"ok" : 0,
	"errmsg" : "Database [bar] not found.",
	"$gleStats" : {
		"lastOpTime" : Timestamp(0, 0),
		"electionId" : ObjectId("5486a19daf76718dcc4f53ce")
	}
}

Participants:

 Description   

As part of SERVER-12419, we created a new field name called "$gleStats".

The leading $ sign on the field name breaks the document conventions. This means that end users cannot take the output of db.collection.stats() on a MongoS and re-insert it or perform other operations with this output.


Generated at Thu Feb 08 03:41:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.