Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27788

Add tests for operationTime

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.6
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2017-03-27, Sharding 2017-04-17

      Validate that the operationTime value depends on the read/writeConcern of the read or write command that produced it:

      • read with readConcern level majority: operationTime is the logical time of the last op in the oplog, in the snapshot blessed as ‘committed’.
        start standalone RS, issue a w:majority write, read operationTime OT1 from the result,
        pause the secondary replication using a failpoint,
        issue another w:1 write and get the operationTime OT2.
        Validate that read with readConcern: {level:majority, afterClusterTime: OT1}

        returns the data from write 1 and the operationTime in the response is OT1

      • read with readConcern level local: operationTime is the logical time of the last op in the oplog.
        check that it is not supported (as of now)
      • write with writeConcern majority: operationTime is the logical time of the write (if successful) or the previous successful write at the time the write was determined to have failed or a no-op.
        start standalone RS, issue a w:majority write, read operationTime OT1 from the result,
        pause the secondary replication using a failpoint,
        issue another a write that will fail (e.g _id that is duplicates the previous insert)
        read operationTime OT2 from the response and validate that OT2 == OT1

            Assignee:
            jack.mulrow@mongodb.com Jack Mulrow
            Reporter:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: