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

Global snapshot reads fail with SnapshotTooOld error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.7.4
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2018-04-23
    • Linked BF Score:
      62

      Description

      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}

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: