Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
Database Manual
/ / /

RangeDeletionMissingShardKeyIndex

RangeDeletionMissingShardKeyIndex

A sharded collection exists that doesn't have an index compatible with the collection shard key and there is at least one remaining range deletion task to complete.

New in version 8.2.

{
type: "RangeDeletionMissingShardKeyIndex",
description: "<string>",
details: {
namespace: "<string>",
shard: "<string>",
shardKey: { <document> }
}
}

RangeDeletionMissingShardKeyIndex inconsistency documents contain the following fields:

Field
Type
Description

type

string

Type of inconsistency document. Returns a value of RangeDeletionMissingShardKeyIndex 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.shard

string

The shard where the inconsistency exists.

details.shardKey

document

The shard key that requires an index.

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

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "RangeDeletionMissingShardKeyIndex",
description: "Found sharded collection with an outstanding range deletion task without a shard key index",
details: {
namespace: "test.authors",
shard: "shard-rs0",
shardKey: {
skey: 1
}
}
}
],
},
ok: 1
}

Back

MissingShardKeyIndex

On this page