Skip to content

DOCS-1492 tables: configureFailPoint #1054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions source/reference/command/configureFailPoint-field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
object:
name: configureFailPoint
type: dbcommand
field:
optional: false
type: field
name: configureFailPoint
type: string
position: 1
description: "The name of the failure point."
---
object:
name: configureFailPoint
type: dbcommand
field:
optional: false
type: field
name: mode
type:
- document
- string
position: 2
description: |
Controls the behavior of a failure point. The possible values are
``alwaysOn``, ``off``, or a document in the form of ``{times: n}``
that specifies the number of times the failure point remains on
before it deactivates. The maximum value for the number is a
32-bit signed integer.
---
object:
name: configureFailPoint
type: dbcommand
field:
optional: true
type: field
name: data
type: document
position: 3
description: |
Passes in additional data for use in configuring the fail point. For
example, to imitate a slow connection pass in a document that
contains a delay time.
...
35 changes: 27 additions & 8 deletions source/reference/command/configureFailPoint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,38 @@ configureFailPoint

.. default-domain:: mongodb

Definition
----------

.. dbcommand:: configureFailPoint

:dbcommand:`configureFailPoint` is an internal testing command that
configures failure points.
This is an internal testing command that onfigures a failure point
that you can turn on and off while MongoDB runs. To use this command,
:program:`mongod` must run with the :parameter:`enableTestCommands`
parameter enabled. You can enable the parameter from the command line
using the :option:`--setParameter <mongod --setParameter>` option:

.. code-block:: javascript

--setParameter enableTestCommands=1

Issue the :dbcommand:`configureFailPoint` command against the
:term:`admin database`. The command takes the following form:

.. code-block:: javascript

{configureFailPoint: "<failure_point>", mode: <behavior> }

The command contains the following fields:

.. include:: /reference/command/configureFailPoint-field.rst

:param string: Specifies the name of the failure point.
Example
-------

:param string mode: Controls behavior of failure point. Possible
values are: ``alwaysOn`` and ``off``.
.. code-block:: javascript

:param mode: Specify a document ``{times: n}``
to control the number of times that MongoDB will
activate the failure point.
db.adminCommand( { configureFailPoint: "blocking_thread", mode: {times: 21} } )

.. |dbcommand| replace:: :dbcommand:`configureFailPoint`
.. include:: /includes/note-enabletestcommands.rst