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

[sbe][sharding] merge_stale_on_fields.js does not throw exception

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Querying, Sharding
    • None
    • Fully Compatible
    • Query Execution 2021-04-19, Query Execution 2021-05-03

      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
      

        1. merge_stale_on_fields.txt
          3.02 MB
          Kyle Suarez

            Assignee:
            arun.banala@mongodb.com Arun Banala
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: