[SERVER-61509] full validation attempts to fix up multikey on read-only server Created: 16/Nov/21  Updated: 29/Oct/23  Resolved: 30/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Daniel Gomez Ferro
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-53675 Allow validate to fix up multikey met... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2021-11-29, Execution Team 2021-12-13
Participants:
Linked BF Score: 15

 Description   

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.



 Comments   
Comment by Githook User [ 30/Nov/21 ]

Author:

{'name': 'Daniel Gómez Ferro', 'email': 'daniel.gomezferro@mongodb.com', 'username': 'dgomezferro'}

Message: SERVER-61509 Avoid repairing read-only databases
Branch: master
https://github.com/mongodb/mongo/commit/f84899b472bef1dbb1fd47a069f1dd77503d8c6d

Generated at Thu Feb 08 05:52:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.