[SERVER-41455] Support running $out or $merge from a secondary with writes to the primary Created: 03/Jun/19  Updated: 29/Oct/23  Resolved: 20/Apr/20

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

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Backlog - Query Team (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-868 Support running $out or $merge from a... Closed
Documented
is documented by DOCS-13605 Investigate changes in SERVER-41455: ... Closed
Related
is related to SERVER-8853 MapReduce jobs execute exclusively on... Closed
is related to SERVER-18992 DBClientRS should check aggregation p... Closed
Assigned Teams:
Query
Backwards Compatibility: Fully Compatible
Participants:

 Description   

It should be possible to perform reads from a secondary node and send the writes to the primary. If the read part of a pipeline is expensive but the write is not so expensive, this could help decrease load on the primary.



 Comments   
Comment by David Storch [ 20/Apr/20 ]

This work was completed in 4.4 over a series of commits. Therefore, I'm closing this umbrella ticket as fixed in 4.4.0-rc0 despite there being no specific commits against it.

If a client sends an aggregate command with $out or $merge to a replica set secondary in a FCV "4.4" deployment, and provides a non-primary read preference, then the query will be computed on the secondary node but will direct any write operations to the primary node. (In a sharded scenario, writes may be directed to the primary nodes of multiple shards.) In previous versions, such operations would fail uncleanly, and so drivers would never direct $out or $merge operations to replica set secondaries. Note that as of this writing, drivers have not done the work to expose this new feature to applications. Drivers may choose to only expose $out/$merge on secondaries starting in 4.6 in order to simply handling of the 4.2/4.4 upgrade/downgrade process.

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