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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 4.1.10
    • Fix Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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();
    • Sprint:
      Repl 2019-05-20
    • Linked BF Score:
      10

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: