[SERVER-22840] mongod should fail to start when configuring journaling with a storage engine that doesn't support it Created: 24/Feb/16  Updated: 06/Dec/22  Resolved: 06/Oct/17

Status: Closed
Project: Core Server
Component/s: Storage, WiredTiger
Affects Version/s: 3.2.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Storage Execution Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage 2017-07-10, Storage 2017-07-31, Storage 2017-08-21
Participants:

 Description   

MongoDB Enterprise > db.a.insert({}, {writeConcern:{j:true}})
WriteResult({
	"writeError" : {
		"code" : 2,
		"errmsg" : "cannot use 'j' option when a host does not have journaling enabled"
	}
})
MongoDB Enterprise > db.adminCommand("getCmdLineOpts")
{
	"argv" : [
		"./mongod",
		"--storageEngine",
		"inMemory",
		"--journal"
	],
	"parsed" : {
		"storage" : {
			"engine" : "inMemory",
			"journal" : {
				"enabled" : true
			}
		}
	},
	"ok" : 1
}



 Comments   
Comment by Alexander Gorrod [ 06/Sep/17 ]

milkie and ian.whalen The changes required to resolve this ticket are quite invasive. It involves changes to the storage engine API, and changes to the enterprise modules, as well as introducing a user visible functionality change. Given that I don't think the usability improvement warrants the risk and amount of work.

I'm going to move it back onto the backlog - since it isn't clear we want this change. I'd be happy for it to be closed a "works as designed" or "won't fix".

Comment by Vamsi Boyapati [ 04/Sep/17 ]

Need more discussion about approach, hence moving back to open

Comment by Maria van Keulen [ 07/Aug/17 ]

vamsi.krishna Method 2 sounds good; I like the idea of fixing all the storage engines in one place. Thank you for checking in about this.

Comment by Vamsi Boyapati [ 04/Aug/17 ]

maria.vankeulen@mongodb.com
Hi Maria, I need some help in resolving this ticket. As Geert is going on a vacation, need your help. Request to comment on below analysis and to share your opinion.

The scope of this ticket is to throw error when mongod is started with journaling enabled and with a storage engine which doesn't support durability.

Below are the two approaches to solve this:
1. To update validateMetadata() implementation of each Storage engine to check if user has configured "journal" and whether this storage engine supports Durability. This needs the update in validateMetadata() function of each storage engine and this has to be taken care in future storage engines as well.

2. In db.cpp file, in function ExitCode _initAndListen(int listenPort) , after initializing storage engine we can check whether "journal" is configured and this storage engine supports Durability and can handle appropriately. In this method, the storage engine will be initialised and shutdown immediately if we return error. This method will take care of any future storage engines as well which can be plugged to mongodb

My preference is method 2 as this will be like a fix at single place for all storage engines.
We need to add a new error code for this case.
isDurable() method on storage_engine will tells about durability supported by storage engine.

Comment by Vamsi Boyapati [ 25/Jul/17 ]

I will invoke the isDurable() of the storage_engine to decide whether a particular storage engine supports journalling option or not.

Comment by Alexander Gorrod [ 09/Jun/17 ]

The particular storage engine that doesn't support journaling is the inMemory storage engine - it should be used as an example when implementing the fix.

Comment by Ian Whalen (Inactive) [ 21/Mar/16 ]

geert.bosch can you please check on this?

Generated at Thu Feb 08 04:01:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.