Skip to content

Commit 4ba8a9e

Browse files
author
Sam Kleinman
committed
minor: edits for DOCS-437
1 parent 725c2b6 commit 4ba8a9e

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

source/administration/replica-sets.txt

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -707,46 +707,45 @@ Oplog Entry Timestamp Error
707707

708708
.. TODO link this topic to assertion 13290 once assertion guide exists.
709709

710-
If you receive the following error:
710+
Consider the following error in :program:`mongod` output and logs:
711711

712712
.. code-block:: javascript
713713

714714
replSet error fatal couldn't query the local local.oplog.rs collection. Terminating mongod after 30 seconds.
715715
<timestamp> [rsStart] bad replSet oplog entry?
716716

717-
Then the value for the ``ts`` field in the last oplog entry might be of
718-
the wrong data type. The correct data type is Timestamp.
717+
The most often cause of this error is wrongly typed value for the
718+
``ts`` field in the last :term:`oplog` entry might be of the wrong
719+
data type. The correct data type is Timestamp.
719720

720-
You can check the data type by running the following two queries against the oplog. If the
721-
data type is correct, the queries return the same document; if
722-
incorrect, they return different documents.
723-
724-
First run a query to return the last document in the oplog:
721+
You can check the data type by running the following two queries
722+
against the oplog. If the data is properly typed, the queries will
723+
return the same document, otherwise these queries will return
724+
different documents. These queries are:
725725

726726
.. code-block:: javascript
727727

728728
db.oplog.rs.find().sort({$natural:-1}).limit(1)
729-
730-
Then run a query to return the last document in the oplog where the
731-
``ts`` value is a Timestamp. Use the :operator:`$type` operator to query
732-
for type ``17``, which is the Timestamp data type.
733-
734-
.. code-block:: javascript
735-
736729
db.oplog.rs.find({ts:{$type:17}}).sort({$natural:-1}).limit(1)
737730

731+
The first query returns the last document in the oplog, while the
732+
second returns the last document in the oplog where the ``ts`` value
733+
is a Timestamp. The :operator:`$type` operator allows you to select
734+
for type 17 ``BSON``, which is the Timestamp data type.
735+
738736
If the queries don't return the same document, then the last document in
739737
the oplog has the wrong data type in the ``ts`` field.
740738

741739
.. example::
742740

743-
As an example, if the first query returns this as the last oplog entry:
741+
If the first query returns this as the last oplog entry:
744742

745743
.. code-block:: javascript
746744

747745
{ "ts" : {t: 1347982456000, i: 1}, "h" : NumberLong("8191276672478122996"), "op" : "n", "ns" : "", "o" : { "msg" : "Reconfig set", "version" : 4 } }
748746

749-
And the second query returns this as the last entry where ``ts`` is a Timestamp:
747+
And the second query returns this as the last entry where ``ts``
748+
has the ``Timestamp`` type:
750749

751750
.. code-block:: javascript
752751

@@ -755,10 +754,13 @@ the oplog has the wrong data type in the ``ts`` field.
755754
Then the value for the ``ts`` field in the last oplog entry is of the
756755
wrong data type.
757756

758-
To fix the ``ts`` data type, you can run the following update. Note,
759-
however, that this update scans the whole oplog and can take a lot of
760-
time to pull the oplog into memory:
757+
To set the proper type for this value and resolve this issue,
758+
use an update operation that resembles the following:
761759

762760
.. code-block:: javascript
763761

764762
db.oplog.rs.update({ts:{t:1347982456000,i:1}}, {$set:{ts:new Timestamp(1347982456000, 1)}})
763+
764+
Modify the timestamp values as needed based on your oplog entry. This
765+
operation may take some period to complete because the update must
766+
scan and pull the entire oplog into memory.

0 commit comments

Comments
 (0)