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

Add check to testInternalTransactions to handle invalid input

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • ALL
    • QO 2024-07-22
    • 0

      A jstestfuzz generated a testInternalTransactions command that triggered a debug-only assertions (e.g. if (kDebugBuild) {crash();} ) on invalid input because lsid was improperly defined.

      {
       testInternalTransactions: 1,    
       commandInfos: [{
             dbName: dbName,
             command: {insert: collName, lsid: [{$undefined: true}]}     
       }]
      } 

      testInternalTransactions gets a commandInfos object that specifies the command to be run inside the transaction. In the processing of the command, the transaction code primes the transaction, appends relevant fields to the commandInfo(clientsession, lsid, txnNumber, etc.) and attempts to serialize the opMsg. This debug-only fassert fails while serializing the opMsg complaining of a duplicate fieldname: lsid.

      Add a check in testInternalTransactions to ensure lsid is properly defined(if present in the commandInfo) before attempting to serialize the opMsg to avoid hitting the fassert.

            Assignee:
            lynne.wang@mongodb.com Lynne Wang
            Reporter:
            kruti.shah@mongodb.com Kruti Shah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: