$out can leave unsplittable collection on wrong shard if moveCollection races after temp creation

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Catalog and Routing
    • 🟥 DDL
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-114507 fixed a bug where, for an unsplittable collection, $out created the target collection on the primary shard even though it was previously moved to another shard.

      This was fixed by picking the temp collection's shard in createTemporaryCollection(). However, If moveCollection relocates the destination after that decision, $out can finish on the pre-move shard.

      The test agg_write_targeting.js is testing this scenario but is currently commented out until we decide how we want to fix this.

      We should decide whether we:

      1. Fail $out if placement changed?
      2. Keep freezing placement at temp creation (current behavior)?

            Assignee:
            Unassigned
            Reporter:
            Meryama Nadim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: