[SERVER-6978] getParameter should know all setParameter params Created: 09/Sep/12  Updated: 10/Nov/15  Resolved: 14/Aug/13

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

Type: Improvement Priority: Minor - P4
Reporter: Richard Kreuter (Inactive) Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-10508 Add command to explicitly query journ... Closed
Related
related to SERVER-10515 Replace special cased Parameter with ... Closed
related to SERVER-5266 Make a clearer API for configuring gl... Backlog
is related to SERVER-1843 getParameter() and setParameter() com... Closed
Participants:

 Description   

It seems like getParameter doesn't support retrieving all the tunables that setParameter does. That's just silly.

parameters = [ "journalCommitInterval", "logLevel", "notablescan", "traceException", "quiet", "syncdelay" ];
 
for (var i in parameters) { 
    var p=parameters[i];
    var doc = { "getParameter" : 1 }; 
    doc[p]=1;
    print(p);
    printjson( db.adminCommand( doc ) ); 
}

Here's the output under 2.2.0:

journalCommitInterval
{ "errmsg" : "no option found to get", "ok" : 0 }
logLevel
{ "logLevel" : 0, "ok" : 1 }
notablescan
{ "notablescan" : false, "ok" : 1 }
traceException
{ "errmsg" : "no option found to get", "ok" : 0 }
quiet
{ "quiet" : false, "ok" : 1 }
syncdelay
{ "syncdelay" : 60, "ok" : 1 }



 Comments   
Comment by auto [ 14/Aug/13 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-6978: getParameter should know all setParameter params
Branch: master
https://github.com/mongodb/mongo/commit/dc31cddf24741317861376ec511d50e7425fc365

Comment by Bryan Reinero [ 28/Jan/13 ]

Version 2.3.2 doesn't support getParameter on journalCommitInterval, although you can still set it. It's also absent in the commandHelp output:

PRIMARY> db.adminCommand(

{ setParameter:1, journalCommitInterval:50 }

)

{ "ok" : 1 }

PRIMARY> db.adminCommand(

{ getParameter:1, journalCommitInterval:1 }

)

{ "ok" : 0, "errmsg" : "no option found to get" }

PRIMARY> db.commandHelp('getParameter')
help for: getParameter get administrative option(s)
example:

{ getParameter:1, notablescan:1 }

supported:
enableLocalhostAuthBypass
enableTestCommands
logLevel
logUserIds
notablescan
quiet
replApplyBatchSize
replIndexPrefetch
supportCompatibilityFormPrivilegeDocuments
syncdelay
textSearchEnabled

{ getParameter:'*' }

to get everything

PRIMARY> db.commandHelp('setParameter')
help for: setParameter set administrative option(s)

{ setParameter:1, <param>:<value> }

supported:
enableLocalhostAuthBypass
enableTestCommands
logLevel
logUserIds
notablescan
quiet
replApplyBatchSize
replIndexPrefetch
supportCompatibilityFormPrivilegeDocuments
syncdelay
textSearchEnabled

Comment by Scott Hernandez (Inactive) [ 05/Jan/13 ]

Fixed via other changes in set/getParameters in 2.3.2.

> db.adminCommand({getParameter:"*"}) {
	"enableLocalhostAuthBypass" : true,
	"enableTestCommands" : 1,
	"logLevel" : 0,
	"logUserIds" : 0,
	"notablescan" : false,
	"quiet" : false,
	"replApplyBatchSize" : 1,
	"replIndexPrefetch" : "uninitialized",
	"supportCompatibilityFormPrivilegeDocuments" : true,
	"syncdelay" : 60,
	"textSearchEnabled" : false,
	"ok" : 1 }

Comment by auto [ 10/Sep/12 ]

Author:

{u'date': u'2012-09-09T13:44:47-07:00', u'email': u'richard@10gen.com', u'name': u'Richard Kreuter'}

Message: Tad Marshall claims traceExceptions is plural.

See SERVER-6978.
Branch: master
https://github.com/mongodb/docs/commit/4c172192b6e45d7049c443d6487b6b8f1f9f1b5e

Comment by Richard Kreuter (Inactive) [ 09/Sep/12 ]

Thanks, Tad.

(traceExceptions with an 's' is apparently doc'd wrong, then, too. Pull request in progress.)

Comment by Tad Marshall [ 09/Sep/12 ]

traceException should be traceExceptions, but it is still missing from getParameter.

Also missing are ageOutJournalFiles, replMonitorMaxFailedChecks.

> db.runCommand({setParameter:1,traceExceptions:true})
{ "was" : false, "ok" : 1 }
> db.runCommand({getParameter:1,traceExceptions:true})
{ "errmsg" : "no option found to get", "ok" : 0 }
> db.runCommand({setParameter:1,ageOutJournalFiles:true})
{ "ok" : 1 }
> db.runCommand({getParameter:1,ageOutJournalFiles:true})
{ "errmsg" : "no option found to get", "ok" : 0 }
> db.runCommand({setParameter:1,replMonitorMaxFailedChecks:60})
{ "was" : 30, "ok" : 1 }
> db.runCommand({getParameter:1,replMonitorMaxFailedChecks:true})
{ "errmsg" : "no option found to get", "ok" : 0 }

Help is incomplete for both getParameter and setParameter.

> db.runCommand({getParameter:1,help:true}).help
help for: getParameter get administrative option(s)
example:
{ getParameter:1, notablescan:1 }
supported so far:
  quiet
  notablescan
  logLevel
  syncdelay
{ getParameter:'*' } to get everything
 
> db.runCommand({setParameter:1,help:true}).help
help for: setParameter set administrative option(s)
{ setParameter:1, <param>:<value> }
supported so far:
  journalCommitInterval
  logLevel
  notablescan
  quiet
  syncdelay
 
>

Ideally, the code should use a table for these parameters so that get, set and help are more easily kept in sync.

Comment by Richard Kreuter (Inactive) [ 09/Sep/12 ]

Linking to the issue where setParameter and getParameter were created, for posterity's sake.

Comment by Richard Kreuter (Inactive) [ 09/Sep/12 ]

If this improvement is made, the doc that needs altering is here:

http://docs.mongodb.org/manual/reference/commands/#getParameter

Generated at Thu Feb 08 03:13:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.