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

Fix mongos_merge.js by clearing the profiler before each set of tests

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0-rc0
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query 2018-05-21
    • Linked BF Score:
      18

      Description

      Some of the test pipelines in mongos_merge.js split in such a way that the shard cursors will not be exhausted by by time the merge half of the pipeline hits EOF, due to e.g. a merge-side $limit stage. When this happens, the ARM will schedule an asynchronous killCursors command to clean up the shard cursors.

      However, because mongos_merge.js queries the system.profile collection immediately after running the test pipeline to confirm whether the aggregation ran as expected, on rare occasions the asynchronous killCursors command will reach the shard and be profiled while the test is scanning the profiler collection. If the capped system.profile collection is already at capacity, this will cause the first entry to be removed from the collection to make space. If the test's query has yielded at the start of the capped collection when this occurs, then it will find that the collection has rolled past its last known point when it attempts to resume iteration, and will fail with CappedPositionLost as a result.

      To fix this, we should ensure that the profiler is never full by clearing it before each set of tests.

        Attachments

          Activity

            People

            Assignee:
            bernard.gorman Bernard Gorman
            Reporter:
            bernard.gorman Bernard Gorman
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: