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

rs.compareOpTimes() throws exception when comparing with empty OpTime

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.3, 3.5.2
    • Component/s: Replication
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Sprint:
      Repl 2016-12-12, Repl 2017-01-23

      Description

      This is causing a lot of exceptions to be thrown in tests that look like errors but are really expected behavior. If we want an exception to be thrown, an empty optime should be a special case with a different message or at least the error should print the optimes. An example is here:
      https://logkeeper.mongodb.org/build/7372a5210d84ad648172a4ad21da6892/test/582a3e90be07c4674504e874#L436

      The following throws an exception, when the empty OpTime should probably just be considered earlier.

      rs.compareOpTimes({ts: Timestamp(1,2), t:3}, {ts:Timestamp(0,0), t: -1});
      2016-11-14T19:07:40.363-0500 E QUERY    [main] Error: cannot compare optimes between different protocol versions :
      rs.compareOpTimes@src/mongo/shell/utils.js:1340:1
      @(shell):1:1
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: