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

Read commands that check out the session and use speculative majority read concern may hit invariant inside DBDirectClient call

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.1.10
    • Component/s: Replication
    • Labels:
      None
    • ALL
    • Hide
      const name = "bf-12790_repro";
      const replTest = new ReplSetTest({
          name: name,
          nodes: [{}],
          nodeOptions: {enableMajorityReadConcern: 'false'}
      });
      replTest.startSet();
      replTest.initiate();
      
      const dbName = name;
      const collName = "coll";
      
      let primary = replTest.getPrimary();
      const session = primary.startSession({causalConsistency: false});
      const sessionDb = session.getDatabase(dbName);
      const sessionColl = sessionDb[collName];
      
      // Triggers invariant.
      let res = sessionDb.runCommand({
          find: collName,
          readConcern: {level: 'majority'},
          allowSpeculativeMajorityRead: true,
          txnNumber: NumberLong(1)
      });
      
      replTest.stopSet();
      
      Show
      const name = "bf-12790_repro" ; const replTest = new ReplSetTest({ name: name, nodes: [{}], nodeOptions: {enableMajorityReadConcern: ' false ' } }); replTest.startSet(); replTest.initiate(); const dbName = name; const collName = "coll" ; let primary = replTest.getPrimary(); const session = primary.startSession({causalConsistency: false }); const sessionDb = session.getDatabase(dbName); const sessionColl = sessionDb[collName]; // Triggers invariant. let res = sessionDb.runCommand({ find: collName, readConcern: {level: 'majority' }, allowSpeculativeMajorityRead: true , txnNumber: NumberLong(1) }); replTest.stopSet();
    • Repl 2019-05-20
    • 10

      Running a speculative majority read command that checks out the session (by, example, including a 'txnNumber') may hit this invariant when trying to read from the transactions table via DBDirectClient here, which may be called when we check out a session. We may be able to fix this by returning immediately inside waitForSpeculativeMajorityReadConcern if we are inside a direct client.

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            william.schultz@mongodb.com William Schultz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: