[SERVER-28455] Implement LogicalClockFixture Created: 23/Mar/17  Updated: 06/Dec/17  Resolved: 01/May/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.5.7

Type: Task Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Jack Mulrow
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2017-05-08
Participants:

 Description   

Set up a mocked-up objects for testing replica-set causal consistent reads.
The fixture should provide the following functionality:

  • set LogicalClock
  • write to an opLog
  • read from an opLog
  • write to secondary and primary nodes (separately by setting repl coordinator mode)
  • read from the secondary and primary nodes
  • clocksource skew
  • disable/enable readConcernMajority

Implementation:

  • Use existing LogicalClockTest class can be used as a base, inherit from ShardingMongodTestFixture
  • override setUp to
    a) set up logicalClock on serviceContext
    b) add a clockSource mock
    c) add a keyManager mock
  • Integrate functionality from logical_clock_test.cpp and reuse the new fixture there.
  • Add one test that causes a write to opLog and check that the result matches the current clusterTime - may be using get lastAppliedOptime() method of replicationCoordinator


 Comments   
Comment by Githook User [ 01/May/17 ]

Author:

{u'username': u'jsmulrow', u'name': u'Jack Mulrow', u'email': u'jack.mulrow@mongodb.com'}

Message: SERVER-28455 Implement LogicalClockTestFixture
Branch: master
https://github.com/mongodb/mongo/commit/362acc0a59396322db5e5b6d845875d83e76cc0e

Comment by Misha Tyulenev [ 27/Apr/17 ]

renctan write/read to/from secondary and primary nodes here I mean the mocked up primary/secondary from the replication_coordinator_mock point
clocksource skew - set the mocktime in the future and in the past with respect to the current clusterTime
disable/enable readConcernMajority on the server, when its disabled the readConcern:

{level:"majority"}

will fail.

Comment by Randolph Tan [ 26/Apr/17 ]
  • write to secondary and primary nodes (separately by setting repl coordinator mode)
  • read from the secondary and primary nodes

Can you clarify what this means? Are the primary and secondary nodes remote in this context? Can they be just endpoints for NetworkTestEnv?

  • clocksource skew

Can you clarify what constitutes a skew and skew relative to what?

  • disable/enable readConcernMajority

Is this enabling the feature in the server or just enabling in the request?

Comment by Misha Tyulenev [ 25/Apr/17 ]

renctan For the test the value returned with getLastAppliedOpTime will suffice. The ClockSourceMock is what is needed for this fixture, thanks!

Comment by Randolph Tan [ 25/Apr/17 ]

Do you actually need to be able to write to a real oplog or just need a ReplCoordinator with a configurable opTime that it returns?

Won't the existing clock source mock fit your needs?

Comment by Misha Tyulenev [ 25/Apr/17 ]

renctan wdyt?

Comment by Esha Maharishi (Inactive) [ 25/Apr/17 ]

extending from the ShardingMongodTestFixture to inherit the ServiceContext, ReplicationCoordinator, ephemeral storage engine, and OpObserver lgtm

note that it uses a ReplicationCoordinatorMock rather than a real ReplicationCoordinator - i believe it should still support the functionality you need, though

Comment by Misha Tyulenev [ 25/Apr/17 ]

esha.maharishi please ack the approach

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