Skip to content

Commit b96b595

Browse files
DOCS-13533 Validate should limit memory use
1 parent 0f7bae2 commit b96b595

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

source/reference/command/validate.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,23 @@ Specify :ref:`full: true <cmd-validate-full>` for more detailed output.
278278

279279
*Available starting in MongoDB 4.2 (and 4.0.10+ and 3.6.13+)*
280280

281+
.. data:: validate.corruptRecords
282+
283+
An array of ``RecordId`` values for documents that are unreadable,
284+
possibly because the data is damaged. These documents are reported as
285+
corrupt during validation. A ``RecordId`` is a 64-bit integer
286+
internal key that uniquely identifies a document in a collection.
287+
288+
.. code-block:: javascript
289+
:copyable: false
290+
291+
"corruptRecords" : [
292+
NumberLong(1), // RecordId 1
293+
NumberLong(2) // RecordId 2
294+
]
295+
296+
.. versionadded:: 4.4.7
297+
281298
.. data:: validate.ok
282299

283300
An integer with the value ``1`` when the command succeeds. If the

source/reference/parameters.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,21 @@ Authentication Parameters
251251
start-up, and cannot change this setting with the
252252
:dbcommand:`setParameter` database command.
253253

254+
.. parameter:: maxValidateMemoryUsageMB
255+
256+
.. versionadded:: 4.4.7
257+
258+
*Default*: 200
259+
260+
The maximum memory usage limit in megabytes for the
261+
:dbcommand:`validate` command. If the limit is exceeded,
262+
:dbcommand:`validate` returns as many results as possible and warns
263+
that not all corruption might be reported because of the limit.
264+
265+
You can set :parameter:`maxValidateMemoryUsageMB` during startup, and
266+
can change this setting using the :dbcommand:`setParameter` database
267+
command.
268+
254269
.. parameter:: ocspEnabled
255270

256271
.. versionadded:: 4.4

0 commit comments

Comments
 (0)