Propagate pipeline comment through getMore calls on views

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When running a query pipeline on a view, the pipeline comment is not shown in the slow query logs of subsequent getMore() calls. An example output is shown below. Note how once getMore() is called, the "comment" field is no longer visible.

      (This scenario is when getMore is called through db.runCommand() without including the 'comment' argument. When including the 'comment' argument in the runCommand() call on getMore, the comment will be propagated)

       

      [j0] {"t":{"$date":"2025-07-17T18:04:57.365+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn9","msg":"Slow query","attr":{"type":"command","isFromUserConnection":true,"ns":"test.sort_on_timeseries_reports_memory_metrics_timeseries","collectionType":"timeseries","appName":"MongoDB Shell","queryShapeHash":"8E04F76C83CDD6553680F376389E6FE4A7E2CBADE32010B45B31043D5C147C16","command":{"aggregate":"sort_on_timeseries_reports_memory_metrics_timeseries","pipeline":[{"$_internalInhibitOptimization":{}},{"$sort":{"time":-1}}],"comment":"Memory stats test: Sort on timeseries collection","cursor":{"batchSize":10},"allowDiskUse":false,"lsid":{"id":{"$uuid":"1811dcd2-ac65-41d0-b92a-fccfcd373dfc"}},"$db":"test"},"planSummary":"COLLSCAN","planningTimeMicros":557,"resolvedViews":[{"viewNamespace":"test.sort_on_timeseries_reports_memory_metrics_timeseries","dependencyChain":["sort_on_timeseries_reports_memory_metrics_timeseries","system.buckets.sort_on_timeseries_reports_memory_metrics_timeseries"],"resolvedPipeline":[{"$_internalUnpackBucket":{"timeField":"time","metaField":"metadata","bucketMaxSpanSeconds":3600}}]}],"cursorid":672116388338438151,"keysExamined":0,"docsExamined":50,"hasSortStage":true,"numYields":0,"nreturned":10,"inUseMemBytes":85850,"maxUsedMemBytes":85850,"planCacheShapeHash":"4E45B701","queryHash":"4E45B701","planCacheKey":"36FF8BFB","queryFramework":"classic","reslen":11476,"locks":{"Global":{"acquireCount":{"r":4}}},"storage":{"timeWaitingMicros":{"storageExecutionMicros":5015}},"cpuNanos":8062285,"remote":"127.0.0.1:60658","protocol":"op_msg","queues":{"ingress":{"admissions":1},"execution":{"admissions":5}},"workingMillis":8,"durationMillis":8}}
      [j0] {"t":{"$date":"2025-07-17T18:04:57.382+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn9","msg":"Slow query","attr":{"type":"command","isFromUserConnection":true,"ns":"test.sort_on_timeseries_reports_memory_metrics_timeseries","collectionType":"normal","appName":"MongoDB Shell","command":{"getMore":672116388338438151,"collection":"sort_on_timeseries_reports_memory_metrics_timeseries","batchSize":10,"lsid":{"id":{"$uuid":"1811dcd2-ac65-41d0-b92a-fccfcd373dfc"}},"$db":"test"},"originatingCommand":{"aggregate":"system.buckets.sort_on_timeseries_reports_memory_metrics_timeseries","pipeline":[{"$_internalUnpackBucket":{"timeField":"time","metaField":"metadata","bucketMaxSpanSeconds":3600,"assumeNoMixedSchemaData":true,"usesExtendedRange":false,"fixedBuckets":false}},{"$_internalInhibitOptimization":{}},{"$sort":{"time":-1}}],"allowDiskUse":false,"cursor":{"batchSize":10},"collation":{"locale":"simple"}},"planSummary":"COLLSCAN","cursorid":672116388338438151,"keysExamined":0,"docsExamined":0,"hasSortStage":true,"nBatches":1,"numYields":0,"nreturned":10,"inUseMemBytes":85850,"maxUsedMemBytes":85850,"planCacheShapeHash":"4E45B701","queryHash":"4E45B701","planCacheKey":"36FF8BFB","queryFramework":"classic","reslen":11475,"locks":{},"cpuNanos":853809,"remote":"127.0.0.1:60658","protocol":"op_msg","queues":{"ingress":{"admissions":1},"execution":{}},"workingMillis":0,"durationMillis":0}}
      [j0] {"t":{"$date":"2025-07-17T18:04:57.392+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn9","msg":"Slow query","attr":{"type":"command","isFromUserConnection":true,"ns":"test.sort_on_timeseries_reports_memory_metrics_timeseries","collectionType":"normal","appName":"MongoDB Shell","command":{"getMore":672116388338438151,"collection":"sort_on_timeseries_reports_memory_metrics_timeseries","batchSize":10,"lsid":{"id":{"$uuid":"1811dcd2-ac65-41d0-b92a-fccfcd373dfc"}},"$db":"test"},"originatingCommand":{"aggregate":"system.buckets.sort_on_timeseries_reports_memory_metrics_timeseries","pipeline":[{"$_internalUnpackBucket":{"timeField":"time","metaField":"metadata","bucketMaxSpanSeconds":3600,"assumeNoMixedSchemaData":true,"usesExtendedRange":false,"fixedBuckets":false}},{"$_internalInhibitOptimization":{}},{"$sort":{"time":-1}}],"allowDiskUse":false,"cursor":{"batchSize":10},"collation":{"locale":"simple"}},"planSummary":"COLLSCAN","cursorid":672116388338438151,"keysExamined":0,"docsExamined":0,"hasSortStage":true,"nBatches":1,"numYields":0,"nreturned":10,"inUseMemBytes":85850,"maxUsedMemBytes":85850,"planCacheShapeHash":"4E45B701","queryHash":"4E45B701","planCacheKey":"36FF8BFB","queryFramework":"classic","reslen":11475,"locks":{},"cpuNanos":787979,"remote":"127.0.0.1:60658","protocol":"op_msg","queues":{"ingress":{"admissions":1},"execution":{}},"workingMillis":0,"durationMillis":0}}
      [j0] {"t":{"$date":"2025-07-17T18:04:57.401+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn9","msg":"Slow query","attr":{"type":"command","isFromUserConnection":true,"ns":"test.sort_on_timeseries_reports_memory_metrics_timeseries","collectionType":"normal","appName":"MongoDB Shell","command":{"getMore":672116388338438151,"collection":"sort_on_timeseries_reports_memory_metrics_timeseries","batchSize":10,"lsid":{"id":{"$uuid":"1811dcd2-ac65-41d0-b92a-fccfcd373dfc"}},"$db":"test"},"originatingCommand":{"aggregate":"system.buckets.sort_on_timeseries_reports_memory_metrics_timeseries","pipeline":[{"$_internalUnpackBucket":{"timeField":"time","metaField":"metadata","bucketMaxSpanSeconds":3600,"assumeNoMixedSchemaData":true,"usesExtendedRange":false,"fixedBuckets":false}},{"$_internalInhibitOptimization":{}},{"$sort":{"time":-1}}],"allowDiskUse":false,"cursor":{"batchSize":10},"collation":{"locale":"simple"}},"planSummary":"COLLSCAN","cursorid":672116388338438151,"keysExamined":0,"docsExamined":0,"hasSortStage":true,"nBatches":1,"numYields":0,"nreturned":10,"inUseMemBytes":85850,"maxUsedMemBytes":85850,"planCacheShapeHash":"4E45B701","queryHash":"4E45B701","planCacheKey":"36FF8BFB","queryFramework":"classic","reslen":11475,"locks":{},"cpuNanos":816106,"remote":"127.0.0.1:60658","protocol":"op_msg","queues":{"ingress":{"admissions":1},"execution":{}},"workingMillis":0,"durationMillis":0}}
      [j0] {"t":{"$date":"2025-07-17T18:04:57.410+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn9","msg":"Slow query","attr":{"type":"command","isFromUserConnection":true,"ns":"test.sort_on_timeseries_reports_memory_metrics_timeseries","collectionType":"normal","appName":"MongoDB Shell","command":{"getMore":672116388338438151,"collection":"sort_on_timeseries_reports_memory_metrics_timeseries","batchSize":10,"lsid":{"id":{"$uuid":"1811dcd2-ac65-41d0-b92a-fccfcd373dfc"}},"$db":"test"},"originatingCommand":{"aggregate":"system.buckets.sort_on_timeseries_reports_memory_metrics_timeseries","pipeline":[{"$_internalUnpackBucket":{"timeField":"time","metaField":"metadata","bucketMaxSpanSeconds":3600,"assumeNoMixedSchemaData":true,"usesExtendedRange":false,"fixedBuckets":false}},{"$_internalInhibitOptimization":{}},{"$sort":{"time":-1}}],"allowDiskUse":false,"cursor":{"batchSize":10},"collation":{"locale":"simple"}},"planSummary":"COLLSCAN","cursorid":672116388338438151,"keysExamined":0,"docsExamined":0,"hasSortStage":true,"nBatches":1,"numYields":0,"nreturned":10,"inUseMemBytes":85850,"maxUsedMemBytes":85850,"planCacheShapeHash":"4E45B701","queryHash":"4E45B701","planCacheKey":"36FF8BFB","queryFramework":"classic","reslen":11475,"locks":{},"cpuNanos":768189,"remote":"127.0.0.1:60658","protocol":"op_msg","queues":{"ingress":{"admissions":1},"execution":{}},"workingMillis":0,"durationMillis":0}} 

       

              Assignee:
              Unassigned
              Reporter:
              Aaron Baruch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: