File tree 2 files changed +33
-3
lines changed
2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ Definition
28
28
The :dbcommand:`validate` command does not support :doc:`views
29
29
</core/views>` and raises an error when run against a view.
30
30
31
+ The :method:`db.collection.validate()` method in
32
+ :binary:`~bin.mongosh` provides a wrapper around
33
+ :dbcommand:`validate`.
34
+
31
35
Syntax
32
36
------
33
37
@@ -96,6 +100,9 @@ The command takes the following fields:
96
100
Behavior
97
101
--------
98
102
103
+ Performance
104
+ ~~~~~~~~~~~
105
+
99
106
The :dbcommand:`validate` command can be slow, particularly on
100
107
larger data sets.
101
108
@@ -105,6 +112,17 @@ until the operation finishes. When run on a secondary, the
105
112
:dbcommand:`validate` operation can block all other operations on that
106
113
secondary until it finishes.
107
114
115
+ .. warning::
116
+
117
+ Due to the performance impact of validation, consider running
118
+ :dbcommand:`validate` only on :term:`secondary` replica set nodes.
119
+ You can use :method:`rs.stepDown()` to instruct the current
120
+ :term:`primary` node to become a secondary to avoid impacting a live
121
+ primary node.
122
+
123
+ Data Throughput Metrics
124
+ ~~~~~~~~~~~~~~~~~~~~~~~
125
+
108
126
.. include:: /includes/extracts/4.4-validate-data-throughput.rst
109
127
110
128
Restrictions
Original file line number Diff line number Diff line change @@ -97,17 +97,29 @@ following optional document parameter with the fields:
97
97
Behavior
98
98
--------
99
99
100
+ Performance
101
+ ~~~~~~~~~~~
102
+
100
103
The :method:`db.collection.validate()` method is potentially resource
101
- intensive and may impact the performance of your MongoDB instance.
104
+ intensive and may impact the performance of your MongoDB instance,
105
+ particularly on larger data sets.
102
106
103
107
The :method:`db.collection.validate()` method obtains an exclusive lock
104
108
on the collection. This will block all reads and writes on the
105
109
collection until the operation finishes. When run on a secondary, the
106
110
operation can block all other operations on that secondary until it
107
111
finishes.
108
112
109
- The :method:`db.collection.validate()` method can be slow, particularly
110
- on larger data sets.
113
+ .. warning::
114
+
115
+ Due to the performance impact of validation, consider running
116
+ :method:`db.collection.validate()` only on :term:`secondary` replica
117
+ set nodes. You can use :method:`rs.stepDown()` to instruct the
118
+ current :term:`primary` node to become a secondary to avoid
119
+ impacting a live primary node.
120
+
121
+ Data Throughput Metrics
122
+ ~~~~~~~~~~~~~~~~~~~~~~~
111
123
112
124
.. include:: /includes/extracts/4.4-validate-data-throughput.rst
113
125
You can’t perform that action at this time.
0 commit comments