In SERVER-53675, we provided the ability to fix up invalid multikey index information in the collection metadata through the validate command. On a server configured for read-only access, the validate command would still attempt to fix up the metadata on detecting a multikey inconsistency. This results in a failed validation command with the following error:
> db.getSiblingDB('db_1').two.validate({full: true}) { "ns" : "db_1.two", "nInvalidDocuments" : 0, "nrecords" : 3, "valid" : false, "repaired" : false, "warnings" : [ ], "errors" : [ "exception during collection validation: IllegalOperation: Cannot execute a write operation in read-only mode" ], "extraIndexEntries" : [ ], "missingIndexEntries" : [ ], "corruptRecords" : [ ], "advice" : "A corrupt namespace has been detected. See http://dochub.mongodb.org/core/data-recovery for recovery steps.", "ok" : 1 }
We should revisit the condition in the validation code that allows metadata fix-ups to proceed on a read-only server.
- is related to
-
SERVER-53675 Allow validate to fix up multikey metadata
- Closed