[SERVER-47581] mongoS does not set 'useNewUpsert' on $mergeCursors pipelines [4.4, 4.2] Created: 16/Apr/20  Updated: 29/Oct/23  Resolved: 22/Apr/20

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.2.7, 4.4.0-rc3

Type: Bug 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:
Backports
Depends
Related
is related to SERVER-43860 Pipeline style update in $merge can p... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Query 2020-04-20, Query 2020-05-04
Participants:
Linked BF Score: 50

 Description   

In SERVER-43860, we fixed the behaviour of $merge in the case where we have {whenMatched: pipeline} and {whenNotMatched: insert}. For upgrade/downgrade purposes, we made this new behaviour conditional on the presence of a flag, useNewUpsert, which is set by 4.4 mongoS on aggregations that are sent to the shards. We then backported this fix to 4.2.2.

However, in cases where a $merge is sent to a shard as part of a $mergeCursors pipeline, the 'useNewUpsert' flag is not set on the command. In these scenarios, the old incorrect behaviour is still observed.



 Comments   
Comment by Githook User [ 04/May/20 ]

Author:

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

Message: SERVER-47581 Set 'useNewUpsert' on $mergeCursors aggregations

(cherry picked from commit dda2fb45cbf624c9270f8fad7f3c5c5a2f0834eb)
Branch: v4.2
https://github.com/mongodb/mongo/commit/1abf05a44fbb0d072ebdb3fb133e35e0c17c57e3

Comment by Githook User [ 22/Apr/20 ]

Author:

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

Message: SERVER-47344 Change agg_merge_upsert_supplied_cluster.js to avoid downgrade to 4.2.1 SERVER-47581 Set 'useNewUpsert' on $mergeCursors aggregations
Branch: v4.4
https://github.com/mongodb/mongo/commit/dda2fb45cbf624c9270f8fad7f3c5c5a2f0834eb

Generated at Thu Feb 08 05:14:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.