Docs Menu

CollectionAuxiliaryMetadataMismatch

CollectionAuxiliaryMetadataMismatch

A collection contains mismatching auxiliary metadata across different shards.

New in version 8.1.

{
type: "CollectionAuxiliaryMetadataMismatch",
description: "<string>",
details: {
namespace: "<string>",
collectionMetadata: <array>
}
}

CollectionAuxiliaryMetadataMismatch inconsistency documents contain these fields:

Field
Type
Description

type

string

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

description

string

Describes 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.collectionMetadata

array

Lists the mismatching auxiliary metadata found per shard.

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 CollectionAuxiliaryMetadataMismatch inconsistency document:

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "CollectionAuxiliaryMetadataMismatch",
description: "Found collection with mismatching auxiliary metadata across shards and/or config server",
details: {
namespace: "test.authors",
collectionMetadata: [
{ "md": { "exampleField": 123 }, "shards": [ "shard0" ] },
{ "md": { "exampleField": 321 }, "shards": [ "shard1" ] }
]
}
}
],
},
ok: 1
}