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

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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9.0
    • Component/s: Querying, Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query Execution 2021-04-19, Query Execution 2021-05-03

      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
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: