[SERVER-56052] [sbe][sharding] merge_stale_on_fields.js does not throw exception Created: 12/Apr/21  Updated: 29/Oct/23  Resolved: 26/Apr/21

Status: Closed
Project: Core Server
Component/s: Querying, Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Kyle Suarez Assignee: Arun Banala
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File merge_stale_on_fields.txt    
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-04-19, Query Execution 2021-05-03
Participants:

 Description   

Task link

The test spawns a parallel shell with the following jstest code evaluated as a --eval argument. (Note the excessive quote escaping is due to this code itself being a string.)

TestData = { 
    \"minPort\" : 20020,
    \"maxPort\" : 20249,
    \"peerPids\" : [ ],
    \"alwaysUseLogFiles\" : false,
    \"failIfUnterminatedProcesses\" : true,
    \"isMainTest\" : true,
    \"numTestClients\" : 1,
    \"backupOnRestartDir\" : null,
    \"enableMajorityReadConcern\" : true,
    \"mixedBinVersions\" : \"\",
    \"noJournal\" : false,
    \"storageEngine\" : \"wiredTiger\",
    \"storageEngineCacheSizeGB\" : \"1\",
    \"testName\" : \"merge_stale_on_fields\",
    \"transportLayer\" : \"\",
    \"wiredTigerCollectionConfigString\" : \"\",
    \"wiredTigerEngineConfigString\" : \"\",
    \"wiredTigerIndexConfigString\" : \"\",
    \"inEvergreen\" : true,
    \"setParameters\" : { 
        \"featureFlagSBE\" : \"true\",
        \"featureFlagTimeseriesCollection\" : \"true\",
        \"logComponentVerbosity\" : { 
            \"replication\" : { 
                \"election\" : 4,
                \"heartbeats\" : 2,
                \"initialSync\" : 2,
                \"rollback\" : 2 
            },  
            \"sharding\" : { 
                \"migration\" : 2 
            },  
            \"storage\" : { 
                \"recovery\" : 2 
            },  
            \"transaction\" : 4,
            \"tenantMigration\" : 4 
        },  
        \"reshardingMinimumOperationDurationMillis\" : 5000
    },  
    \"setParametersMongos\" : { 
        \"featureFlagSBE\" : \"true\",
        \"featureFlagTimeseriesCollection\" : \"true\",
        \"logComponentVerbosity\" : { 
            \"transaction\" : 3 
        }   
    },  
    \"setParametersMongocryptd\" : { 
        
    },  
    \"undoRecorderPath\" : null,
    \"transactionLifetimeLimitSeconds\" : 86400,
    \"traceExceptions\" : undefined
};
const source = db.getSiblingDB(\"merge_stale_unique_key\").source;
const error = assert.throws(() => source.aggregate([
    {$addFields: {sk: \"$_id\"}},
    {$merge: {  \"into\" : \"target\",  \"whenMatched\" : \"replace\",  \"whenNotMatched\" : \"discard\" }} // <---- does not throw
]));
assert.eq(error.code, ErrorCodes.StaleEpoch);                                   

We don't get the expected exception with ErrorCodes.StaleEpoch:

[js_test:merge_stale_on_fields] sh2371| uncaught exception: Error: did not throw exception :
[js_test:merge_stale_on_fields] sh2371| doassert@src/mongo/shell/assert.js:20:14
[js_test:merge_stale_on_fields] sh2371| assert.throws@src/mongo/shell/assert.js:577:13
[js_test:merge_stale_on_fields] sh2371| @(shell eval):57:31
[js_test:merge_stale_on_fields] sh2371| exiting with code -4



 Comments   
Comment by Githook User [ 22/Apr/21 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-56052 Enable merge_stale_on_fields.js test in SBE
Branch: master
https://github.com/mongodb/mongo/commit/2af92ac262fc478255daa7b699da867914710df5

Generated at Thu Feb 08 05:38:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.