[COMPASS-4313] Aggregation pipeline applies sample mode with $out Created: 28/May/20  Updated: 03/Jun/20  Resolved: 03/Jun/20

Status: Closed
Project: Compass
Component/s: Aggregation pipeline
Affects Version/s: None
Fix Version/s: No version

Type: Bug Priority: Major - P3
Reporter: Nic Cottrell Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to COMPASS-4312 Aggregation pipeline applies sampling... Closed

 Description   

Context

  • config.chunks collections with 811k documents
  • Compass Version 1.21.2

Steps:

  1. Add $group stage with code: 

     {
     _id: "$shard",
     count: {
     $sum: 1
     }
    }

  2. Turn off sample mode
  3. Add a $out stage to collection chunks_summary
  4. See that output document in chunks_summary includes { "_id" : "shard_5", "count" : 5 }

Expected:

  • The document in chunks_summary should have had count 626.
  • I would never expect the sampling to be applied to the $out even if Sample mode was enabled

Theory

  • It seems that turning off sample mode on an existing pipeline doesn't apply directly.

Workaround:

  • If I start a new pipeline, then turn off sample mode before creating any stages it works.


 Comments   
Comment by Massimiliano Marcon [ 03/Jun/20 ]

We are going to look (and address) the related issue (COMPASS-4312) but we won't fix this one. I think it's confusing if you have sample mode enabled and the pipeline only behaves in the "sample way" only when it does not end with $out (or $merge).

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