[SERVER-78472] $densify creates documents outside of bounds Created: 27/Jun/23  Updated: 29/Oct/23  Resolved: 30/Jun/23

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc7, 6.0.9

Type: Bug Priority: Major - P3
Reporter: Timo Lackmann (Inactive) Assignee: Ted Tuckman
Resolution: Fixed Votes: 0
Labels: query-product-scope-1, query-product-urgency-1, query-product-value-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File $density_screenshot.png     HTML File agg_pipeline    
Issue Links:
Backports
Assigned Teams:
Query Integration
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v7.0, v6.0
Participants:

 Description   

When running the attached aggregation pipeline we can see that $density stage is creating a document that is outside of the lower bound.

One example document is this one:

{
  "date": {
    "$date": "2023-04-30T22:00:00.000Z"
  },
  "identifier": {
    "timeSeriesMetaId": {
      "$oid": "649155e254fed3423f67efec"
    },
    "transactionId": "a6467a8e-cd71-425c-afc7-0d33bc7892bf",
    "validFrom": {
      "$date": "2023-06-20T09:01:20.643Z"
    }
  },
  "_id": {
    "$oid": "64916ae054fed3423f002c3a"
  },
  "__v": 0,
  "value": 27
}

This was discovered on Atlas with MongoDB 6.0.6



 Comments   
Comment by Githook User [ 05/Jul/23 ]

Author:

{'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}

Message: SERVER-78472 Fix $densify when input ends before explicit range

(cherry-picked from commit 95b46aad7d7334ad9c8bd5e499b8940738083e81)
Branch: v6.0
https://github.com/mongodb/mongo/commit/7137a5db0acf815835ac89f5acec4dd49adb1aad

Comment by Githook User [ 05/Jul/23 ]

Author:

{'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}

Message: SERVER-78472 Fix $densify when input ends before explicit range

(cherry-picked from commit a095e73f121c3f6f42a33e0b488629906974b99a)
Branch: v7.0
https://github.com/mongodb/mongo/commit/95b46aad7d7334ad9c8bd5e499b8940738083e81

Comment by Githook User [ 03/Jul/23 ]

Author:

{'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}

Message: SERVER-78472 Fix $densify when input ends before explicit range
Branch: EVG-17874-taskgen-test
https://github.com/mongodb/mongo/commit/a095e73f121c3f6f42a33e0b488629906974b99a

Comment by Githook User [ 30/Jun/23 ]

Author:

{'name': 'Ted Tuckman', 'email': 'ted.tuckman@mongodb.com', 'username': 'TedTuckman'}

Message: SERVER-78472 Fix $densify when input ends before explicit range
Branch: master
https://github.com/mongodb/mongo/commit/a095e73f121c3f6f42a33e0b488629906974b99a

Comment by Katya Kamenieva [ 27/Jun/23 ]

I think we should fix it soon, it's correctness issue

Comment by Timo Lackmann (Inactive) [ 27/Jun/23 ]

agg_pipeline (3 kB)

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