@@ -941,26 +941,27 @@ scan and pull the entire oplog into memory.
941
941
Duplicate Key Error on local.slaves
942
942
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
943
943
944
- The *duplicate key on local.slaves* error, shown below, occurs when a
944
+ The *duplicate key on local.slaves* error, occurs when a
945
945
:term:`secondary` or :term:`slave` changes its hostname and the
946
946
:term:`primary` or :term:`master` tries to update its ``local.slaves``
947
947
collection with the new name. The update fails because it contains the
948
- same `_id` value as the document containing the previous hostname.
948
+ same `_id` value as the document containing the previous hostname. The
949
+ error itself will resemble the following.
949
950
950
- .. example::
951
-
952
- .. code-block:: javascript
951
+ .. code-block:: none
953
952
954
- exception 11000 E11000 duplicate key error index: local.slaves.$_id_ dup key: { : ObjectId('<object ID>') } 0ms
953
+ exception 11000 E11000 duplicate key error index: local.slaves.$_id_ dup key: { : ObjectId('<object ID>') } 0ms
955
954
956
- This is a benign error and does not affect replication operations on
955
+ This is benign error and does not affect replication operations on
957
956
the :term:`secondary` or :term:`slave`.
958
957
959
- To stop the error from appearing, drop the ``local.slaves`` collection
960
- from the :term:`primary` or :term:`master`, as shown here:
958
+ To prevent the error from appearing, drop the ``local.slaves``
959
+ collection from the :term:`primary` or :term:`master`, with the
960
+ following sequence of operations in the :program:`mongo` shell:
961
961
962
962
.. code-block:: javascript
963
963
964
+ use local
964
965
db.slaves.drop()
965
966
966
967
The next time a :term:`secondary` or :term:`slave` polls the
0 commit comments