[COMPASS-6649] Timeseries collection selection in compass triggers 2 inefficient count operations. Created: 27/Mar/23  Updated: 29/Oct/23  Resolved: 12/Apr/23

Status: Closed
Project: Compass
Component/s: Import/Export
Affects Version/s: None
Fix Version/s: 1.36.3

Type: Bug Priority: Major - P3
Reporter: Alena Khineika Assignee: Rhys Howell
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS:
node.js / npm versions:
Additional info: MongoDB 6,05 and compass 1.36.1


Attachments: PNG File m1.png     PNG File m2.png    
Issue Links:
Problem/Incident
Related
is related to COMPASS-5179 Exporting a view has a delay on openi... Closed
Documentation Changes: Not Needed
Sprint: Iteration Yellowtail Amberjack, Iteration Zebrafish

 Description   

Description

Time series collection count operation executes long running expensive operation(s). This is an issue for customers with high volume of data in time series collecitons. A simple selection of the collection in compass results in 2 long running expensive collection scans that impact the cluster performance and have to be stopped manually.

Expected Results

Single efficient scan with expiration time.

Actual Results

Two expensive collection scans. Example from local reproduction with MongoDB 6,05 and compass 1.36.1

Additional Notes

Example logs:

{"t":{"$date":"2023-03-22T16:24:53.041+02:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn166","msg":"Slow query","attr":{"type":"command","ns":"test.TS collection","appName":"MongoDB Compass","command":{"aggregate":"TS collection","pipeline":[{"$match":{}},{"$count":"count"}],"cursor":{},"maxTimeMS":5000,"lsid":{"id":{"$uuid":"1c550366-94c4-461c-b11d-4fdab96a2c61"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1679495075,"i":1}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"planSummary":"COLLSCAN","resolvedViews":[{"viewNamespace":"test.TS collection","dependencyChain":["TS collection","system.buckets.TS collection"],"resolvedPipeline":[{"$_internalUnpackBucket":{"timeField":"ts_time_field","metaField":"date_rolled","bucketMaxSpanSeconds":86400}}]}],"keysExamined":0,"docsExamined":99958,"cursorExhausted":true,"numYields":103,"nreturned":1,"queryHash":"17830885","queryFramework":"classic","reslen":251,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":229}},"Global":{"acquireCount":{"r":229}},"Mutex":{"acquireCount":{"r":126}}},"readConcern":{"level":"local","provenance":"implicitDefault"},"writeConcern":{"w":"majority","wtimeout":0,"provenance":"implicitDefault"},"storage":{},"remote":"127.0.0.1:53122","protocol":"op_msg","durationMillis":789}}
 
{"t":{"$date":"2023-03-22T16:24:53.043+02:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn99","msg":"Slow query","attr":{"type":"command","ns":"test.TS collection","appName":"MongoDB Compass","command":{"count":"TS collection","lsid":{"id":{"$uuid":"282cbf44-e4b9-47fd-bf1e-052e1aa36960"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1679495075,"i":1}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"planSummary":"COLLSCAN","resolvedViews":[{"viewNamespace":"test.TS collection","dependencyChain":["TS collection","system.buckets.TS collection"],"resolvedPipeline":[{"$_internalUnpackBucket":{"timeField":"ts_time_field","metaField":"date_rolled","bucketMaxSpanSeconds":86400}}]}],"keysExamined":0,"docsExamined":99958,"cursorExhausted":true,"numYields":104,"nreturned":1,"queryHash":"17830885","queryFramework":"classic","reslen":166,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":231}},"Global":{"acquireCount":{"r":231}},"Mutex":{"acquireCount":{"r":127}}},"readConcern":{"level":"local","provenance":"implicitDefault"},"storage":{},"remote":"127.0.0.1:52930","protocol":"op_msg","durationMillis":791}}



 Comments   
Comment by Githook User [ 24/Apr/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(compass-import-export): remove re-count when not available COMPASS-5179, COMPASS-6649 (#4237)
Branch: COMPASS-6530-auto-add-curly-braces
https://github.com/mongodb-js/compass/commit/6975c73f04a94481b9cc28e0b2b92e10a65375a6

Comment by Githook User [ 21/Apr/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(compass-import-export): remove re-count when not available COMPASS-5179, COMPASS-6649 (#4237)
Branch: 1.36-releases
https://github.com/mongodb-js/compass/commit/6975c73f04a94481b9cc28e0b2b92e10a65375a6

Comment by Githook User [ 13/Apr/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(compass-import-export): remove re-count when not available COMPASS-5179, COMPASS-6649 (#4237)
Branch: gather-fields
https://github.com/mongodb-js/compass/commit/6975c73f04a94481b9cc28e0b2b92e10a65375a6

Comment by Githook User [ 12/Apr/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(compass-import-export): remove re-count when not available COMPASS-5179, COMPASS-6649 (#4237)
Branch: COMPASS-6655-sort-use-case
https://github.com/mongodb-js/compass/commit/6975c73f04a94481b9cc28e0b2b92e10a65375a6

Comment by Githook User [ 11/Apr/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(compass-import-export): remove re-count when not available COMPASS-5179, COMPASS-6649 (#4237)
Branch: COMPASS-6676-support-for-stage-wizard-in-stage-editor-store
https://github.com/mongodb-js/compass/commit/6975c73f04a94481b9cc28e0b2b92e10a65375a6

Comment by Githook User [ 11/Apr/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(compass-import-export): remove re-count when not available COMPASS-5179, COMPASS-6649 (#4237)
Branch: 1.36-releases
https://github.com/mongodb-js/compass/commit/8ebe5bada48fbe0c3478047a1025328f36bcc947

Comment by Githook User [ 11/Apr/23 ]

Author:

{'name': 'Rhys', 'email': 'Anemy@users.noreply.github.com', 'username': 'Anemy'}

Message: fix(compass-import-export): remove re-count when not available COMPASS-5179, COMPASS-6649 (#4237)
Branch: main
https://github.com/mongodb-js/compass/commit/6975c73f04a94481b9cc28e0b2b92e10a65375a6

Generated at Wed Feb 07 22:43:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.