[SERVER-41487] Fix $merge mode 'whenNotMatched:fail' to send updates to mongos Created: 04/Jun/19  Updated: 29/Oct/23  Resolved: 06/Jun/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.2.0-rc1, 4.3.1

Type: Bug Priority: Major - P3
Reporter: Arun Banala Assignee: Anton Korshunov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File merge_to_existing.js    
Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Steps To Reproduce:

Attached JS test to reproduce the issue

Sprint: Query 2019-06-17
Participants:
Linked BF Score: 0

 Description   

The 'makeStrictUpdateStrategy()' in document_source_merge.cpp is using 'updateWithStatus()' to do updates. The 'updateWithStatus()' is not implemented in 'MongoInterfaceShardServer'. So it ends up calling the method from its parent class 'MongoInterfaceStandalone'. We need to fix this by implementing 'updateWithStatus()' in 'MongoInterfaceShardServer'

We have also noticed that, when source is unsharded and target is sharded, mongos throws this error message instead of the original message of shard. We need to verify that it is not the case after the fix.



 Comments   
Comment by Githook User [ 07/Jun/19 ]

Author:

{'name': 'Anton Korshunov', 'email': 'anton.korshunov@mongodb.com', 'username': 'antkorsh'}

Message: SERVER-41487 Fix $merge mode whenNotMatched:fail to send updates to mongos

(cherry picked from commit fceb78e0af803b1d16b3b66ee7264d1d7f716773)
Branch: v4.2
https://github.com/mongodb/mongo/commit/ecd0a5451eda3c92c5466475df432efc9063742b

Comment by Githook User [ 06/Jun/19 ]

Author:

{'name': 'Anton Korshunov', 'email': 'anton.korshunov@mongodb.com', 'username': 'antkorsh'}

Message: SERVER-41487 Fix $merge mode whenNotMatched:fail to send updates to mongos
Branch: master
https://github.com/mongodb/mongo/commit/fceb78e0af803b1d16b3b66ee7264d1d7f716773

Generated at Thu Feb 08 04:57:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.