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

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

      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.

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

              Created:
              Updated:
              Resolved: