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

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.0-rc0
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Fully Compatible
    • Query 2018-05-21
    • 18

      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.

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

              Created:
              Updated:
              Resolved: