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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.3, 3.5.2
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
    • Fully Compatible
    • ALL
    • v3.4
    • Repl 2016-12-12, Repl 2017-01-23

      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
      

            Assignee:
            jack.mulrow@mongodb.com Jack Mulrow
            Reporter:
            judah.schvimer@mongodb.com Judah Schvimer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: