[SERVER-79582] Remove HostTypeRequirement::kPrimaryShard from $merge Created: 01/Aug/23  Updated: 29/Oct/23  Resolved: 18/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Ivan Fefer
Resolution: Fixed Votes: 0
Labels: pm3229-m1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by COMPASS-7355 Investigate changes in SERVER-79582: ... Closed
Documented
is documented by DOCS-16447 Investigate changes in SERVER-79582: ... Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Sprint: QE 2023-10-16, QE 2023-10-30
Participants:

 Description   

Use kNone instead of kPrimaryShard. Change distributedPlanLogic() such that we indicate which shard the $merge should execute on in the case that a single shard owns all the data.

Test cases:

  • Input and output collections unsharded but reside on two different non-primary shards
  • Input collection sharded, output collection unsharded but not on primary shard
  • Input collection unsharded but not on primary shard, output collection sharded
  • Input and output collections unsharded and input collection is moved during execution. The query should fail with QueryPlanKilled.
  • Input and output collections unsharded and output collection is moved during execution. During execution, update commands should switch over to targeting the inner collection’s new owner or the query should fail with QueryPlanKilled.
  • Input is not a collection, but $documents, so we should run on the shard that owns output collection (if present)


 Comments   
Comment by Githook User [ 17/Oct/23 ]

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-79582 Add a way for pipeline to request exact shard to be merger and use it in $merge
Branch: master
https://github.com/mongodb/mongo/commit/4a1b0a119002b802b448bf446ef40313652c7e32

Comment by Ivan Fefer [ 11/Oct/23 ]

> In case of input and output collections are on different shards, which shard should we prefer?

According to current implementation, output shard, as having local writes is more profitable than local reads 

Comment by Ivan Fefer [ 10/Oct/23 ]

In case of input and output collections are on different shards, which shard should we prefer?

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