[SERVER-25376] Add a hook to check that oplogs in a replset do not diverge Created: 01/Aug/16  Updated: 21/Jul/17  Resolved: 30/Sep/16

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: 3.3.10
Fix Version/s: 3.4.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Robert Guo (Inactive) Assignee: Jonathan Abrahams
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-28868 Set noCursorTimeout option on oplog c... Closed
related to SERVER-26466 Add checkOplogs test to concurrency s... Closed
related to SERVER-30256 Expand testing for initial sync in ca... Closed
Backwards Compatibility: Fully Compatible
Sprint: TIG 2016-10-10
Participants:

 Description   

Add a hook or modify the dbhash hook to check that the oplog matches across replicaset members after calling ReplSetTest.awaitReplication()

This can't be done with a simple dbhash comparison because the oplog is a capped collection and the number of documents may not match. We will need to traverse the oplog and ensure that they have a common history by comparing each entry manually.



 Comments   
Comment by Githook User [ 02/Oct/16 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-25376 Disable checkOplogs in concurrency tests, since they cause the test to time out due to frequents queries with a COLLSCAN for large oplogs.
Branch: master
https://github.com/mongodb/mongo/commit/404bb959dbf894c9c238dc712ebeccb2687b8f32

Comment by Githook User [ 30/Sep/16 ]

Author:

{u'username': u'hptabster', u'name': u'Jonathan Abrahams', u'email': u'jonathan@mongodb.com'}

Message: SERVER-25376 Add checkOplog hook for replica sets
Branch: master
https://github.com/mongodb/mongo/commit/d4b173439ae08f1c0c71191eb93fd1164245c351

Comment by Jonathan Abrahams [ 22/Sep/16 ]

The proposed logic is to traverse backwards through the oplog on the primary, conn.getDB('local').getCollection('oplog.rs').find().sort({$natural: -1}), and compare each corresponding document on a secondary until the cursor is exhausted on primary or secondary, or documents fail to match. If there's a failure, dump oplog entries from both nodes that surround the failure.

Comment by Judah Schvimer [ 01/Aug/16 ]

We should add this hook to the initial sync passthrough as well after we wait for the initial sync node to get into secondary mode but before we CleanEveryN

Generated at Thu Feb 08 04:09:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.