<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:23:39 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-30389] Simple and generic way to restrict server parameter values</title>
                <link>https://jira.mongodb.org/browse/SERVER-30389</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Many numeric server parameters only make sense with positive values, or non-negative, but this is often not enforced.  There may be negative impacts to the server if this is done (either deliberately or accidentally).&lt;/p&gt;

&lt;p&gt;Part of the problem seems to be that there is no &lt;tt&gt;MONGO_EXPORT_SERVER_PARAMETER&lt;/tt&gt; variant that can enforce simple restrictions on the permitted values.  This means enforcing restrictions requires using &lt;tt&gt;ExportedServerParameter&lt;/tt&gt; directly (with a fair amount of boilerplate), or &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.5.10/src/mongo/db/repl/repl_settings_init.cpp&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;MONGO_INITIALIZER&lt;/tt&gt; hacks&lt;/a&gt; to enforce the restrictions through other means (only works for startup parameters).  For the case of numeric parameters, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27520&quot; title=&quot;Allow unsigned types for MONGO_EXPORT_SERVER_PARAMETER &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27520&quot;&gt;&lt;del&gt;SERVER-27520&lt;/del&gt;&lt;/a&gt; explored the possibility of permitting unsigned types for parameters (and decided against it).&lt;/p&gt;

&lt;p&gt;&lt;b&gt;This ticket is to request a simple and easy way of enforcing simple restrictions for the most common cases, eg. min and/or max numeric value, string value from a set of allowed strings, non-empty string.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;I can imagine a variant of &lt;tt&gt;MONGO_EXPORT_SERVER_PARAMETER&lt;/tt&gt; which takes an extra argument to a &quot;&lt;tt&gt;ServerParameterValidator&lt;/tt&gt;&quot; object (templated for genericism), which &lt;tt&gt;ExportedServerParameter&lt;/tt&gt; then uses in the default &lt;tt&gt;validate()&lt;/tt&gt; method.  We could then provide some pre-canned ServerParameterValidators for the commonly-needed restrictions.&lt;/p&gt;</description>
                <environment></environment>
        <key id="409495">SERVER-30389</key>
            <summary>Simple and generic way to restrict server parameter values</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="backlog-server-platform">DO NOT USE - Backlog - Platform Team</assignee>
                                    <reporter username="kevin.pulo@mongodb.com">Kevin Pulo</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Jul 2017 06:44:23 +0000</created>
                <updated>Thu, 7 Jun 2018 05:37:31 +0000</updated>
                            <resolved>Thu, 7 Jun 2018 05:37:31 +0000</resolved>
                                                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="1913379" author="kevin.pulo@10gen.com" created="Thu, 7 Jun 2018 05:37:31 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34345&quot; title=&quot;Make it easier to provide validation rules for server parameters&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34345&quot;&gt;&lt;del&gt;SERVER-34345&lt;/del&gt;&lt;/a&gt; has implemented this mechanism, and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34952&quot; title=&quot;Require validators for non-boolean server parameters&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34952&quot;&gt;&lt;del&gt;SERVER-34952&lt;/del&gt;&lt;/a&gt; is for adding validators to the existing parameters.&lt;/p&gt;</comment>
                            <comment id="1634230" author="kevin.pulo@10gen.com" created="Fri, 28 Jul 2017 06:45:17 +0000"  >&lt;p&gt;I did a quick audit of the numeric parameters in 3.4.6.  (And more validation-less parameters are being added with &lt;tt&gt;MONGO_EXPORT_SERVER_PARAMETER&lt;/tt&gt; all the time.)&lt;/p&gt;


