Skip to content

Commit ef16bc6

Browse files
DOCS-15178 ftdc failure fatal mongos (#4000) (#4137)
* Docs 15178 ftdc failure fatal mongos (#4000) * First draft updating mongos/mongod info to state FTDC thread failures are fatal * Fixed merged content * Removed self-reference links * Removed self-reference links * Removed mention of behavior change from 3.x * Internal review feedback * Internal review feedback * Fixed future tense and latin in main mongod/mongos topics * Added missing ref
1 parent 4ae42c6 commit ef16bc6

File tree

7 files changed

+468
-459
lines changed

7 files changed

+468
-459
lines changed

source/administration/analyzing-mongodb-performance.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,11 @@ The following profiling levels are available:
145145
Full Time Diagnostic Data Capture
146146
---------------------------------
147147

148-
To facilitate analysis of the MongoDB server behavior by MongoDB Inc.
149-
engineers, :binary:`mongod` and :binary:`mongos` processes include a
150-
Full Time Diagnostic Data Collection (FTDC) mechanism. FTDC data files
151-
are compressed, are not human-readable, and inherit the same file access
152-
permissions as the MongoDB data files. Only users with access to FTDC
153-
data files can transmit the FTDC data. MongoDB Inc. engineers cannot
154-
access FTDC data independent of system owners or operators. MongoDB
155-
processes run with FTDC on by default. For more information on MongoDB
156-
Support options, visit
157-
`Getting Started With MongoDB Support <https://www.mongodb.com/support/get-started?tck=docs_server>`_.
148+
To help MongoDB engineers analyze server behavior, :binary:`~bin.mongod` and
149+
:binary:`~bin.mongos` processes include a Full Time Diagnostic Data
150+
Capture (FTDC) mechanism. FTDC is enabled by default. Due to its
151+
importance in debugging deployments, FTDC thread failures are fatal and
152+
stop the parent ``mongod`` or ``mongos`` process.
158153

159154
.. important:: FTDC Privacy
160155

source/core/sharded-cluster-query-router.txt

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
.. _sharded-cluster-query-routing:
32
.. _sharding-read-operations:
43

@@ -15,21 +14,21 @@ mongos
1514
:class: singlecol
1615

1716
MongoDB :binary:`~bin.mongos` instances route queries and write operations
18-
to :term:`shards <shard>` in a sharded cluster. :binary:`~bin.mongos` provide the
17+
to :term:`shards <shard>` in a sharded cluster. ``mongos`` provides the
1918
only interface to a sharded cluster from the perspective of
2019
applications. Applications never connect or communicate directly with
2120
the shards.
2221

23-
The :binary:`~bin.mongos` tracks what data is on which shard by caching
22+
The ``mongos`` tracks what data is on which shard by caching
2423
the metadata from the :ref:`config servers
25-
<sharded-cluster-config-server>`. The :binary:`~bin.mongos` uses the
24+
<sharded-cluster-config-server>`. The ``mongos`` uses the
2625
metadata to route operations from applications and clients to the
27-
:binary:`~bin.mongod` instances. A :binary:`~bin.mongos` has no *persistent*
26+
:binary:`~bin.mongod` instances. A ``mongos`` has no *persistent*
2827
state and consumes minimal system resources.
2928

30-
The most common practice is to run :binary:`~bin.mongos` instances on the
29+
The most common practice is to run ``mongos`` instances on the
3130
same systems as your application servers, but you can maintain
32-
:binary:`~bin.mongos` instances on the shards or on other dedicated
31+
``mongos`` instances on the shards or on other dedicated
3332
resources. See also :ref:`sharded-cluster-components-distribution`.
3433

3534
Routing And Results Process
@@ -43,51 +42,45 @@ cluster>` by:
4342

4443
#. Establishing a cursor on all targeted shards.
4544

46-
The :binary:`~bin.mongos` then merges the data from each of the
45+
The ``mongos`` then merges the data from each of the
4746
targeted shards and returns the result document. Certain
4847
query modifiers, such as :ref:`sorting<sharding-mongos-sort>`,
49-
are performed on each shard before :binary:`~bin.mongos`
48+
are performed on each shard before ``mongos``
5049
retrieves the results.
5150

52-
.. versionchanged:: 3.6
53-
54-
For :ref:`aggregation operations <aggregation-pipeline>` that
55-
run on multiple shards, if the operations do not require running on
56-
the database's :term:`primary shard`, these operations may route the
57-
results back to the :binary:`~bin.mongos` where the results are then
58-
merged.
51+
:ref:`Aggregation operations <aggregation-pipeline>` running on multiple
52+
shards may route results back to the :binary:`~bin.mongos` to merge results if they don't need to run on the database's :term:`primary shard`.
5953

60-
There are two cases in which a pipeline is ineligible to run on
61-
:binary:`~bin.mongos`.
54+
There are two cases in which a pipeline is ineligible to run on
55+
:binary:`~bin.mongos`.
6256

63-
The first case occurs when the merge part of the split pipeline
64-
contains a stage which *must* run on a primary shard. For instance,
65-
if ``$lookup`` requires access to an unsharded collection in the same
66-
database as the sharded collection on which the aggregation is running,
67-
the merge is obliged to run on the primary shard.
68-
69-
The second case occurs when the merge part of the split pipeline
70-
contains a stage which may write temporary data to disk, such as
71-
``$group``, and the client has specified ``allowDiskUse:true``. In this
72-
case, assuming that there are no other stages in the merge pipeline
73-
which require the primary shard, the merge will run on a
74-
randomly-selected shard in the set of shards targeted by the
75-
aggregation.
76-
77-
For more information on how the work of aggregation is split among
78-
components of a sharded cluster query, use ``explain:true`` as a
79-
parameter to the :method:`~db.collection.aggregate()` call. The
80-
return will include three json objects. ``mergeType`` shows where the
81-
stage of the merge happens ("primaryShard", "anyShard", or "mongos").
82-
``splitPipeline`` shows which operations in your pipeline have run on
83-
individual shards. ``shards`` shows the work each shard has done.
57+
The first case occurs when the merge part of the split pipeline
58+
contains a stage which *must* run on a primary shard. For instance,
59+
if ``$lookup`` requires access to an unsharded collection in the same
60+
database as the sharded collection on which the aggregation is running,
61+
the merge is obliged to run on the primary shard.
62+
63+
The second case occurs when the merge part of the split pipeline
64+
contains a stage which may write temporary data to disk, such as
65+
``$group``, and the client has specified ``allowDiskUse:true``. In this
66+
case, assuming that there are no other stages in the merge pipeline
67+
which require the primary shard, the merge runs on a
68+
randomly-selected shard in the set of shards targeted by the aggregation.
69+
70+
For more information on how the work of aggregation is split among
71+
components of a sharded cluster query, use ``explain:true`` as a
72+
parameter to the :method:`~db.collection.aggregate()` call. The
73+
return includes three json objects. ``mergeType`` shows where the
74+
stage of the merge happens ("primaryShard", "anyShard", or "mongos").
75+
``splitPipeline`` shows which operations in your pipeline have run on
76+
individual shards. ``shards`` shows the work each shard has done.
8477

8578
In some cases, when the :term:`shard key` or a prefix of the shard key
8679
is a part of the query, the :binary:`~bin.mongos` performs a
8780
:ref:`targeted operation<sharding-mongos-targeted>`, routing queries to
8881
a subset of shards in the cluster.
8982

90-
:binary:`~bin.mongos` performs a :ref:`broadcast
83+
``mongos`` performs a :ref:`broadcast
9184
operation<sharding-mongos-broadcast>` for queries that do *not* include the
9285
:term:`shard key`, routing queries to *all* shards in the cluster. Some
9386
queries that do include the shard key may still result in a broadcast
@@ -97,9 +90,9 @@ selectivity of the query.
9790
See :ref:`sharding-query-isolation` for more on targeted and
9891
broadcast operations.
9992

100-
Starting in MongoDB 4.4, :binary:`~bin.mongos` can support :ref:`hedge
101-
reads <mongos-hedged-reads>` to minimize latencies. See :ref:`hedge
102-
reads <mongos-hedged-reads>` for more information.
93+
``mongos`` can support :ref:`hedged reads <mongos-hedged-reads>` to
94+
minimize latencies. See :ref:`hedged reads <mongos-hedged-reads>` for
95+
more information.
10396

10497
How ``mongos`` Handles Query Modifiers
10598
--------------------------------------
@@ -131,7 +124,7 @@ from the shards and skips the appropriate number of documents when assembling
131124
the complete result.
132125

133126
When used in conjunction with a :method:`~cursor.limit()`, the
134-
:binary:`~bin.mongos` will pass the *limit* plus the value of the
127+
:binary:`~bin.mongos` passes the *limit* plus the value of the
135128
:method:`~cursor.skip()` to the shards to improve the efficiency of these
136129
operations.
137130

@@ -366,6 +359,11 @@ fCV Compatibility
366359

367360
.. include:: /includes/fact-mongos-fcv.rst
368361

362+
Full Time Diagnostic Data Capture Requirements
363+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
364+
365+
.. include:: /includes/fact-mongod-mongos-ftdc-thread.rst
366+
369367

370368
Connection Pools
371369
~~~~~~~~~~~~~~~~
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:binary:`~bin.mongod` includes a :ref:`Full Time Diagnostic Data Capture
2+
<ftdc-stub>` mechanism to assist MongoDB engineers with troubleshooting
3+
deployments. If this thread fails, it terminates the originating process.
4+
To avoid the most common failures, confirm that the user running the
5+
process has permissions to create the FTDC ``diagnostic.data``
6+
directory. For ``mongod`` the directory is within
7+
:setting:`storage.dbPath`. For ``mongos`` it is parallel to :setting:`systemLog.path`.

0 commit comments

Comments
 (0)