Skip to content

Commit e209ae3

Browse files
kennethdyerKenneth P. J. Dyersarah-olson-mongodbPolPinol
authored
DOCSP-29807 Troubleshooting entry for checkMetadataInconsistency (#3237)
* DOCSP-29807 Troubleshooting entry for checkMetadataInconsistency * Explains inconsistencies * Fixes per Sarah * Fixes per Sarah * Fixes per Sarah * Fixes per Sarah * Fixes per Sarah Co-authored-by: Sarah Olson <[email protected]> * Fixes per Pol Co-authored-by: Pol Piñol Castuera <[email protected]> * Fixes per Tocci * Fixes per Tocci * Empty commit to trigger rebuild * Empty commit to trigger rebuild * Empty commit to trigger rebuild * Empty commit to trigger rebuild --------- Co-authored-by: Kenneth P. J. Dyer <[email protected]> Co-authored-by: Sarah Olson <[email protected]> Co-authored-by: Pol Piñol Castuera <[email protected]>
1 parent aeca2e6 commit e209ae3

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

source/tutorial/troubleshoot-sharded-clusters.txt

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,64 @@ The user will need to resolve the chunk migration failure
167167
independently. If you encounter this issue, ask the `MongoDB
168168
Community <https://community.mongodb.com/?tck=docs_server>`_ or
169169
:ref:`MongoDB Support <technical-support>` to address this issue.
170+
171+
172+
Inconsistent Sharding Metadata
173+
------------------------------
174+
175+
Starting in MongoDB 7.0, the :dbcommand:`checkMetadataConsistency` command
176+
is available to check sharding metadata for inconsistencies and corruptions
177+
due to bugs in previous releases of MongoDB.
178+
179+
Inconsistencies in sharding metadata can originate in cases such as:
180+
181+
- Clusters upgraded from a pre-5.0 release of MongoDB that may have
182+
corrupted data from past DDL operations.
183+
184+
- Manual interventions, such as manipulating the :ref:`config-database`
185+
or bypassing :program:`mongos` to write directly to a shard.
186+
187+
- Maintenance operations, such as upgrade or downgrade procedures.
188+
189+
These inconsistencies can result in incorrect query results
190+
or data loss.
191+
192+
To check sharding metadata for inconsistencies, run the
193+
:dbcommand:`checkMetadataConsistency` command:
194+
195+
.. io-code-block::
196+
197+
.. input::
198+
:language: javascript
199+
200+
db.runCommand( { checkMetadataConsistency: 1 } )
201+
202+
.. output::
203+
:language: json
204+
205+
{
206+
cursor: {
207+
id: Long("0"),
208+
ns: "test.$cmd.aggregate",
209+
firstBatch: [
210+
{
211+
type: "MisplacedCollection",
212+
description: "Unsharded collection found on shard different from database primary shard",
213+
details: {
214+
namespace: "test.authors",
215+
shard: "shard02",
216+
localUUID: new UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4")
217+
}
218+
}
219+
],
220+
},
221+
ok: 1
222+
}
223+
224+
Documents returned by the :dbcommand:`checkMetadataConsistency` command indicate
225+
the inconsistencies identified by MongoDB in the sharding metadata of the
226+
cluster.
227+
228+
For information on inconsistency documents returned by the
229+
:dbcommand:`checkMetadataConsistency` command, see :ref:`sharding-metadata`.
230+

0 commit comments

Comments
 (0)