[SERVER-84067] Add check to testInternalTransactions to handle invalid input Created: 11/Dec/23  Updated: 12/Dec/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kruti Shah Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Cluster Scalability
Operating System: ALL
Participants:
Linked BF Score: 14

 Description   

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.


Generated at Thu Feb 08 06:53:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.