[SERVER-27316] getShardVersion should also show epoch Created: 07/Dec/16  Updated: 27/Oct/23  Resolved: 12/Dec/17

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

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Gone away Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Sharding 2017-12-18
Participants:

 Description   

Currently, it only shows the major/minor version on the shards:

{
	"configServer" : "test-configRS/x:y",
	"inShardedMode" : false,
	"mine" : Timestamp(0, 0),
	"global" : Timestamp(1, 0),
	"ok" : 1
}

The mongos version has the epoch (but in a slightly different format):

{
	"version" : Timestamp(1, 0),
	"versionEpoch" : ObjectId("584837449927ec3e340dbf2b"),
	"ok" : 1
}



 Comments   
Comment by Randolph Tan [ 12/Dec/17 ]

As of v3.6, you can make the command return the epoch by passing fullMetadata = true:

> db.adminCommand({ getShardVersion: 'test.user', fullMetadata: true })
{
	"configServer" : "...",
	"inShardedMode" : false,
	"mine" : Timestamp(0, 0),
	"global" : Timestamp(1, 0),
	"metadata" : {
		"collVersion" : Timestamp(1, 0),
		"collVersionEpoch" : ObjectId("5a305788bbad589bfcc5f216"),
		"shardVersion" : Timestamp(1, 0),
		"shardVersionEpoch" : ObjectId("5a305788bbad589bfcc5f216"),
		"keyPattern" : {
			"x" : 1
		},
		"chunks" : [
			[
				{
					"x" : { "$minKey" : 1 }
				},
				{
					"x" : { "$maxKey" : 1 }
				}
			]
		],
		"pending" : [ ]
	},
	"ok" : 1,
	"$configServerState" : {
		"opTime" : {
			"ts" : Timestamp(1513117635, 3),
			"t" : NumberLong(1)
		}
	}
}

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