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

Global snapshot reads fail with SnapshotTooOld error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.4
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Sharding 2018-04-23
    • 62

      global snapshot find and aggregate intermittently fails with SnapshotTooOld error even with retries, This indicates that the snapshot window is just too short.

              assert.soon(() => {
                  const res = sessionDb.runCommand(cmdObj);
                  if (!res.ok) {
                      assert(res.code === ErrorCodes.SnapshotTooOld ||
                                 res.code === ErrorCodes.TransactionAborted,
                             "expected command to fail with SnapshotTooOld or TransactionAborted, cmd: " 
                                 tojson(cmdObj) + ", result: " + tojson(res));
                      print("Retrying because of SnapshotTooOld or TransactionAborted error.");
                      txnNumber++;
                      cmdObj.txnNumber = NumberLong(txnNumber);
                      return false;
                  }
      
                  assert.commandWorked(res, "expected command to succeed, cmd: " + tojson(cmdObj));
                  return true;
              });
      

      Thnis is a test case where cmd is any mongos find or aggregate commands with readConcern:

      {snapshot: true}

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: