[DOCS-10590] Issues with repairDatabase documentation Created: 28/Jul/17  Updated: 30/Oct/23  Resolved: 03/Aug/17

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Critical - P2
Reporter: Kevin Adistambha Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-9814 WiredTiger does not compact or reclai... Closed
is related to DOCS-8713 Comment on: "manual/reference/command... Closed
is related to DOCS-9301 Update to repairDatabase documentation Closed
Participants:
Days since reply: 6 years, 24 weeks ago

 Description   

There are several issues with the repairDatabase documentation page in https://docs.mongodb.com/manual/reference/command/repairDatabase/

repairDatabase is an administrative command that needs to be run with due care, especially in a replica set configuration. However, the tone and content of the documentation page gives the impression that this is a "safe" command to run. As a result, the suggestion to run repairDatabase for the smallest of issues is often see in community advice.

In MMAPv1, repairDatabase rebuilds the data files based on the data that can be successfully read. Running this command in a replica set could potentially create inconsistencies in the set. Since all nodes in a replica set are assumed to contain identical data, this will lead to difficult to diagnose crashes and other surprising behaviour.

Confirmation will be needed as to what exactly repairDatabase does for WiredTiger.

A sample of incorrect and misleading statements in the page are:

  1. The repairDatabase command compacts all collections in the database. It is identical to running the compact command on each collection individually. This statement is very, very false and misleading. repairDatabase is not identical to bulk-compact.
  2. repairDatabase reduces the total size of the data files on disk Reducing data size is not the goal of repairDatabase
  3. However, if you trust that there is no corruption and you have enough free space, then repairDatabase is the appropriate and the only way to reclaim disk space. This statement is misleading. Reclaiming space should never be the goal of doing a repairDatabase.

The result of running repairDatabase may be irreversible. Hence, this command should come with:

  1. Encouragement to take a file copy backup of the dbpath before attempting any repair operations
  2. Information on what this command does for each storage engine
  3. Big warnings against running this in a replica set.
  4. Big warnings that you should not treat this command lightly, since the consequences of this command may be irreversible, lost data, etc.
  5. Big warnings that this command is a last resort.


 Comments   
Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: v3.0
https://github.com/mongodb/docs/commit/47f9818fcd5bb474310c7d6cd44089ab59a91f2a

Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: v3.2
https://github.com/mongodb/docs/commit/3cbb1b2d095a4707de9d4073cfcb28f715e5dfcb

Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: v3.4
https://github.com/mongodb/docs/commit/1e0daafda78af156cfe5323c9818c102ebee67d5

Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: master
https://github.com/mongodb/docs/commit/7d0452065dfbc58abd6f3183df94c90bceb2ce9d

Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: v3.4
https://github.com/mongodb/docs/commit/3be4892cbd338e496132cee2d941e04db9767307

Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: v3.0
https://github.com/mongodb/docs/commit/c5b50b28ace4f8c144512b12408f236fbc5e4779

Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: v3.2
https://github.com/mongodb/docs/commit/8d5b9bedb059a641d8b411db87c5ed82e84bd804

Comment by Githook User [ 31/Aug/17 ]

Author:

{'username': 'kay-kim', 'name': 'kay', 'email': 'kay.kim@10gen.com'}

Message: DOCS-10590: repairDatabase cleanup part2
Branch: master
https://github.com/mongodb/docs/commit/770d0eda36e54cbd0691fa2d66085c3b43ed718f

Comment by Kay Kim (Inactive) [ 28/Jul/17 ]

heh – You've gotten me trained kevin.adistambha – I'm like "Oh, I'll see if Kevin opens a CR himself"

Generated at Thu Feb 08 08:00:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.