Skip to content

Commit 861b3f4

Browse files
author
Bob Grabar
committed
DOCS-437 added oplog error to rs troubleshooting
1 parent 1727e25 commit 861b3f4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

source/administration/replica-sets.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,8 @@ Possible causes of replication lag include:
652652
Failover and Recovery
653653
~~~~~~~~~~~~~~~~~~~~~
654654

655+
.. TODO Revisit whether this belongs in troubleshooting. Perhaps this should be an H2 before troubleshooting.
656+
655657
Replica sets feature automated failover. If the :term:`primary`
656658
goes offline or becomes unresponsive and a majority of the original
657659
set members can still connect to each other, the set will elect a new
@@ -695,3 +697,38 @@ You can prevent rollbacks by ensuring safe writes by using
695697
the appropriate :term:`write concern`.
696698

697699
.. include:: /includes/seealso-elections.rst
700+
701+
Oplog Entry Error
702+
~~~~~~~~~~~~~~~~~
703+
704+
.. TODO link this topic to assertion 13290 once assertion guide exists.
705+
706+
If you receive the following errors:
707+
708+
.. code-block:: javascript
709+
710+
replSet error fatal couldn't query the local local.oplog.rs collection. Terminating mongod after 30 seconds.
711+
bad replSet oplog entry?
712+
713+
Then the errors might indicate that the ``ts`` field in the last oplog
714+
entry is of the wrong data type.
715+
716+
You can check this with the following command:
717+
718+
.. code-block:: javascript
719+
720+
db.oplog.rs.find({ts:{$type:17}}).({$natural:-1}).limit(1)
721+
722+
If the ts field is of the wrong type, you receive the same error.
723+
724+
To verify there are no other issues, run the following command:
725+
726+
db.oplog.rs.find().({$natural:-1}).limit(1)
727+
728+
If there are no other issues, this returns without error.
729+
730+
To fix the ``ts`` data type, run the following:
731+
732+
.. code-block:: javascript
733+
734+
db.oplog.rs.update({ts:{t:1234567891000,i:1234}}, {$set:{ts:new Timestamp(1234567891000, 1234)}})

0 commit comments

Comments
 (0)