[SERVER-34965] Fix mongos_merge.js by clearing the profiler before each set of tests Created: 11/May/18  Updated: 29/Oct/23  Resolved: 15/May/18

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Bernard Gorman Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Query 2018-05-21
Participants:
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.



 Comments   
Comment by Githook User [ 15/May/18 ]

Author:

{'email': 'bernard.gorman@gmail.com', 'username': 'gormanb', 'name': 'Bernard Gorman'}

Message: SERVER-34965 Fix mongos_merge.js by clearing the profiler before each set of tests
Branch: master
https://github.com/mongodb/mongo/commit/c751a7d30f394fc6daefebfbfe7538db9b1b6c89

Generated at Thu Feb 08 04:38:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.