&lt;p&gt;These are the numeric parameters which use &lt;tt&gt;MONGO_EXPORT_SERVER_PARAMETER&lt;/tt&gt; (or a variant) and don&apos;t enforce bounds.  All of them are either a count, size, duration, or fraction/ratio, and only make sense with non-negative values.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;ShardingTaskExecutorPoolHostTimeoutMS&lt;/li&gt;
	&lt;li&gt;ShardingTaskExecutorPoolMinSize&lt;/li&gt;
	&lt;li&gt;ShardingTaskExecutorPoolRefreshRequirementMS&lt;/li&gt;
	&lt;li&gt;ShardingTaskExecutorPoolRefreshTimeoutMS&lt;/li&gt;
	&lt;li&gt;clientCursorMonitorFrequencySecs&lt;/li&gt;
	&lt;li&gt;cursorTimeoutMillis&lt;/li&gt;
	&lt;li&gt;initialSyncOplogBufferPeekCacheSize&lt;/li&gt;
	&lt;li&gt;internalDocumentSourceCursorBatchSizeBytes&lt;/li&gt;
	&lt;li&gt;internalGeoNearQuery2DMaxCoveringCells&lt;/li&gt;
	&lt;li&gt;internalGeoPredicateQuery2DMaxCoveringCells&lt;/li&gt;
	&lt;li&gt;internalInsertMaxBatchSize&lt;/li&gt;
	&lt;li&gt;internalQueryCacheEvictionRatio&lt;/li&gt;
	&lt;li&gt;internalQueryCacheFeedbacksStored&lt;/li&gt;
	&lt;li&gt;internalQueryCacheSize&lt;/li&gt;
	&lt;li&gt;internalQueryEnumerationMaxIntersectPerAnd&lt;/li&gt;
	&lt;li&gt;internalQueryEnumerationMaxOrSolutions&lt;/li&gt;
	&lt;li&gt;internalQueryExecMaxBlockingSortBytes&lt;/li&gt;
	&lt;li&gt;internalQueryExecYieldIterations&lt;/li&gt;
	&lt;li&gt;internalQueryExecYieldPeriodMS&lt;/li&gt;
	&lt;li&gt;internalQueryFacetBufferSizeBytes&lt;/li&gt;
	&lt;li&gt;internalQueryMaxScansToExplode&lt;/li&gt;
	&lt;li&gt;internalQueryPlanEvaluationCollFraction&lt;/li&gt;
	&lt;li&gt;internalQueryPlanEvaluationMaxResults&lt;/li&gt;
	&lt;li&gt;internalQueryPlanEvaluationWorks&lt;/li&gt;
	&lt;li&gt;internalQueryPlannerMaxIndexedSolutions&lt;/li&gt;
	&lt;li&gt;internalQueryS2GeoCoarsestLevel&lt;/li&gt;
	&lt;li&gt;internalQueryS2GeoFinestLevel&lt;/li&gt;
	&lt;li&gt;internalQueryS2GeoMaxCells&lt;/li&gt;
	&lt;li&gt;jsHeapLimitMB&lt;/li&gt;
	&lt;li&gt;maxLogSizeKB&lt;/li&gt;
	&lt;li&gt;num3Dot2InitialSyncAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncCollectionCountAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncCollectionFindAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncConnectAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncListCollectionsAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncListDatabasesAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncListIndexesAttempts&lt;/li&gt;
	&lt;li&gt;numInitialSyncOplogFindAttempts&lt;/li&gt;
	&lt;li&gt;priorityTakeoverFreshnessWindowSeconds&lt;/li&gt;
	&lt;li&gt;replSnapshotThreadThrottleMicros&lt;/li&gt;
	&lt;li&gt;scriptingEngineInterruptIntervalMS&lt;/li&gt;
	&lt;li&gt;taskExecutorPoolSize&lt;/li&gt;
	&lt;li&gt;ttlMonitorSleepSecs&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;The numeric parameters which don&apos;t use &lt;tt&gt;MONGO_EXPORT_SERVER_PARAMETER&lt;/tt&gt;, and also don&apos;t seem to enforce bounds:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;connPoolMaxConnsPerHost&lt;/li&gt;
	&lt;li&gt;connPoolMaxShardedConnsPerHost&lt;/li&gt;
	&lt;li&gt;heapProfilingSampleIntervalBytes&lt;/li&gt;
	&lt;li&gt;syncdelay&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;The numeric parameters which use &lt;tt&gt;MONGO_EXPORT_SERVER_PARAMETER&lt;/tt&gt; but enforce bounds some other way:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;maxSyncSourceLagSecs &amp;gt; 0&lt;/li&gt;
	&lt;li&gt;replElectionTimeoutOffsetLimitFraction &amp;gt; 0.01&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;The numeric parameters which enforce bounds, without using &lt;tt&gt;MONGO_EXPORT_SERVER_PARAMETER&lt;/tt&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;diagnosticDataCollectionDirectorySizeMB &amp;gt;= 10&lt;/li&gt;
	&lt;li&gt;diagnosticDataCollectionFileSizeMB &amp;gt;= 1&lt;/li&gt;
	&lt;li&gt;diagnosticDataCollectionPeriodMillis &amp;gt;= 100&lt;/li&gt;
	&lt;li&gt;diagnosticDataCollectionSamplesPerChunk &amp;gt;= 2&lt;/li&gt;
	&lt;li&gt;diagnosticDataCollectionSamplesPerInterimUpdate &amp;gt;= 2&lt;/li&gt;
	&lt;li&gt;1 &amp;lt;? journalCommitInterval &amp;lt;? 500&lt;/li&gt;
	&lt;li&gt;logLevel &amp;gt;= 0&lt;/li&gt;
	&lt;li&gt;5 &amp;lt;= maxBSONDepth &amp;lt;= 1000&lt;/li&gt;
	&lt;li&gt;maxIndexBuildMemoryUsageMegabytes &amp;gt;= 100&lt;/li&gt;
	&lt;li&gt;oplogFetcherMaxFetcherRestarts &amp;gt;= 0&lt;/li&gt;
	&lt;li&gt;1 &amp;lt;= replApplyBatchSize &amp;lt;= 1024&lt;/li&gt;
	&lt;li&gt;1 &amp;lt;= replBatchLimitOperations &amp;lt;= 1000000&lt;/li&gt;
	&lt;li&gt;1 &amp;lt;= replWriterThreadCount &amp;lt;= 256&lt;/li&gt;
	&lt;li&gt;scramIterationCount &amp;gt;= 5000&lt;/li&gt;
	&lt;li&gt;0 &amp;lt;? tcmallocAggressiveMemoryDecommit &amp;lt;? 9223372036854775807&lt;/li&gt;
	&lt;li&gt;0 &amp;lt;? tcmallocMaxTotalThreadCacheBytes &amp;lt;? 9223372036854775807&lt;/li&gt;
	&lt;li&gt;wiredTigerConcurrentReadTransactions &amp;gt; 0&lt;/li&gt;
	&lt;li&gt;wiredTigerConcurrentWriteTransactions &amp;gt; 0&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="522706">SERVER-34345</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="451091">SERVER-31719</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="341173">SERVER-27520</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="409492">SERVER-30387</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="409493">SERVER-30388</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="542595">SERVER-34952</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 35 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 35 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-platform</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htbu6n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9hqv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htbg9b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>