From 341a41d052f5eb783a22e6afea9a4c8942c2fef0 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Fri, 23 Oct 2020 15:16:39 -0700 Subject: [PATCH] DOCS-13533 Validate should limit memory use --- source/reference/command/validate.txt | 17 +++++++++++++++++ source/reference/parameters.txt | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/source/reference/command/validate.txt b/source/reference/command/validate.txt index e0d433f4c6f..5df7e9597b0 100644 --- a/source/reference/command/validate.txt +++ b/source/reference/command/validate.txt @@ -278,6 +278,23 @@ Specify :ref:`full: true ` for more detailed output. *Available starting in MongoDB 4.2 (and 4.0.10+ and 3.6.13+)* +.. data:: validate.corruptRecords + + An array of ``RecordId`` values for documents that are unreadable, + possibly because the data is damaged. These documents are reported as + corrupt during validation. A ``RecordId`` is a 64-bit integer + internal key that uniquely identifies a document in a collection. + + .. code-block:: javascript + :copyable: false + + "corruptRecords" : [ + NumberLong(1), // RecordId 1 + NumberLong(2) // RecordId 2 + ] + + .. versionadded:: 4.4.7 + .. data:: validate.ok An integer with the value ``1`` when the command succeeds. If the diff --git a/source/reference/parameters.txt b/source/reference/parameters.txt index cd8944fee9f..330c17542b5 100644 --- a/source/reference/parameters.txt +++ b/source/reference/parameters.txt @@ -251,6 +251,21 @@ Authentication Parameters start-up, and cannot change this setting with the :dbcommand:`setParameter` database command. +.. parameter:: maxValidateMemoryUsageMB + + .. versionadded:: 4.4.7 + + *Default*: 200 + + The maximum memory usage limit in megabytes for the + :dbcommand:`validate` command. If the limit is exceeded, + :dbcommand:`validate` returns as many results as possible and warns + that not all corruption might be reported because of the limit. + + You can set :parameter:`maxValidateMemoryUsageMB` during startup, and + can change this setting using the :dbcommand:`setParameter` database + command. + .. parameter:: ocspEnabled .. versionadded:: 4.4