Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-78894

Allow update to work with a partial shard key and without the two phase protocol

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Sharding NYC
    • Sharding NYC 2023-07-24, Sharding NYC 2023-08-07, Sharding NYC 2023-08-21

      At the moment, update commands do not work if you do not specify the full shard key in the following cases when the two phase protocol is disabled:

      • If the update command updates the shard key, then the full shard key has to be specified in the query
      • If the update command has `upsert == true` then the full shard key has to be specified in the query

      This ticket should investigate and modify those cases so that they still work even if a partial shard key is provided (if it is possible). This code should also be backported to 5.0 and 6.0. 

      The context for why this ticket is needed is that customers use resharding to quickly add a new shard, and that involves first refining the shard key to a new temporary shard key and then refining it back to the original. When the shard key is refined to a temporary one, that will cause some of the user's existing update queries to break as they expect the new full refined shard key. So this ticket will prevent user's existing queries from breaking when they refine their shard key temporarily for resharding. 

            wenqin.ye@mongodb.com Wenqin Ye
            wenqin.ye@mongodb.com Wenqin Ye
            0 Vote for this issue
            4 Start watching this issue