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

Fix barrier in waitForShardCursor function in change_streams_shards_start_in_sync.js

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • v5.0, v4.4, v4.2, v4.0
    • 24

    Description

      The waitForCursor function acts as a barrier in the mentioned test by querying currentOp to determine if the cursor has been established. It uses the following expression to determine this:

      function waitForShardCursor(rs) {
          assert.soon(() => rs.getPrimary()
                                .getDB('admin')
                                .aggregate([
                                    {"$currentOp": {"idleCursors": true}},
                                    {"$match": {ns: mongosColl.getFullName(), type: "idleCursor"}}
       
                                ])
                                .itcount() === 1);
      }
      

      In failing runs, this function exits early meaning that some other code has established an idle cursor according to the criteria above. We should change the test so that the condition is strong enough to only consider the cursor established in the test.

      Attachments

        Activity

          People

            bernard.gorman@mongodb.com Bernard Gorman
            lamont.nelson@mongodb.com Lamont Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: