Docs Menu
Docs Home
/
MongoDB Manual
/ / /

CollectionUUIDMismatch

On this page

  • Description
  • Format
  • Example
CollectionUUIDMismatch

A collection exists on a shard with a locally registered UUID that differs from the one registered in the config.collections cluster catalog.

New in version 7.0.

{
type: "CollectionUUIDMismatch",
description: "<string>",
details: {
namespace: "<string>",
shard: "<string>",
localUUID: UUID("<uuid>"),
uuid: UUID("<uuid>")
}
}

CollectionUUIDMismatch inconsistency documents contain the following fields:

Field
Type
Description
type
string

Type of inconsistency document. Returns a value of CollectionUUIDMismatch for this inconsistency type.

description
string

Describes the nature of the inconsistency found in the metadata.

details
document

Document with additional information on where the inconsistency exists in the database and sharded cluster.

details.namespace
string

Indicates the database and collection where the inconsistency exists.

details.shard
string

The shard where the inconsistency exists.

details.localUUID
UUID
The UUID registered locally on the shard.
details.uuid
UUID
The UUID of the collection found in the config.collections cluster catalog.

Use the db.adminCommand() method to call the checkMetadataConsistency command:

db.adminCommand( { checkMetadataConsistency: 1 } )

The method returns a cursor with a batch of documents showing the inconsistencies found in the sharding metadata. The example below shows a cursor with a CollectionUUIDMismatch inconsistency document:

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "CollectionUUIIDMismatch",
description: "Found collection on non primary shard with mismatching UUID",
details: {
namespace: "test.authors",
shard: "shard02",
localUUID: new UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4"),
uuid: new UUID("a3153e8a-3544-43ec-928f-37f72b48dee9")
}
}
],
},
ok: 1
}
← Inconsistency Types