-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.6
-
Component/s: Replication
-
None
-
Environment:3.2.0-54-generic #82-Ubuntu SMP Tue Sep 10 20:08:42 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 12.04.3 LTS
MongoDB 2.4.6
-
ALL
-
We try to run Repair in our ReplicaSet to improve disk usage.
We want to repair each secondary and then after stepDown the last primary.
If we try to run repair on a secondary we receive an error:
> db.repairDatabase() { "ok" : 0, "errmsg" : "clone failed for testDB with error: namespace query failed testDB.system.namespaces" }
We used the mongo shell and set rs.slaveOk(). We also wrote a python script to do this task, which fails with the same Error.
RepairDatabase() works on a single mongod without replicatset config.
Some more debugging:
> use testDB > db.system.namespaces.find(); { "name" : "testDB.system.indexes" } { "name" : "testDB.testCollection.$_id_" } { "name" : "testDB.testCollection" } > db.createCollection( "testDB.system.namespaces" ); { "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } > rs.slaveOk() > db.createCollection( "testDB.system.namespaces" ); { "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" }
We ran the createCollection command on the Primary before as well, but still don't see the namespace in the listing.
If we run the command on the primary again
> db.createCollection( "testDB.system.namespaces" ); { "ok" : 0, "errmsg" : "collection already exists" }
- duplicates
-
SERVER-11391 repairDatabase should be disallowed on secondaries
- Closed
-
SERVER-2264 make repairDatabase work on secondary, using maintenanceMode
- Closed